secure-agent-playbook

Play: Agent Security Audit

Evaluate AI agent implementations for security risks including excessive permissions, prompt injection surfaces, data exfiltration paths, and unsafe tool usage.

Trigger Conditions

Use this skill when:

Inputs

Procedure

1. Permission Inventory

Enumerate every tool and capability the agent has access to:

Flag: Does the agent have capabilities beyond what its stated purpose requires?

2. Prompt Injection Surface Analysis

For technique-level injection testing (18 attack techniques, 20 evasion methods), see prompt-injection-testing.md.

For each input path to the agent, assess injection risk:

Input Path Risk Level Injection Vector
User messages Medium Direct prompt injection
Tool outputs (API responses, file contents, web fetches) High Indirect prompt injection
MCP resource content High Indirect prompt injection via resource data
Retrieved documents (RAG) High Indirect prompt injection via poisoned documents
Environment variables Low Supply chain / config injection

For each HIGH risk path, check:

3. Excessive Agency Assessment (OWASP LLM06)

Check whether the agent can:

4. Data Exfiltration Path Analysis

Map how sensitive data could leave the agent’s boundary:

5. Tool-Call Injection Assessment

For each tool the agent can invoke:

6. Guardrail Evaluation

Check for presence and effectiveness of:

Output Format

## Agent Security Audit: [Agent Name/Description]

### Permission Summary
| Category | Access Level | Justified? |
|----------|-------------|-----------|
| File System | Read/Write to /path | Yes/No — reason |
| Network | External API access | Yes/No — reason |
| Shell | Sandboxed/Unsandboxed | Yes/No — reason |
| Credentials | [list] | Yes/No — reason |

### Risk Findings
[Use standard finding template for each issue found]

### Injection Surface Map
[Table of input paths with risk ratings]

### Recommendations
[Prioritized list: reduce permissions, add confirmations, sandbox, etc.]

OWASP References