National Cyber Warfare Foundation (NCWF)login

hol-guard for runtime security of AI coding agents


0 user ratings
2026-10-26 05:30:10
milo
Red Team (CNA)
"hol-guard

hol-guard is a local-first antivirus-style layer that reviews shell commands, package installs, and MCP tool calls from AI agents before they execute, for defensive use by authorized professionals.








Toolhashgraph-online/hol-guard — open-source, local-first antivirus for AI agents, plugins, skills, and MCP servers
CategoryAI agent runtime security and supply-chain scanning
Primary UseIntercepting destructive shell commands, secret exposure, prompt injection, and risky package installs from agents like Claude Code, Codex, and Gemini CLI before they run
Safe UseHardening your own workstations and CI pipelines during authorized development, security research, and internal assessments; purely defensive interception and auditing
Telemetry NoteRecords local decision receipts for every allow/block/approval, exports an AI bill of materials via hol-guard abom, and produces SARIF reports in CI — defenders get a full audit trail

hol-guard from hashgraph-online positions itself as an open-source antivirus for AI agents, and the metaphor is apt: rather than scanning files for malicious signatures, it sits in the execution path of coding agents such as Codex, Claude Code, Cursor, Cline, Gemini CLI, OpenCode, and Devin, reviewing each proposed action before it runs. The surfaces it covers are exactly the ones that keep security teams awake in 2026 — shell commands, file access, package installs, and MCP tool calls. With 618 stars, an Apache-2.0 license, and a pure Python codebase requiring 3.10+, it is an unusually mature entry in the young agent-security niche.


Architecturally, the project is a policy enforcement point rather than a sandbox. Guard connects through native agent hooks, managed MCP proxies, and launch integrations, so coverage depends on what events each agent actually exposes — a trade-off the README is refreshingly honest about, pointing to a support matrix that documents enforcement, approval delivery, and failure behavior per integration. For Codex, for instance, Guard installs native pre-tool hooks and refuses a managed launch if those hooks are missing or disabled, which is the right fail-closed posture. This matters for defenders: an integration that silently degrades to allow-through would be worse than no tool at all.


The detection logic spans several distinct risk classes. For shell and file operations, it reviews destructive commands, sensitive file access, credential exposure, and suspicious outbound activity. For the supply chain, it evaluates package-manager operations against supply-chain intelligence before installation — the model of an antivirus checking a download before it lands. For prompts and tool results, it screens supported events for prompt injection and sensitive content, which is where the agent-security and prompt-injection topics in the repo metadata become concrete. The verdict engine then allows, blocks, or routes the action to a human approval flow according to your policy.


Operationally, the tool is local-first: no account is required, decisions and receipts stay on the machine, and an optional Guard Cloud adds shared history, team policy, and fleet management for organizations that want centralized visibility. Installation is a two-liner via pipx: pipx install hol-guard followed by hol-guard init, which launches a first-run wizard that discovers supported agents and walks through protection setup. The wizard asks before each change, including opening the dashboard or connecting cloud services — a consent-first design that security teams will appreciate when evaluating what the tool itself touches.


The everyday CLI surface is dense but coherent. hol-guard status reports protection state, hol-guard doctor codex diagnoses a specific agent integration, hol-guard diff codex inspects artifact changes before launch, and hol-guard inventory lists tracked plugins, skills, and agent configuration. Two commands stand out for forensic value: hol-guard receipts reads the recorded decision history, and hol-guard abom --format json exports an AI bill of materials — essentially an SBOM for your agent ecosystem, which is rapidly becoming a compliance requirement as agents accumulate third-party skills and MCP servers.


The command-classification engine is inspectable without execution, which is a strong defensive design. hol-guard command test 'rm -rf ./build' and hol-guard command explain 'git clean -ndx' show the classification and matching rules for a command without running it or creating an approval, and hol-guard command extensions command.git --json dumps coverage from the Rust-compiled catalog. The README notes that external extension contributions require explicit opt-in while core protections stay enabled — a sensible supply-chain posture for the tool guarding your supply chain. When something is blocked, pending approvals are resolved through hol-guard approvals approve or the deny equivalent, or through native agent prompts.


The second major component shipped in the same repository is plugin-scanner, aimed at maintainers rather than end users. It runs security and quality checks before publishing agent plugins, skills, and MCP integrations: scan produces findings and a quality report, lint gives rule-level authoring feedback, verify checks install-surface and runtime readiness, submit builds a submission artifact, and doctor bundles diagnostics. It detects package formats for Codex, Claude Code, DeepSeek Harness, Gemini CLI, Kimi Code, and OpenCode, selected via --list-ecosystems or --ecosystem.


The scanner's check coverage is broad for a young tool: manifests, embedded secrets, MCP transport and command configuration, approval defaults, skills, dependency lockfiles, and even GitHub Actions permissions. Reports render as text, JSON, Markdown, or SARIF, with --fail-on-severity high and min_score gates available, and there is a first-party ai-plugin-scanner-action for GitHub Actions with pinned commit SHAs — small details that signal the maintainers practice what the scanner preaches. Optional Cisco integrations add deeper skill and MCP analysis for those willing to install the plugin-scanner[cisco] extra or use the provided Docker image.


A third capability, the Plugin Kit under hol-guard plugin, addresses the fragmentation problem head-on: point it at a single plugin source and it validates it and writes a ready-to-load copy for each runtime — claude-code, codex, gemini-cli, cursor, vscode, opencode, mcp-registry, and agent-skills. The README is explicit that it runs locally, reads only the named folder, and makes no network calls, which makes it safe to run against untrusted plugin sources. hol-guard plugin check surfaces what marketplaces and runtime loaders would reject, and plugin init --name my-plugin scaffolds new work.


For defenders, the most interesting angle is observability. Every allow, block, and approval generates a local receipt, the ABOM export gives you a manifest of every agent, plugin, and MCP server in the environment, and hol-guard supply-chain explain [email protected] --ecosystem npm returns advisory evidence for a specific package verdict. That combination — interception plus audit trail plus inventory — is exactly what incident responders need when an agent does something regrettable and the question becomes what it touched and when.


Caveats worth weighing: enforcement fidelity is bounded by the hooks each agent exposes, so the support matrix deserves real scrutiny before rollout, and trust scoring for skills, MCP, and plugins is still documented as drafts. Still, as an educational and defensive artifact, hol-guard is one of the more complete answers yet to the question of how to let coding agents run with autonomy without handing them the keys. For authorized teams evaluating agent rollout risk, it is well worth a lab deployment.



Official project repository for hashgraph-online/hol-guard.

Download Tool

Educational analysis for authorized security professionals. Use only in controlled, authorized environments.






Source: OffensiveSec
Source Link: https://www.offsecblog.com/2026/10/hol-guard-for-runtime-security-of-ai.html


Comments
new comment
Nobody has commented yet. Will you be the first?
 
Forum
Red Team (CNA)



Copyright 2012 through 2026 - National Cyber Warfare Foundation - All rights reserved worldwide.