$npx -y skills add github/awesome-copilot --skill agent-owasp-complianceCheck any AI agent codebase against the OWASP Agentic Security Initiative (ASI) Top 10 risks. Use this skill when: - Evaluating an agent system's security posture before production deployment - Running a compliance check against OWASP ASI 2026 standards - Mapping existing securit
| 1 | # Agent OWASP ASI Compliance Check |
| 2 | |
| 3 | Evaluate AI agent systems against the OWASP Agentic Security Initiative (ASI) Top 10 — the industry standard for agent security posture. |
| 4 | |
| 5 | ## Overview |
| 6 | |
| 7 | The OWASP ASI Top 10 defines the critical 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 addresses each risk. |
| 8 | |
| 9 | ``` |
| 10 | Codebase → Scan for each ASI control: |
| 11 | ASI-01: Prompt Injection Protection |
| 12 | ASI-02: Tool Use Governance |
| 13 | ASI-03: Agency Boundaries |
| 14 | ASI-04: Escalation Controls |
| 15 | ASI-05: Trust Boundary Enforcement |
| 16 | ASI-06: Logging & Audit |
| 17 | ASI-07: Identity Management |
| 18 | ASI-08: Policy Integrity |
| 19 | ASI-09: Supply Chain Verification |
| 20 | ASI-10: Behavioral Monitoring |
| 21 | → Generate Compliance Report (X/10 covered) |
| 22 | ``` |
| 23 | |
| 24 | ## The 10 Risks |
| 25 | |
| 26 | | Risk | Name | What to Look For | |
| 27 | |------|------|-----------------| |
| 28 | | ASI-01 | Prompt Injection | Input validation before tool calls, not just LLM output filtering | |
| 29 | | ASI-02 | Insecure Tool Use | Tool allowlists, argument validation, no raw shell execution | |
| 30 | | ASI-03 | Excessive Agency | Capability boundaries, scope limits, principle of least privilege | |
| 31 | | ASI-04 | Unauthorized Escalation | Privilege checks before sensitive operations, no self-promotion | |
| 32 | | ASI-05 | Trust Boundary Violation | Trust verification between agents, signed credentials, no blind trust | |
| 33 | | ASI-06 | Insufficient Logging | Structured audit trail for all tool calls, tamper-evident logs | |
| 34 | | ASI-07 | Insecure Identity | Cryptographic agent identity, not just string names | |
| 35 | | ASI-08 | Policy Bypass | Deterministic policy enforcement, no LLM-based permission checks | |
| 36 | | ASI-09 | Supply Chain Integrity | Signed plugins/tools, integrity verification, dependency auditing | |
| 37 | | ASI-10 | Behavioral Anomaly | Drift detection, circuit breakers, kill switch capability | |
| 38 | |
| 39 | --- |
| 40 | |
| 41 | ## Check ASI-01: Prompt Injection Protection |
| 42 | |
| 43 | Look for input validation that runs **before** tool execution, not after LLM generation. |
| 44 | |
| 45 | ```python |
| 46 | import re |
| 47 | from pathlib import Path |
| 48 | |
| 49 | def check_asi_01(project_path: str) -> dict: |
| 50 | """ASI-01: Is user input validated before reaching tool execution?""" |
| 51 | positive_patterns = [ |
| 52 | "input_validation", "validate_input", "sanitize", |
| 53 | "classify_intent", "prompt_injection", "threat_detect", |
| 54 | "PolicyEvaluator", "PolicyEngine", "check_content", |
| 55 | ] |
| 56 | negative_patterns = [ |
| 57 | r"eval\(", r"exec\(", r"subprocess\.run\(.*shell=True", |
| 58 | r"os\.system\(", |
| 59 | ] |
| 60 | |
| 61 | # Scan Python files for signals |
| 62 | root = Path(project_path) |
| 63 | positive_matches = [] |
| 64 | negative_matches = [] |
| 65 | |
| 66 | for py_file in root.rglob("*.py"): |
| 67 | content = py_file.read_text(errors="ignore") |
| 68 | for pattern in positive_patterns: |
| 69 | if pattern in content: |
| 70 | positive_matches.append(f"{py_file.name}: {pattern}") |
| 71 | for pattern in negative_patterns: |
| 72 | if re.search(pattern, content): |
| 73 | negative_matches.append(f"{py_file.name}: {pattern}") |
| 74 | |
| 75 | positive_found = len(positive_matches) > 0 |
| 76 | negative_found = len(negative_matches) > 0 |
| 77 | |
| 78 | return { |
| 79 | "risk": "ASI-01", |
| 80 | "name": "Prompt Injection", |
| 81 | "status": "pass" if positive_found and not negative_found else "fail", |
| 82 | "controls_found": positive_matches, |
| 83 | "vulnerabilities": negative_matches, |
| 84 | "recommendation": "Add input validation before tool execution, not just output filtering" |
| 85 | } |
| 86 | ``` |
| 87 | |
| 88 | **What passing looks like:** |
| 89 | ```python |
| 90 | # GOOD: Validate before tool execution |
| 91 | result = policy_engine.evaluate(user_input) |
| 92 | if result.action == "deny": |
| 93 | return "Request blocked by policy" |
| 94 | tool_result = await execute_tool(validated_input) |
| 95 | ``` |
| 96 | |
| 97 | **What failing looks like:** |
| 98 | ```python |
| 99 | # BAD: User input goes directly to tool |
| 100 | tool_result = await execute_tool(user_input) # No validation |
| 101 | ``` |
| 102 | |
| 103 | --- |
| 104 | |
| 105 | ## Check ASI-02: Insecure Tool Use |
| 106 | |
| 107 | Verify tools have allowlists, argument validation, and no unrestricted execution. |
| 108 | |
| 109 | **What to search for:** |
| 110 | - Tool registration with explicit allowlists (not open-ended) |
| 111 | - Argument validation before tool execution |
| 112 | - No `subprocess.run(shell=True)` with user-controlled input |
| 113 | - No `eval()` or `exec()` on agent-generated code without sandbox |
| 114 | |
| 115 | **Passing example:** |
| 116 | ```python |
| 117 | ALLOWED_TOOLS = {"search", "read_file", "create_ticket"} |
| 118 | |
| 119 | d |