Anti-bypass gate
Parses compound bash, resolves variables, decodes base64 / ANSI-C. Proptest-verified — keyed on structure, not tokens.
A deterministic, offline Rust safety layer for AI coding agents — an anti-bypass command gate that parses Bash structure instead of grepping for substrings, a seccomp + Landlock sandbox for the code an agent actually runs, and a prompt-injection input firewall. No model, no network at scan time.
/plugin install apohara-agentguard
Same input, same verdict — structure over substrings.

Real output from the committed binary. Three obfuscated destructive commands a substring blocklist lets through — all Block; the benign commit whose message merely mentions rm -rf — Allow. The gate keys on structure, not tokens.
AI coding agents run shell commands on your machine; the common guard — a regex blocklist in a hook — is trivially bypassed by variable aliasing, base64, compound chains and whitespace tricks. AgentGuard parses the command structure instead of matching strings, and for anything that runs adds a fail-closed seccomp + Landlock sandbox. Deterministic. No LLM in the loop.
Three layers — detect, contain, filter.
Parses compound bash, resolves variables, decodes base64 / ANSI-C. Proptest-verified — keyed on structure, not tokens.
seccomp + Landlock, fail-closed: network-denied, filesystem-scoped. No Docker, no cloud. Linux today.
A deterministic prefilter scans tool results and fetched content for prompt-injection patterns before they reach the agent. No model call.
What the code backs — and where the boundary sits.
The full evasion scorecard ships in the repo. Publishing where the boundary sits is the difference between a safety claim and a marketing claim.
Three steps to a guarded Bash tool.
/plugin marketplace add SuarezPM/apohara-agentguard
Add the marketplace in Claude Code.
/plugin install apohara-agentguard
Installs the PreToolUse hook (or cargo install apohara-agentguard for the standalone binary).
agentguard check "rm -rf /"
Verify it's live; the hook now guards every Bash call.