STUPID-2026-0187

GuardFall: shell-expansion bypasses defeated the command-safety guardrails of 10 of 11 open-source coding agents, including Plandex, Aider and Open Interpreter

6.0medium
June 30, 2026Repro reported

Why 6/10

The flaw sat in the command-safety guardrail itself across ten widely used open-source coding agents (collectively hundreds of thousands of GitHub stars) rather than one integration, matching the "widely used product" band scope=4 used for STUPID-2026-0184's single-product guardrail flaw. No real-world victim or lost data is reported, and the researchers' write-up gives no indication of in-the-wild exploitation, so recoverability sits at 0, as with other no-known-victim guardrail disclosures (0090, 0096, 0164, 0184). This was the researchers' own demonstrated test suite and end-to-end proof-of-concept against production builds, not a reported real-world attack — realisation=1. The demonstrated bypasses reach destructive, system-level shell commands (rm -rf, dd of=/dev/sda, sed -i) that would affect a victim's production work and files well beyond the agent's own state if used for real — impact=1.

Scope
4/4
Many organisations or the public: a flaw in a widely used product, mass exposure, a large outage
Recoverability
0/3
Nothing was lost
Did it happen
1/2
Demonstrated (proof of concept, reproduction, controlled test or near-miss) with no real victim reported
Beyond the user
1/1
Production systems, customers or third parties, or credentials and sensitive personal data

The score is the sum of these four factors. How each factor is scored · scored 2026-12-06

Guardrail rules for this command

Recursive deletes: make your agent stop and ask before running these. Free to copy; written in each tool’s documented format.

Claude Code
{
  "permissions": {
    "ask": [
      "Bash(rm -r*)",
      "Bash(rm -fr*)",
      "Bash(rm -R*)",
      "Bash(find * -delete*)",
      "PowerShell(Remove-Item *)",
      "Bash(cmd /c rmdir *)",
      "Bash(cmd /c del *)"
    ]
  }
}
Add to .claude/settings.json in the project (or ~/.claude/settings.json for every project). Each matching command then asks you first, including in auto mode.

Stronger control: Turn on the sandbox (/sandbox): shell commands can then write only to the project, a temp folder and directories you add. It runs on macOS, Linux and WSL2; on native Windows Claude Code runs commands unsandboxed. Docs

Codex
prefix_rule(pattern = ["rm", ["-r", "-rf", "-fr", "-R"]], decision = "prompt", justification = "Recursive delete: confirm the target first")
Save as ~/.codex/rules/stupidllm.rules and restart Codex. Codex's docs describe rules as controlling commands run outside its sandbox, and mark them experimental.

Stronger control: Keep Codex's OS sandbox on (it limits writes, typically to the workspace) and leave approvals on for sessions that can reach data you cannot lose. Docs

Gemini CLI
[[rule]]
toolName = "run_shell_command"
commandPrefix = ["rm -r", "rm -fr", "rm -R"]
decision = "ask_user"
priority = 100
denyMessage = "Destructive command: needs a human to confirm (stupidllm.com)"
Save as ~/.gemini/policies/stupidllm.toml. Workspace-level policy files are disabled in Gemini CLI, so this must be the user-level folder.

Stronger control: Policies in ~/.gemini/policies apply in every approval mode unless a rule's modes field narrows them. Docs

Copilot CLI
copilot --deny-tool='shell(rm)'
Pass on the command line. Copilot CLI matches the program name (and git/gh subcommands), so this blocks the whole command, not just its dangerous form.

Stronger control: Avoid --allow-all-tools on a machine with data you cannot lose; --deny-tool takes precedence over it. Docs

What these cannot do: a pattern rule matches the command text the agent writes. In Anthropic’s words it “isn’t a security boundary around the program”: /bin/rm, sh -c or a script that runs the same thing gets past it (STUPID-2026-0124 got past a guard with cmd /c). Use the sandbox as well, and keep backups of what you cannot lose.

  1. Instruction given

    None from a victim — Adversa AI security researcher Omer Ben Simon built a test suite of 21 bypass cases over 12 canonical destructive shell-command patterns and ran it against each agent's own command-approval guardrail, the layer meant to block or flag dangerous commands before execution.

  2. Expected behavior

    A guardrail that inspects a shell command for destructive intent before letting an agent run it should catch the command regardless of how it is written — not only when it appears as plain, unobfuscated text matching a keyword or regex list.

  3. Actual behavior

    Ten of eleven tested agents — OpenCode, Goose, Cline, Roo-Code, Aider, Plandex, Open Interpreter, OpenHands, SWE-agent and Hermes — proved vulnerable to at least one of five bypass classes: quote removal (bash rewrites `r''m` to `rm`), variable/IFS expansion (`rm$IFS-rf$IFS/`), command substitution (`$(echo rm) -rf /`), base64-encoded pipelines, and destructive-flag variants that avoid flagged keywords entirely (`find /x -delete`, `dd of=/dev/sda`, `sed -i`). Plandex, along with Aider and Open Interpreter, applied no static command guard at all and relied entirely on a human approval prompt or sandbox as its only line of defense. Only Continue's evaluator — which tokenizes and canonicalizes a command before inspecting it, instead of pattern-matching raw text — withstood the full 21-case suite. The researchers then demonstrated end-to-end exploitation against production builds of Plandex and eight of the other affected agents, confirming the bypasses are practically exploitable rather than theoretical, using attacker content planted in an ordinary repository artifact the agent reads rather than any model jailbreak.

  4. Damage

    A proof-of-concept, responsible-disclosure finding with no confirmed real-world victim: no CVE had been assigned and no affected project had shipped a structural fix as of the June 30, 2026 disclosure. The researchers frame the gap between a guardrail's text-inspection layer and bash's actual expansion behavior as a design convention that needs replacing project-wide, not a single patchable bug.

Full write-up

Adversa AI security researcher Omer Ben Simon disclosed GuardFall on June 30, 2026: a systematic test of the command-safety guardrails built into eleven open-source AI coding agents, checking whether each one's "is this command dangerous?" check could be defeated by rewriting a destructive command rather than hiding its intent. It could, in ten of the eleven. The guardrails in affected agents inspect the literal text of a proposed shell command — pattern-matching against keywords like rm -rf — but bash itself expands and rewrites text before running it, and none of the ten accounted for that gap. Splitting a quoted character (r''m), hiding a command in an environment-variable expansion (rm$IFS-rf$IFS/), wrapping it in command substitution, base64-encoding a pipeline, or simply reaching for a destructive command that isn't on the keyword list (find /x -delete, dd of=/dev/sda) all slipped straight through. Plandex, Aider and Open Interpreter had it worse than most: none of the three ran any static command guard at all, leaning entirely on a human clicking "approve" or on a sandbox to catch what the guardrail didn't. Only Continue held the line, because its evaluator tokenizes and canonicalizes a command before judging it instead of matching raw text — the fix Adversa recommends every other project adopt. To show the bypasses were real and not academic, the researchers ran end-to-end exploits against production builds of Plandex and eight of the other affected agents, triggered by ordinary repository content the agent reads rather than any jailbreak of the underlying model. No CVE exists and no project had shipped a structural fix at disclosure; Adversa calls it a convention that needs replacing across the category, not a bug any one vendor can patch alone.

Classification

Root cause
Pattern Matching Error
Domain
Security
OWASP Agentic Top 10 (our mapping)
ASI05 Unexpected Code Execution (RCE) list
MIT AI Risk Repository (our mapping)
2.2 AI system security vulnerabilities and attacks taxonomy

Related incidents

Cite this record
StupidLLM. "STUPID-2026-0187: GuardFall: shell-expansion bypasses defeated the command-safety guardrails of 10 of 11 open-source coding agents, including Plandex, Aider and Open Interpreter." AI Agent Incident Database, 2026. https://www.stupidllm.com/incident/STUPID-2026-0187/ (accessed 2026-12-06). CC BY 4.0.

← STUPID-2026-0186By ID

Get told when an agent breaks something

We document AI agent failures daily, severity-scored against a published scale. Each Monday, if any scored 7 or above that week — deleted data, leaked secrets, broken production — you get one email with the sources. When nothing did, you get nothing.

This database is callable over MCP — query it from inside your agent.