AI Agent Security Audit
Comprehensive security auditing for AI agent deployments. Detects vulnerabilities across prompt handling, tool permissions, skill behavior, credential management, and runtime operations.
Usage
Invoke with a target agent configuration path or skill directory to scan:
audit: scan /path/to/agent/config
audit: review installed skills
audit: monitor runtime behavior for 30 minutes
Execution Flow
- Configuration Audit — Parse agent config YAML, enumerate permissions, identify over-privileged tool access
- Prompt Injection Test — Run 12 injection patterns (DAN, encoding bypass, role confusion, token smuggling) and score resilience
- Skill Scan — Analyze each installed skill's SKILL.md for suspicious patterns (eval(), shell_exec, credential references, network requests)
- Credential Hygiene — Scan workspace for hardcoded tokens, API keys, private keys in plaintext files
- Runtime Monitor — Observe agent behavior for N minutes, flag any unexpected tool calls, network connections, or file access patterns
- Generate Report — Risk score 0-100, criticality matrix, prioritized remediation steps
Output Format
# Security Audit Report
- **Audit Date**: YYYY-MM-DD HH:MM
- **Audit Scope**: [target]
- **Overall Risk Score**: 67/100 (MEDIUM)
## Critical Findings (2)
- [CRITICAL] Unrestricted shell_executor access allows arbitrary command execution
- [CRITICAL] Skill "data-export" sends data to external endpoint without user consent
## High Findings (3)
- ...
## Recommendations
1. Add allowlist for shell_executor commands
2. Sandbox "data-export" skill network calls
3. ...
Notes
- Requires read access to agent config directory and installed skills path
- Runtime monitoring requires agent process access
- All findings include file paths and line numbers for traceability
- Recommended for any production agent deployment, especially those handling user data or financial operations
