Agents generate and execute code in one step. A static audit before delivery catches the patterns that turn a helpful snippet into a compromise.
The gap between generating and running
When an agent writes code and then runs it, the review step that used to exist between a human and a shell has quietly disappeared. A static audit puts a check back in that gap without asking the human to read a diff at 2am.
What a useful audit flags
- Remote code execution:
curl | bash,evalon fetched content, dynamic imports from URLs. - Credential and environment exfiltration: reads of
~/.ssh,.env, cloud metadata endpoints, then a network call. - Reverse shells and bind shells.
- Destructive operations without a guard: recursive deletes, unbounded writes, dropped tables.
- Obfuscation: base64 blobs, long hex strings, unicode escapes that decode to commands.
- Hard-coded secrets, which are a leak even when the code is benign.
- Unsafe library defaults:
shell=True,pickle.loads,verify=False, disabled TLS checks.
Return something actionable
Line numbers and a verdict. "This file looks risky" cannot be fixed; "line 14 pipes a remote script into bash; verdict block" can. audit_code takes a snippet or up to 40 files and returns findings with line numbers, a verdict and a safe_to_deliver flag.
Honest limits
Static analysis does not prove code is safe. A pass means the known patterns were not found. Treat it as a filter that makes the human review shorter, not as a replacement for it.
Try it on a real call. The hosted MCP endpoint answers 50 calls per IP per day without a signup, then 0.01 USDC per call over x402 on Base.
Pricing and endpoint Repository
claude mcp add slf-guardian -- npx -y slf-guardian-mcp