Chuyển đến nội dung
Skillpedia
Agent35k · #8363

securing-agentic-ai-tool-invocation

Skill này làm gì

Hệ thống này bảo vệ agent AI khỏi các hành động nguy hiểm. Nó đảm bảo agent chỉ dùng các công cụ được phép, với quyền đúng, và có thể hỏi ý kiến bạn trước khi thực hiện các việc quan trọng.

Khi nào nên dùng

  • ✓Khi agent AI có thể gửi email hoặc thực hiện thanh toán.
  • ✓Khi bạn xây dựng một agent AI có thể sửa file hoặc chạy mã.
  • ✓Khi bạn cần đảm bảo agent AI không lạm dụng hoặc dùng quá mức các công cụ.

Liên kết skill

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/securing-agentic-ai-tool-invocation/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/securing-agentic-ai-tool-invocation/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Bảo mật các lần gọi công cụ của AI để chúng không gây ra sự cố.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Hệ thống hoạt động bằng cách xác định công cụ nào agent được dùng và dùng như thế nào. Nó cũng có thể yêu cầu bạn phê duyệt các hành động rủi ro cao và ghi lại mọi hành động để kiểm toán.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Securing Agentic AI Tool Invocation

Authorized-use-only notice: This is a defensive skill. The controls below govern how an AI agent invokes tools/plugins. Deploy them on systems you own or operate. Test guardrail bypasses only against your own agent in a non-production environment.

Overview

Autonomous (agentic) AI systems decide which tool to call, with what arguments, and when, based on model reasoning over untrusted inputs. That makes the tool-invocation boundary the highest-risk control point in an agent: a single successful prompt injection or a poisoned tool can turn the agent into a confused deputy that deletes data, sends money, or pivots into connected systems. The relevant threat is MITRE ATLAS AML.T0053 (LLM Plugin Compromise) and the OWASP Agentic AI Top 10 classes for Tool Misuse, Excessive Agency, and Privilege Compromise.

The defense is layered, defense-in-depth governance of tool calls: (1) a strict allowlist of which tools the agent may call and with which argument shapes; (2) least-privilege identity binding so each tool call runs with scoped, short-lived credentials tied to the acting user/session — not a single god-mode service account; (3) policy enforcement at the call boundary (NVIDIA NeMo Guardrails dialog/flow rails and tool guardrails, or a deterministic policy wrapper); (4) human-in-the-loop (HITL) approval for high-impact actions; and (5) audit logging of every invocation for detection. This skill implements all five with verified, runnable patterns using NeMo Guardrails and a framework-agnostic Python policy wrapper.

When to Use

  • When building or hardening an agent that can call tools with real-world side effects (email, payments, file writes, infra changes, code execution).
  • When mapping OWASP Agentic AI Top 10 controls onto an existing agent framework.
  • When you need to bound the blast radius of prompt injection / tool poisoning.
  • When a compliance or governance requirement mandates approvals and audit trails for autonomous actions.
  • During an architecture review of an agent's tool layer.

Prerequisites

  • Python 3.10+ and a virtual environment.
  • An agent/LLM framework you control.
  • Install the tooling:
python -m venv .venv && source .venv/bin/activate

# NVIDIA NeMo Guardrails — programmable rails incl. tool/flow controls
pip install nemoguardrails

# JSON schema validation for tool argument allowlisting
pip install jsonschema

# (Optional) cloud SDK for scoped credential issuance, e.g. AWS STS
pip install boto3

Objectives

  • Define an explicit tool allowlist with per-tool argument schemas (deny-by-default).
  • Bind each tool call to a scoped, short-lived identity instead of a shared service account.
  • Enforce a policy decision (allow / require-approval / deny) before every invocation.
  • Insert human-in-the-loop approval gates for high-impact tools.
  • Wrap an agent's tools with NeMo Guardrails and/or a deterministic policy wrapper.
  • Produce a tamper-evident audit log of all tool calls mapped to ATLAS AML.T0053.

MITRE ATT&CK Mapping

ID Official Name Relevance
AML.T0053 LLM Plugin Compromise The agent's tools/plugins are the asset these controls protect
AML.T0051 LLM Prompt Injection Injection is the primary vector that abuses tool invocation
AML.T0051.001 LLM Prompt Injection: Indirect Indirect injection via tool results drives unauthorized tool calls
AML.T0057 LLM Data Leakage Excessive tool agency leads to data exfiltration these controls prevent

Workflow

1. Inventory tools and classify impact

List every tool the agent can call, its arguments, and an impact tier (read-only / write / high-impact). High-impact tools require HITL.

# tool_registry.py
TOOL_POLICY = {
    "search_docs":  {"impact": "read",        "approval": False},
    "create_ticket":{"impact": "write",       "approval": False},
    "send_email":   {"impact": "high",        "approval": True},
    "transfer_funds":{"impact": "high",       "approval": True},
    "run_shell":    {"impact": "high",        "approval": True},
}

2. Define per-tool argument allowlists (deny-by-default)

Validate every call against a JSON schema; reject anything not explicitly allowed.

# schemas.py
from jsonschema import validate, ValidationError

TOOL_SCHEMAS = {
    "send_email": {
        "type": "object",
        "properties": {

…
Câu hỏi thường gặp

“Defense-in-depth” là gì?

Đây là cách bảo vệ nhiều lớp. Nếu một lớp thất bại, các lớp khác vẫn bảo vệ hệ thống.

“Tool allowlist” là gì?

Đây là danh sách chỉ rõ những công cụ mà agent AI được phép dùng. Bất cứ thứ gì không có trong danh sách đều bị chặn.

“Human-in-the-loop approval” là gì?

Với những hành động rất quan trọng hoặc rủi ro, agent AI sẽ hỏi ý kiến bạn trước khi tiếp tục.

Chi tiết

Mô tả gốc của tác giả

Implements defense-in-depth controls at an AI agent's tool-invocation boundary using tool allowlisting, least-privilege identity binding, NeMo Guardrails policy enforcement, human-in-the-loop approval, and audit logging. Use when hardening an agent that calls tools with real side effects (email, payments, file writes, code execution), mapping OWASP Agentic AI Top 10 controls, or bounding prompt-in

repo: mukul975/Anthropic-Cybersecurity-Skills

Độ phổ biến

Sao GitHub
35k
Vị trí xếp hạng
#8363
Giấy phép
Apache-2.0
Cập nhật
31/8/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự