Observed since 21 Oct, 09:51 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Security monitor for AI coding agents — detect hook RCE, MCP poisoning, and API key theft before they execute
Security scanner for AI coding agents -- catch RCE, MCP poisoning, and API key theft before they strike.
Claude Code CVE-2025-59536 gave attackers remote code execution through a single
settings.jsonfile. CVE-2026-21852 showed how poisoned MCP servers can hijack agent communications. 73% of AI deployments have prompt injection vulnerabilities (OWASP). No monitoring tool existed for individual developers. So we built one.
pip install agentguard
agentguard scan .
Shield AgentGuard Security Scan
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[+] File Integrity OK (12 files, 0 changes)
[+] Process Monitor OK (no suspicious processes)
[!] Environment Security WARN (.env is world-readable)
[X] Hooks Audit CRIT (dangerous curl in hooks)
[+] MCP Audit OK (2 servers, all verified)
[+] Secret Scanner OK (0 exposed keys)
[+] Code Scanner OK (0 dangerous patterns)
[+] Network Monitor OK (all connections normal)
[+] Git Monitor OK (no unauthorized changes)
[+] DB Integrity OK (3 databases healthy)
[+] Dependency Audit OK (all pinned, 0 vulns)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Score: 85/100 | CVSS: 9.0 (Critical)
1 critical, 1 warning, 9 passed
Run `agentguard fix` to auto-fix 1 issue.
| Threat | Check | Detects |
|---|---|---|
| Hook RCE | hooks | Malicious commands in .claude/settings.json hooks (CVE-2025-59536) |
| MCP Poisoning | mcp_servers | Unauthorized MCP servers, enableAllProjectMcpServers bypass (CVE-2026-21852) |
| API Theft | env_security | ANTHROPIC_BASE_URL hijacking, exposed .env files |
| Crypto Mining | suspicious_processes | XMRig, CGMiner, and 12+ miner signatures |
| Secret Exposure | secrets | Hardcoded API keys in source and git history |
| Backdoor Ports | network_connections | Connections to ports 4444, 1337, 31337, etc. |
| Code Injection | dangerous_code | eval(), exec(), os.system() in project code |
| File Tampering | file_integrity | SHA256 baseline comparison for critical files |
| Git Anomalies | git_status | Unauthorized changes to protected files |
| DB Corruption | db_integrity | SQLite PRAGMA integrity_check |
| Dep Vulns | dependencies | pip-audit integration + unpinned versions |
AI coding agents (Claude Code, Cursor, Copilot, Windsurf) execute code on your machine with broad filesystem and network access. A single malicious file in a cloned repository can:
ANTHROPIC_BASE_URL to an attacker's proxy.env files, git history, and log filesAgentGuard is the first security scanner purpose-built for this threat model.
agentguard fix repairs safe issues automaticallyfrom agentguard import Guard; Guard().scan()# Scan current project
agentguard scan .
# Scan specific path
agentguard scan /path/to/project
# Run specific checks only
agentguard scan . --checks hooks,mcp_servers
# JSON output for CI/CD
agentguard scan . --json
# Initialize file hash baselines
agentguard init
# Auto-fix safe issues
agentguard fix
# Preview fixes without making changes
agentguard fix --dry-run
# Show version
agentguard version
from agentguard import Guard
# Simple scan
guard = Guard()
result = guard.scan()
print(f"Score: {100 - result.critical_count * 10 - result.warning_count * 3}/100")
# Check specific issues
for check in result.checks:
if check.status == "critical":
print(f"CRITICAL: {check.name}: {check.details}")
for finding in check.findings:
print(f" - {finding}")
# Run specific checks
result = guard.scan(checks=["hooks", "mcp_servers"])
# Initialize baselines
count = guard.init_baseline()
print(f"Saved {count} baselines")
# Auto-fix
actions = guard.fix()
for action in actions:
print(action)
import agentguard
result = agentguard.scan()
print(result.summary())
Create agentguard.json in your project root to customize:
{
"critical_files": [
"main.py",
"core.py",
".claude/settings.json"
],
"watch_directories": [
"tools",
"plugins",
".claude"
],
"known_mcp_servers": [
"filesystem",
"memory",
"brave-search"
]
}
AgentGuard auto-detects most settings from your project structure. Configuration is only needed for customization.
- name: Security scan
run: |
pip install agentguard
agentguard scan . --json > security-report.json
agentguard scan . # exits with code 2 on critical findings
# .pre-commit-config.yaml
repos:
- repo: local
hooks:
- id: agentguard
name: AgentGuard Security Scan
entry: agentguard scan . --checks hooks,mcp_servers,secrets
language: python
pass_filenames: false
additional_dependencies: [agentguard]
| Agent | Hook Check | MCP Check | Config Path |
|---|---|---|---|
| Claude Code | Yes | Yes | .claude/settings.json |
| Cursor | Yes | Yes | .cursor/settings.json |
| VS Code | Yes | Partial | .vscode/settings.json |
| Copilot | Planned | Planned | .github/copilot |
| Windsurf | Planned | Planned | .windsurf/ |
agentguard/
__init__.py # Public API: Guard, scan, CheckResult, ScanResult
_guard.py # Guard orchestrator
cli.py # CLI entry point
config.py # Auto-detecting configuration
core/
result.py # CheckResult, ScanResult dataclasses
severity.py # CVSS score mapping
utils.py # sha256, permissions, version comparison
checks/
__init__.py # Check registry (ALL_CHECKS, get_check_by_name)
file_integrity.py # SHA256 baseline comparison
process_monitor.py # Crypto miner / reverse shell detection
network_monitor.py # Suspicious port connections
env_security.py # .env permissions + gitignore + hash
git_monitor.py # Protected file change detection
db_integrity.py # SQLite PRAGMA integrity_check
secret_scanner.py # API key regex + git history
code_scanner.py # eval/exec/subprocess detection
dependency_audit.py # pip-audit + unpinned versions
hooks_audit.py # Hook RCE detection (CVE-2025-59536)
mcp_audit.py # MCP server poisoning detection
storage/
tracker.py # SQLite persistence (scans, baselines, alerts)
notify/
base.py # Abstract Notifier base class
console.py # Console output with ANSI colours
fix/
auto_fix.py # Automated remediation (permissions, gitignore)
PRs welcome! See CONTRIBUTING.md for guidelines.
# Development setup
git clone https://github.com/jeromwolf/agentguard.git
cd agentguard
pip install -e ".[all]"
pytest tests/ -v
Apache-2.0. See LICENSE for details.
Built by Kelly Wolf. If AgentGuard helped you catch a security issue, consider starring the repo.
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.1.0 | 8 Apr 2026 | 1 |
This describes our collected data; it is not a security assessment.
Observed since 21 Oct, 09:51 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:25d3e44b7b34f2c8882aed193798473a7e150c89d837e7e82377372746b4f433