Shell Expansion Lets 'rm -rf' Commands Evade AI Guardrails, Study Finds

A DEV Community article explains that simple text-matching safety filters can miss dangerous shell commands because the shell expands variables and quoting before execution. Its example, a variable set to root followed by a wildcard recursive delete, passes a regex-based check while expanding into a full system wipe. The author cites the GuardFall benchmark from June 30, 2026, which tested 11 autonomous coding agents and found most failed to block such bypasses. The piece argues that securing these agents requires parsing the shell's abstract syntax tree and resolving expansions statically before applying policy. It also describes context bloat from Model Context Protocol tool schemas, which inflates token costs and degrades model performance, and introduces an open-source tool called BlastRadius-Zero to address both problems.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.



Discussion (0)
Log in to join the discussion and vote.
Log in