跳到正文
Skillpedia
智能体40k · #7043

agent-owasp-compliance

它能做什么

这个工具会检查 AI 智能体的代码是否遵循 OWASP 定义的安全最佳实践。它会排查 AI 智能体中 10 类常见风险,这些智能体可以代表你执行操作。

适用场景

  • ✓在把 AI 系统投入生产环境之前。
  • ✓为了确保 AI 系统符合安全标准。
  • ✓在审查 AI 系统的安全性时。

技能链接

https://github.com/github/awesome-copilot/blob/main/skills/agent-owasp-compliance/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/github/awesome-copilot/blob/main/skills/agent-owasp-compliance/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“对照 OWASP Top 10 安全风险,检查我的 AI 智能体代码。”

每周 5 个新技能,1 分钟读完。

工作原理

工具会分析你的代码,查找每一类风险对应的安全控制措施是否存在的迹象。然后生成一份报告,说明哪些风险已被覆盖。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Agent OWASP ASI Compliance Check

Evaluate AI agent systems against the OWASP Agentic Security Initiative (ASI) Top 10 — the industry standard for agent security posture.

Overview

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.

Codebase → Scan for each ASI control:
  ASI-01: Prompt Injection Protection
  ASI-02: Tool Use Governance
  ASI-03: Agency Boundaries
  ASI-04: Escalation Controls
  ASI-05: Trust Boundary Enforcement
  ASI-06: Logging & Audit
  ASI-07: Identity Management
  ASI-08: Policy Integrity
  ASI-09: Supply Chain Verification
  ASI-10: Behavioral Monitoring
→ Generate Compliance Report (X/10 covered)

The 10 Risks

Risk Name What to Look For
ASI-01 Prompt Injection Input validation before tool calls, not just LLM output filtering
ASI-02 Insecure Tool Use Tool allowlists, argument validation, no raw shell execution
ASI-03 Excessive Agency Capability boundaries, scope limits, principle of least privilege
ASI-04 Unauthorized Escalation Privilege checks before sensitive operations, no self-promotion
ASI-05 Trust Boundary Violation Trust verification between agents, signed credentials, no blind trust
ASI-06 Insufficient Logging Structured audit trail for all tool calls, tamper-evident logs
ASI-07 Insecure Identity Cryptographic agent identity, not just string names
ASI-08 Policy Bypass Deterministic policy enforcement, no LLM-based permission checks
ASI-09 Supply Chain Integrity Signed plugins/tools, integrity verification, dependency auditing
ASI-10 Behavioral Anomaly Drift detection, circuit breakers, kill switch capability

Check ASI-01: Prompt Injection Protection

Look for input validation that runs before tool execution, not after LLM generation.

import re
from pathlib import Path

def check_asi_01(project_path: str) -> dict:
    """ASI-01: Is user input validated before reaching tool execution?"""
    positive_patterns = [
        "input_validation", "validate_input", "sanitize",
        "classify_intent", "prompt_injection", "threat_detect",
        "PolicyEvaluator", "PolicyEngine", "check_content",
    ]
    negative_patterns = [
        r"eval\(", r"exec\(", r"subprocess\.run\(.*shell=True",
        r"os\.system\(",
    ]

    # Scan Python files for signals
    root = Path(project_path)
    positive_matches = []
    negative_matches = []

    for py_file in root.rglob("*.py"):
        content = py_file.read_text(errors="ignore")
        for pattern in positive_patterns:
            if pattern in content:
                positive_matches.append(f"{py_file.name}: {pattern}")
        for pattern in negative_patterns:
            if re.search(pattern, content):
                negative_matches.append(f"{py_file.name}: {pattern}")

    positive_found = len(positive_matches) > 0
    negative_found = len(negative_matches) > 0

    return {
        "risk": "ASI-01",
        "name": "Prompt Injection",
        "status": "pass" if positive_found and not negative_found else "fail",
        "controls_found": positive_matches,
        "vulnerabilities": negative_matches,
        "recommendation": "Add input validation before tool execution, not just output filtering"
    }

What passing looks like:

# GOOD: Validate before tool execution
result = policy_engine.evaluate(user_input)
if result.action == "deny":
    return "Request blocked by policy"
tool_result = await execute_tool(validated_input)

What failing looks like:

# BAD: User input goes directly to tool
tool_result = await execute_tool(user_input)  # No validation

Check ASI-02: Insecure Tool Use

Verify tools have allowlists, argument validation, and no unrestricted execution.

What to search for:

  • Tool registration with explicit allowlists (not open-ended)
  • Argument validation before tool execution
  • No subprocess.run(shell=True) with user-controlled input
  • No eval() or exec() on agent-generated code without sandbox

Passing example:

ALLOWED_TOOLS = {"search", "read_file", "create_ticket"}

def execute_tool(name: str, args: dict):
    if name not in ALLOWED_TOOLS:

…
常见问题

什么是 OWASP ASI Top 10 风险?

这是专门针对自主 AI 智能体确定的 10 类最关键安全风险。这类智能体可以与系统交互并执行操作。

什么是“AI 智能体”?

它是一种 AI 程序,不仅能理解指令,还能使用工具、访问系统,并代表用户完成任务。

什么是 'Prompt Injection'?

这是一种攻击方式:恶意用户在提示词中埋入特殊指令,试图诱骗 AI 智能体执行不需要的命令或泄露敏感信息。

详情

作者的原始描述

Check 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 security controls to the 10 agentic risks - Generating a compliance report for security review or audit - Comparing agent frame

repo: github/awesome-copilot

热度

GitHub 星标
40k
排名
#7043
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能