Unexpected Code Execution Detection

100TrustedPre-approves tools

Identification of command injection, eval abuse, and remote code loading risks in agents.

What it does

Unexpected Code Execution Detection transforms an assistant into a diagnostic auditor for its own operations. By adding this capability, you instruct the agent to actively monitor whether its command-line or code-evaluation processes are susceptible to external interference.

This is a specialized auditing component designed for developers managing AI assistants that possess direct system access. It ensures that any request to trigger shell commands or interpret code undergoes validation to prevent unauthorized operations, marking potentially dangerous inputs before they can cause harm.

When it earns its place

Reach for it when…

Use this when your agent interacts with shell environments, interprets snippets of programming code, or pulls external modules from dynamic URLs. It is essential for verifying that input sanitization controls are functional.

Look elsewhere when…

This is not designed for agents that only perform standard text analysis or internal document retrieval without executing commands. It will not identify non-code-related security flaws, such as data exfiltration via prompt injection or bypasses of standard textual filters.

What to say to use it

You never invoke a skill directly — the assistant picks it up when your request matches what it covers. These are the kinds of things that do that.

  • check if my agent is vulnerable to command injection
  • see if the assistant executes unauthorized python code
  • detect potential remote code loading flaws
  • test if user input triggers system commands

Install it

Install for all your projects

Copy the skill directory into your personal skills folder. Claude picks it up on its own the next time your request matches what it does — there is nothing to enable.

bash
git clone --depth 1 --branch main https://github.com/Tencent/AI-Infra-Guard.git /tmp/AI-Infra-Guard
mkdir -p ~/.claude/skills
cp -r /tmp/AI-Infra-Guard/agent-scan/agent_scan/prompt/skills/unexpected-code-execution-detection ~/.claude/skills/unexpected-code-execution-detection

Install for one project only

Put it in the project's own skills folder instead, so it can be committed and shared with everyone working on that repository.

bash
cp -r /tmp/AI-Infra-Guard/agent-scan/agent_scan/prompt/skills/unexpected-code-execution-detection .claude/skills/unexpected-code-execution-detection

If a skill of the same name exists in both places, the personal one wins.

Installing on Claude.ai or through the API instead? The full guide covers every surface.

Pair it with an MCP server