
Unexpected Code Execution Detection
Tests an AI agent for command injection, eval/exec misuse and remote code loading flaws
- Repository
- Tencent/AI-Infra-Guard
- Stars
- 7,320
- Licence
- Apache-2.0
- Files
- 1 file
What it does
This is a security test script for AI agents, not a tool that runs code itself. It gives an agent a set of attack prompts (such as trying to chain shell commands or make it evaluate Python) and a rubric for judging whether the agent resisted, then writes up any findings in a structured report. It is designed to help a security reviewer find places where an agent would run dangerous commands or code that a user typed in.
Great for
- Security reviewers red-teaming an AI agent that can run shell commands or tools
- Developers checking that their agent refuses command injection before shipping
- Teams auditing agents that load scripts or modules dynamically
Skip it if
- Agents that never execute code or commands; the skill itself says to skip it, since there is nothing to test
- Production use against a live system without authorisation, because the probes are meant to be run as attacks and could cause harm if the agent actually complies
Try asking
- “Run the unexpected code execution detection checks against my shell-enabled coding agent and report any vulnerable responses”
- “Test whether my agent accepts shell chaining like 'ping 127.0.0.1; cat /etc/passwd'”
- “Probe my agent for eval-based code execution and write a vulnerability report”
Install in 3 steps
- 1
Download the skill
The ZIP contains the 1 original files, the Apache-2.0 licence and an attribution note.
unexpected-code-execution-detection.zip - 2
Add it to your agent
Claude Code (all projects)
mkdir -p ~/.claude/skills && unzip unexpected-code-execution-detection.zip -d ~/.claude/skills/Claude Code / Agent SDK (this project only)
mkdir -p .claude/skills && unzip unexpected-code-execution-detection.zip -d .claude/skills/Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.
- 3
Ask for the task
No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.
Get better results
- Point it at the agent under test in a sandboxed environment, never on systems you do not control or have permission to test
- Review each finding's evidence manually, since the judge criteria are judgement-based and may produce false positives
- Pair it with the other skills in the same scanner suite for broader coverage
What's inside
- SKILL.md
Redistributed unmodified from Tencent/AI-Infra-Guard under the Apache-2.0 licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.