Skip to content
AI Defense Lab

Command Injection Lab

Learn how attackers sneak OS commands and tool hijacks into LLM inputs. This lab shows the payload shape and the detection pass; it simulates tool execution rather than performing it.

LEARN— What is Command Injection?

Command injection happens when an attacker hides shell commands (like cat /etc/passwd) inside normal-looking text. If an AI agent blindly executes tool calls from user input, those hidden commands can steal data or damage systems.

PRACTICE— Try a Command Injection

Choose an Attack Scenario

What to Expect
Expected: BLOCK — the Exfil Detector fires at 0.88 on a composition, not on a metacharacter: '/etc/passwd' is a sensitive object and 'http://evil.com' is an egress channel, and they appear close together. Note what is NOT the reason: the ';' and '|' are ignored. Shell punctuation alone used to score 0.90 here, which flagged every markdown code span in ordinary prose.

Attack Input

Edit the payload — try different shell tricks!