tool-abuse-detection

Detect tool misuse and command injection by testing tool parameters through dialogue interactions.

4.4k|438|Updated Dec 25, 2024
One-click install
npx skills add https://github.com/Tencent/AI-Infra-Guard --skill tool-abuse-detection
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tool-abuse-detection
Source: https://github.com/Tencent/AI-Infra-Guard/tree/main/agent-scan/prompt/skills/tool-abuse-detection
Command: npx skills add https://github.com/Tencent/AI-Infra-Guard --skill tool-abuse-detection

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill safeguards against malicious or unintended actions by an AI agent by detecting when it misuses its available tools, such as executing arbitrary code or accessing unauthorized files.

Core Features & Use Cases

  • Tool Misuse Detection: Identifies when an agent uses tools (like file access, code execution, or network calls) in an unsafe or unexpected manner.
  • Code Execution Prevention: Probes for command injection and shell escape vulnerabilities.
  • Path Traversal Detection: Tests for unauthorized file access.
  • SSRF Prevention: Checks for Server-Side Request Forgery vulnerabilities.
  • Use Case: When an AI assistant is granted access to execute code or read files, this skill can be used to ensure it doesn't inadvertently or maliciously compromise the system by running arbitrary commands or accessing sensitive files.

Quick Start

Use the dialogue tool to ask the agent to run 'echo test && whoami'.

Frequently Asked Questions about tool-abuse-detection

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I detect command injection vulnerabilities in AI agents with code execution tools?

To detect command injection in AI agents, you probe the agent's code execution interface by injecting shell commands like 'echo test && whoami' through dialogue and analyzing the response for evidence of unauthorized shell escape or arbitrary command execution.

What is the best way to test for SSRF vulnerabilities when an agent has network call tools?

The best way to test for SSRF vulnerabilities is to interact with the agent using carefully engineered prompts that request internal network calls, then analyze the agent's responses to see if it exposes unauthorized server-side request forgery behavior.

How can I prevent path traversal and unauthorized file access in AI assistants?

You can prevent path traversal by testing the agent's file access tools with crafted dialogue inputs that attempt unauthorized directory navigation, verifying whether the agent correctly blocks access to sensitive files outside its permitted scope.

Can I use dialogue interactions to test for unexpected code execution by an AI agent?

Yes, you can use dialogue interactions to test for unexpected code execution by prompting the agent to run specific commands and monitoring its tool parameters and responses for signs of misuse or arbitrary code execution.

Do I need prompt engineering to detect tool misuse in agents with file and network access?

Yes, detecting tool misuse requires careful prompt engineering to craft test inputs that probe file, code-execution, and network tools for vulnerabilities like command injection, path traversal, and SSRF during agent interactions.

What types of vulnerabilities should I look for when testing agent tool parameters?

When testing agent tool parameters, you should look for command injection, path traversal, and Server-Side Request Forgery (SSRF) vulnerabilities to ensure the agent does not compromise the system through unsafe tool usage.