1
---
2
name: agent-owasp-compliance
3
description: |
4
Check any AI agent codebase against the OWASP Agentic Security Initiative (ASI) Top 10 risks.
5
Use this skill when:
6
- Evaluating an agent system's security posture before production deployment
7
- Running a compliance check against OWASP ASI 2026 standards
8
- Mapping existing security controls to the 10 agentic risks
9
- Generating a compliance report for security review or audit
10
- Comparing agent framework security features against the standard
11
- Any request like "is my agent OWASP compliant?", "check ASI compliance", or "agentic security audit"
12
---
13
14
# Agent OWASP ASI Compliance Check
15
16
Evaluate AI agent systems against the OWASP Top 10 for Agentic Applications 2026, published in December 2025 by the OWASP GenAI Security Project's Agentic Security Initiative (ASI).
17
18
## Overview
19
20
The OWASP Top 10 for Agentic Applications defines the highest-impact security risks specific to autonomous AI agents — not LLMs, not chatbots, but agents that call tools, access systems, and act on behalf of users. This skill checks whether your agent implementation has controls for each risk. The IDs and names below are the published ones; use them as written in reports so each finding traces back to the OWASP entry.
21
22
```
23
Codebase → Scan for controls against each ASI risk:
24
ASI01: Agent Goal Hijack
25
ASI02: Tool Misuse and Exploitation
26
ASI03: Identity and Privilege Abuse
27
ASI04: Agentic Supply Chain Vulnerabilities
28
ASI05: Unexpected Code Execution (RCE)
29
ASI06: Memory & Context Poisoning
30
ASI07: Insecure Inter-Agent Communication
31
ASI08: Cascading Failures
32
ASI09: Human-Agent Trust Exploitation
33
ASI10: Rogue Agents
34
→ Generate Compliance Report (X/10 covered)
35
```
36
37
## The 10 Risks
38
39
| Risk | Name | What to Look For |
40
|------|------|-----------------|
41
| ASI01 | Agent Goal Hijack | Untrusted input (prompts, documents, retrieved content, tool output) validated before it can change goals, plans or tool calls |
42
| ASI02 | Tool Misuse and Exploitation | Tool allowlists, per-tool least privilege, argument validation, rate and cost limits |
43
| ASI03 | Identity and Privilege Abuse | Per-agent identity, short-lived scoped credentials, no self-promotion, no unscoped privilege inheritance on delegation |
44
| ASI04 | Agentic Supply Chain Vulnerabilities | Signed or hash-pinned plugins, tools, prompts and MCP servers, dependency pinning, SBOM |
45
| ASI05 | Unexpected Code Execution (RCE) | No `eval()`/`exec()` or `shell=True` on agent-generated input outside an isolated sandbox (separate process, non-root, no network by default, limited filesystem and resources) |
46
| ASI06 | Memory & Context Poisoning | Validated memory and RAG writes, per-user or per-tenant segmentation, provenance, expiry of unverified entries |
47
| ASI07 | Insecure Inter-Agent Communication | Authenticated and signed inter-agent messages, replay protection, no blind trust of peer agents |
48
| ASI08 | Cascading Failures | Circuit breakers and quotas between agents, deterministic policy enforcement outside the planner, fail-closed |
49
| ASI09 | Human-Agent Trust Exploitation | Explicit confirmation for sensitive actions, risk summaries not written by the model, previews with no side effects |
50
| ASI10 | Rogue Agents | Tamper-evident audit trail, behavioral monitoring against a baseline, kill switch and credential revocation |
51
52
---
53
54
## Check ASI01: Agent Goal Hijack
55
56
Look for input validation that runs **before** tool execution, not after LLM generation. OWASP treats all natural-language input, including uploaded documents and retrieved content, as untrusted until it has been validated.
57
58
```python
59
from pathlib import Path
60
61
def check_asi_01(project_path: str) -> dict:
62
"""ASI01: Is user input validated before reaching tool execution?"""
63
positive_patterns = [
64
"input_validation", "validate_input", "sanitize",
65
"classify_intent", "prompt_injection", "threat_detect",
66
"PolicyEvaluator", "PolicyEngine", "check_content",
67
]
68
# eval/exec/shell=True patterns belong to ASI05 (Unexpected Code Execution)
69
70
# Scan Python files for signals
71
root = Path(project_path)
72
positive_matches = []
73
74
for py_file in root.rglob("*.py"):
75
content = py_file.read_text(errors="ignore")
76
for pattern in positive_patterns:
77
if pattern in content:
78
positive_matches.append(f"{py_file.name}: {pattern}")
79
80
positive_found = len(positive_matches) > 0
81
82
return {
83
"risk": "ASI01",
84
"name": "Agent Goal Hijack",
85
"status": "pass" if positive_found else "fail",
86
"controls_found": positive_matches,
87
"recommendation": "Add input validation before tool execution, not just output filtering"
88
}
89
```
90
91
**What passing looks like:**
92
```python
93
# GOOD: Validate before tool execution
94
result = policy_engine.evaluate(user_input)
95
if result.action == "deny":
96
return "Request blocked by policy"
97
tool_result = await execute_tool(validated_input)
98
```
99
100
**What failing looks like:**
101
```python
102
# BAD: User input goes directly to tool
103
tool_result = await execute_tool(user_input) # No validation
104
```
105
106
---
107
108
## Check ASI02: Tool Misuse and Exploitation
109
110
Verify tools have allowlists, argument validation, and bounded scope, so a legitimate tool cannot be used in an unsafe or unintended way.
111
112
**What to search for:**
113
- Tool registration with explicit allowlists (not open-ended)
114
- Argument validation before tool execution
115
- Per-tool least privilege: read-only where possible, no send or delete rights a tool does not need
116
- Rate, cost or token budgets on tool calls
117
118
**Failing:** Agent has access to all tools by default.
119
**Passing:** Agent capabilities defined as a fixed allowlist, unknown tools denied.
120
121
**Passing example:**
122
```python
123
ALLOWED_TOOLS = {"search", "read_file", "create_ticket"}
124
125
def execute_tool(name: str, args: dict):
126
if name not in ALLOWED_TOOLS:
127
raise PermissionError(f"Tool '{name}' not in allowlist")
128
# validate args...
129
return tools[name](**validated_args)
130
```
131
132
---
133
134
## Check ASI03: Identity and Privilege Abuse
135
136
Verify each agent has its own identity and cannot gain privileges it was not granted, directly or through delegation.
137
138
**What to search for:**
139
- Per-agent credentials, not shared credentials or string names (`agent_name = "my-agent"`)
140
- Cryptographic identity (DID-based `did:web:` / `did:key:`, Ed25519 or similar signing) bound to specific capabilities
141
- Short-lived, task-scoped credentials with rotation
142
- Privilege level checks before sensitive operations
143
- No self-promotion patterns (agent changing its own trust score or role)
144
- Delegation narrowing (child scope <= parent scope)
145
- Escalation requires external attestation (human or SRE witness)
146
147
**Failing:** Agent can modify its own configuration or permissions, or all agents share one credential.
148
**Passing:** Each agent holds its own scoped credential, and privilege changes require out-of-band approval (e.g., Ring 0 requires SRE attestation).
149
150
---
151
152
## Check ASI04: Agentic Supply Chain Vulnerabilities
153
154
Verify agent plugins, tools, prompts and MCP servers have integrity verification.
155
156
**What to search for:**
157
- `INTEGRITY.json` or manifest files with SHA-256 hashes
158
- Signature verification on plugin installation
159
- Dependency pinning (no `@latest`, `>=` without upper bound)
160
- Prompts and tool definitions pinned by content hash or commit, not fetched unpinned at runtime
161
- SBOM generation
162
163
---
164
165
## Check ASI05: Unexpected Code Execution (RCE)
166
167
Verify that agent-generated code or model-influenced input cannot reach an interpreter or shell unchecked.
168
169
**What to search for:**
170
- No `eval()` or `exec()` on agent-generated code or content in the agent's own process, or anywhere that does not meet the isolation properties below
171
- No `subprocess.run(shell=True)` or `os.system()` with model- or user-controlled input
172
- Human approval or an allowlist for auto-executed commands
173
174
**Isolation properties (all required for execution to count as sandboxed):**
175
- A process boundary separate from the agent: container, microVM or separate OS process. Restricted globals passed to `exec` inside the agent's interpreter do not count.
176
- Runs as non-root, with no added capabilities
177
- No network by default; any egress goes through an explicit allowlist
178
- Filesystem limited to a scratch or read-only workspace, with no host mounts and no access to the agent's credentials or environment secrets
179
- CPU, memory and wall-clock limits, with the sandbox discarded after each run
180
181
**Failing:** `exec()` called on model output inside the agent loop, including with restricted globals.
182
**Passing:** Generated code is statically checked, then run in a sandbox that meets every isolation property above.
183
184
---
185
186
## Check ASI06: Memory & Context Poisoning
187
188
Verify that what the agent stores and later retrieves (conversation memory, summaries, embeddings, RAG stores) cannot be silently poisoned.
189
190
**What to search for:**
191
- Validation of new memory and RAG writes before they are committed
192
- Memory segmented per user, session or tenant (separate namespaces in vector stores)
193
- Source attribution stored with each entry
194
- The agent's own outputs not written back into trusted memory automatically
195
- Expiry or decay of unverified entries
196
197
**Failing:** One shared vector store with no namespaces, and any chat message can be persisted as long-term memory.
198
**Passing:** Per-tenant namespaces, writes validated and tagged with provenance, unverified entries expire.
199
200
---
201
202
## Check ASI07: Insecure Inter-Agent Communication
203
204
In multi-agent systems, verify that agents authenticate each other and the messages they exchange before acting on them.
205
206
**What to search for:**
207
- Agent identity verification (DIDs, signed tokens, mutual TLS)
208
- Message signing and signature verification
209
- Nonces or timestamps so replayed messages are rejected
210
- Trust score checks before accepting delegated tasks
211
- No blind trust of inter-agent messages
212
213
**Passing example:**
214
```python
215
def accept_task(sender_id: str, task: dict):
216
trust = trust_registry.get_trust(sender_id)
217
if not trust.meets_threshold(0.7):
218
raise PermissionError(f"Agent {sender_id} trust too low: {trust.current()}")
219
# The signature covers task["nonce"] and task["expires_at"].
220
if not verify_signature(task, sender_id):
221
raise SecurityError("Task signature verification failed")
222
if task["expires_at"] <= time.time():
223
raise SecurityError("Task has expired")
224
# Atomic insert: fails if this sender already used this nonce.
225
if not nonce_store.add_if_absent(sender_id, task["nonce"], expires_at=task["expires_at"]):
226
raise SecurityError("Replayed task rejected")
227
return process_task(task)
228
```
229
230
---
231
232
## Check ASI08: Cascading Failures
233
234
Verify that a single fault in one agent (a hallucination, a poisoned input, a compromised tool) cannot propagate unchecked across agents and workflows.
235
236
**What to search for:**
237
- Circuit breakers that trip on repeated failures, and quotas between planner and executor
238
- Policy enforcement outside the planner, using deterministic logic (YAML rules, code predicates)
239
- No LLM calls in the enforcement path
240
- Policy checks cannot be skipped or overridden by the agent
241
- Fail-closed behavior (if policy check errors, action is denied)
242
243
**Failing:** Agent decides its own permissions via prompt ("Am I allowed to...?"), and downstream agents execute whatever the planner emits.
244
**Passing:** PolicyEvaluator.evaluate() returns allow/deny in <0.1ms with no LLM involved, and a circuit breaker stops the chain after N failures.
245
246
---
247
248
## Check ASI09: Human-Agent Trust Exploitation
249
250
Verify that a confident or persuasive agent explanation cannot stand in for human verification of a sensitive action.
251
252
**What to search for:**
253
- Explicit confirmation step before sensitive or irreversible actions (payments, deletions, privilege changes)
254
- Risk summaries for approvals generated by the application, not by the model
255
- Preview views that make no network or state-changing calls
256
- A way for users to flag suspicious agent behavior
257
258
**Failing:** A single "Approve" button under a model-written justification triggers a payment.
259
**Passing:** High-risk actions show a fixed, application-generated risk summary and require a separate confirmation.
260
261
---
262
263
## Check ASI10: Rogue Agents
264
265
Verify the system can detect an agent that deviates from its intended function or scope, and stop it.
266
267
**What to search for:**
268
- Structured logging for every tool call (not just print statements)
269
- Audit entries include: timestamp, agent ID, tool name, args, result, policy decision
270
- Append-only or hash-chained log format, stored separately from agent-writable directories
271
- Anomaly detection on tool call patterns (frequency, targets, timing)
272
- Trust score decay over time (temporal decay)
273
- Kill switch or emergency stop capability, with credential revocation
274
275
**Failing:** Agent actions logged via `print()` or not at all, and no mechanism to stop a misbehaving agent.
276
**Passing:** Structured JSONL audit trail with chain hashes, drift alerts, trust decays without activity, kill switch available.
277
278
---
279
280
## Compliance Report Format
281
282
```markdown
283
# OWASP ASI Compliance Report
284
Generated: 2026-04-01
285
Project: my-agent-system
286
287
## Summary: 6/10 Risks Covered
288
289
| Risk | Status | Finding |
290
|------|--------|---------|
291
| ASI01 Agent Goal Hijack | PASS | PolicyEngine validates input before tool calls |
292
| ASI02 Tool Misuse and Exploitation | PASS | Tool allowlist enforced in governance.py |
293
| ASI03 Identity and Privilege Abuse | FAIL | Ring promotion requires attestation, but agents use string names and share credentials |
294
| ASI04 Agentic Supply Chain Vulnerabilities | FAIL | No integrity manifests or plugin signing |
295
| ASI05 Unexpected Code Execution (RCE) | PASS | No eval/exec on model output outside an isolated sandbox; generated code runs in one |
296
| ASI06 Memory & Context Poisoning | FAIL | Shared vector store with no per-tenant namespaces |
297
| ASI07 Insecure Inter-Agent Communication | FAIL | No identity verification between agents |
298
| ASI08 Cascading Failures | PASS | Deterministic PolicyEvaluator, circuit breakers between agents |
299
| ASI09 Human-Agent Trust Exploitation | PASS | Payments require a separate confirmation step |
300
| ASI10 Rogue Agents | PASS | AuditChain with SHA-256 chain hashes, trust decay, kill switch |
301
302
## Critical Gaps
303
- ASI03: Replace string agent names with per-agent cryptographic identity and scoped credentials
304
- ASI04: Generate INTEGRITY.json manifests for all plugins
305
- ASI06: Segment memory per tenant and validate writes before commit
306
- ASI07: Add agent identity verification using DIDs or signed tokens
307
308
## Recommendation
309
Install agent-governance-toolkit for reference implementations of these controls:
310
pip install agent-governance-toolkit
311
```
312
313
---
314
315
## Quick Assessment Questions
316
317
Use these to rapidly assess an agent system:
318
319
1. **Does untrusted input (prompts, documents, retrieved content) pass through validation before it can change the agent's goal or reach any tool?** (ASI01)
320
2. **Is there an explicit list of what tools the agent can call, each with least privilege?** (ASI02)
321
3. **Does each agent have its own scoped credential, with no way to promote its own privileges?** (ASI03)
322
4. **Are plugins, tools and prompts integrity-verified before use?** (ASI04)
323
5. **Is model output kept away from `eval()`, `exec()` and the shell, except inside an isolated sandbox (separate process, non-root, no network by default)?** (ASI05)
324
6. **Is agent memory validated on write and segmented per user or tenant?** (ASI06)
325
7. **Do agents authenticate each other and verify messages before acting on them?** (ASI07)
326
8. **Is policy enforcement deterministic, and is there a circuit breaker between agents?** (ASI08)
327
9. **Do sensitive actions need a human confirmation that does not rely on the model's own explanation?** (ASI09)
328
10. **Is every tool call logged with enough detail to replay it, and is there a kill switch?** (ASI10)
329
330
If you answer "no" to any of these, that's a gap to address.
331
332
---
333
334
## Related Resources
335
336
- [OWASP Top 10 for Agentic Applications 2026](https://genai.owasp.org/resource/owasp-top-10-for-agentic-applications-for-2026/)
337
- [Agent Governance Toolkit](https://github.com/microsoft/agent-governance-toolkit) — Reference implementation of the policy, identity and audit patterns used in this skill
338
- [agent-governance skill](https://github.com/github/awesome-copilot/tree/main/skills/agent-governance) — Governance patterns for agent systems
339