One goal, many commands: characterizing the fragility of AI agent command denylistsOne Goal, Many Commands: Characterizing Denylist Fragility in AI Agents
The authors propose ShellSieve to detect bypasses of command denylists in terminal AI agents; across 1,709 GitHub denylists, 69.0–98.6% had incomplete blocking.
- Terminal AI agents control shell commands with a three-layer mechanism of denylist/allowlist/ask-list, with the denylist as the load-bearing layer; but the same operation can be accomplished by many commands, and the authors observed that even Claude Code's built-in denylist misses bypass commands.
- The authors formalize the denylist fragility problem and propose ShellSieve: the LLM proposes candidate operations and parameters based on command documentation, executes them in a sandbox and validates side effects with per-operation oracles, iterates failed candidates through a repair loop, and finally intersects with the operations blocked by the denylist to determine bypasses.
- On 1,709 GitHub denylists, 69.0–98.6% miss at least one bypass for the target operation; stratified by star this proportion is above 44.4%, and stratified by agent above 46.2%; statistical tests support the two root causes of obscure commands and multi-purpose commands; fully blocking op read requires an average of 217 additional commands.
- The authors note that LLM enumeration is incomplete and the reported severity is a lower bound; only seven file system operations are covered, excluding network operations. Experiments are conducted on a Debian 13.5 Docker reference host, driven by Claude Sonnet 4.6, with the repair loop capped at 5 rounds.
- Threat model
- The attacker's goal is to make the agent execute commands that produce attacker-chosen security-relevant side effects (such as stealing credentials or destroying data), without directly holding a host shell; the attacker is assumed to fully know the gating policy (including the denylist) and to be able to control the commands the agent proposes via indirect prompt injection. The trust boundary is at the command gating layer; everything upstream is untrusted.
- Benchmarks
- 1,709 个 GitHub 真实 denylist(13,332 条规则,覆盖 Claude Code、Codex、OpenCode)
- Metrics
- incompletely-blocked ratebypass 命令数量(修复负担)
An arXiv paper systematically characterizes the fragility of command denylists for terminal AI agents and proposes an LLM-driven ShellSieve pipeline to detect bypass commands. The authors call this the first systematic characterization of the problem, noting that terminal agents rely on shell command execution and adopt a three-list command gating mechanism, in which the denylist is a load-bearing component; but modern operating system command sets are vast, and even the built-in denylist maintained by developers in Claude Code misses bypass commands. ShellSieve has an LLM propose possible bypasses and iteratively improves these candidates using feedback from executors run in a sandbox. The authors evaluate on 1,709 real denylists collected from GitHub (containing 13,332 rules), find that 69.0–98.6% of denylists are fragile, and that the problem appears consistently across different projects and agents, and evaluate the effectiveness of several possible root causes.
Related events and news
0 events · 1 news mentions
News that mentions this paper
- Adversa AIcites the paper's id or linkAdversa AI 汇总 2026 年 7 月 AI 编码 Agent 安全资源
One goal, many commands: Characterizing denylist fragility in AI agents
Paper analysis
What problem does this paper attempt to solve?
Whether command denylists for terminal AI agents can actually block the target operation: the authors state that the same operation can be performed by multiple commands, and denylists often miss bypass commands.
Core question: Are the command denylists that terminal AI agents rely on fragile—that is, can the operations they intend to block be accomplished by commands not on the list (bypass).
- Scenario and importance: Terminal agents such as Claude Code, Codex and OpenCode can dynamically synthesize and execute shell commands, and commonly adopt three-layer gating of denylist/allowlist/ask-list. The authors call the denylist the load-bearing layer: the ask-list degrades into an allowlist due to approval fatigue (users approve 93% of requests, cited from reference [3]), and LLM judges have problems such as hallucination.
- The authors' observations: Claude Code auto-mode's built-in denylist enumerates code-execution commands such as interpreters, package managers and shells (Table 1), but misses AWK—its DSL is Turing-complete and can invoke Bash; the authors say experiments confirmed that AWK can bypass this denylist, and they have disclosed this to Anthropic. A custom denylist from a GitHub project (Listing 1) intends to block reading .env files, but lists only common commands such as cat and head, while commands such as cp and diff that can accomplish the same operation are not listed.
- Core hypothesis: The same goal (such as reading file contents) can be achieved by many commands; the modern operating system command set is vast and constantly expanding, beyond the knowledge of ordinary practitioners, so hastily compiled denylists inevitably have omissions.
- Paper contributions: Formalize the denylist fragility problem; propose the LLM-driven ShellSieve pipeline to automatically discover and verify bypasses; build a dataset of 1,709 real denylists (13,332 rules) and characterize the problem at scale.
- Threat model (§4):
- Goal: Make the agent execute commands that produce security-relevant side effects chosen by the attacker, such as stealing credentials or irreversibly destroying data.
- Knowledge: The attacker fully knows the gating policy (including the denylist); the authors call this a Kerckhoffs-style assumption, because these lists are often managed in the same repository as the source code.
- Capability: Does not directly hold the host shell; can control the commands proposed by the agent, on the grounds that agents routinely ingest untrusted content that can carry indirect prompt injection; the analysis does not depend on any single injection technique.
- Victim system and boundaries: The trust boundary is at the command gating layer; everything upstream (LLM-driven, harness, ingested content) is untrusted; how model alignment is broken and attacks that bypass shell tools such as reverse-shell are out of scope.
What related research exists?
Related work falls into four groups: agent security and sandboxing, LLM red teaming and jailbreaking, living-off-the-land attacks, and alternative techniques such as document mining.
Agent security and tool-use sandboxing
- Sandboxed execution environments (such as IsolateGPT et al. [42, 43]) and capability-restricted tool registries (Progent, MiniScope et al. [44, 45, 46]), human-in-the-loop approval workflows [47, 48, 49]: make agents with real tool permissions safer.
- Using LLM judges to replace or assist human approval ([50], and the design of Claude Code auto-mode [3]): the authors point out that such judges bypass approval fatigue but still reason on the same command-string surface and inherit hallucination and adversarial-suffix failure modes.
LLM red teaming and jailbreaking
- Prompt injection [51, 52], jailbreaks that induce prohibited content [53, 15], tool misuse caused by indirect prompt injection [54, 17]: the authors say red teaming research mainly targets the model's own outputs.
Living-off-the-land attacks
- GTFOBins [31] and LOLBAS [55]: catalog standard binaries that can be abused; prior work has used them to study real intrusions [56]. ShellSieve's candidate enumeration uses GTFOBins entries as one of the hint documents.
Alternative technical routes (explicitly compared by the authors in §6.1)
- Document/specification mining (DASE [22], Pandita et al. [23]), static analysis [24] and SMT solvers [25]: the authors say that without LLMs one would need to combine these techniques, and document mining has known high false-positive/false-negative rates [26, 27], while static analysis has scalability limitations [28], hence the choice of LLM plus execution verification.
Positioning: The authors call this paper the first systematic characterization ("the first systematic characterization") of the fragility of command denylists in terminal AI agents; unlike red teaming research targeting model outputs, the target is the denylist of the gating layer itself. This paper has no comparison baseline methods; the evaluation object is a dataset of real denylists rather than a method comparison.
How does the paper address this problem?
ShellSieve: the LLM proposes candidate operations and parameters, sandbox execution plus per-operation oracle verification, repair loop iterations, then intersection with the operations blocked by the denylist to determine bypass.
Overall approach: formalize "what operations the denylist intends to block" into seven classes of file system operations, then use the ShellSieve pipeline to compute, for each host command, the set of operations it actually performs, and intersect it with the set of operations blocked by the denylist; a non-empty intersection means a bypass.
Problem formalization (§5)
- deny-rule and denylist: a deny-rule is a decision predicate over a command plus arguments; a denylist is a set of rules, and a match on any rule blocks; matching only looks at the surface form of the command, not its side effects.
- Operations and blocked operations: an operation is defined as a function on some aspect of system state o: S → S; a command performs operation o if the state before and after execution satisfies s′ = o(s); operation o is blocked by denylist L if and only if some command blocked by L can perform o.
- Seven operation classes (Table 2): op read, op write, op create, op delete, op copy, op chmode, op chowgr, each with parameters (such as path, content). Excludes "code execution" (execution leaves no single observable side effect) and "move file" (decomposable into copy plus delete).
- Fully blocked and incompletely blocked: o is fully blocked means all commands that can perform o are blocked by L; incompletely blocked means L blocks o but there exists an unblocked command that can perform o, and such a command is a bypass. The authors explicitly exclude operations the denylist does not touch at all, considering those intentionally out of scope for the authors.
Candidate enumeration (§6.2)
- Use the command's documentation (help information, man pages, GTFOBins entries) to prompt the LLM to produce structured candidate operation and parameter lists; the full prompt is in Figure 3.
- Require the operation to be performed by the command alone, with no pipes or chaining; candidates such as syntax errors are discarded, overlapping operations are deduplicated (keeping the more general one); for commands from denylist entries, require that the proposed parameters are actually blocked by that denylist.
Execution validation (§6.3)
- After replacing placeholders with newly generated flag files and canary tokens, execute in a sandbox; each operation class has a dedicated oracle to check side effects, e.g., op read requires the canary to appear in stdout/stderr, op copy requires the target path to exist and its content to match the source (Figure 4).
- Two design choices: use execution rather than a second LLM judge (the authors state an LLM judge would share failure modes such as hallucination); the oracle is deliberately lenient, looking only at the essence of the operation and ignoring irrelevant items such as exit codes and warnings.
Repair loop (§6.4)
- Candidates that fail validation, together with stdout, stderr, return code and diagnostic information, are fed back to the LLM, which is asked to give a single corrected candidate for the same operation, then sent to validation again; each candidate gets at most M rounds, exiting when it passes or the model judges it unrepairable. The prompt is in Figure 5; the authors state it deliberately excludes GTFOBins entries because they are community-maintained and more likely to contain outdated or incorrect information.
Match determination (§6.5)
- For each command c compute Oh(c), for each denylist compute Oh(L), and intersect the two; if the intersection is non-empty then c is a bypass of L, and the most specific operation containing placeholders is kept in the intersection.
Implementation and run settings (§7.4)
- The reference host is a Debian 13.5 Docker image (default GNU userland); the full command set is obtained by traversing executable search directories; validation is performed in a Bubblewrap plus OverlayFS sandbox.
- Candidate enumeration and the repair loop are driven by Claude Sonnet 4.6 (default settings, via AWS Bedrock); the repair loop is capped at 5 rounds per candidate, with 16 threads in parallel; the full evaluation takes 3 hours and costs 25 USD in inference.
What experiments did the paper conduct?
On 1,709 GitHub denylists: 69.0–98.6% do not fully block the target operation; statistical tests support the two root causes H1 and H2, and reject H3; repair requires an average of tens to hundreds of additional commands.
Experimental setup
- Evaluation targets: 1,709 real denylists collected from GitHub, containing 13,332 rules, belonging to Claude Code (1,000, randomly sampled from 24,453 repositories with a cap), Codex (136), and OpenCode (573) (Table 4).
- Reference host: Debian 13.5 Docker image, default GNU userland; sandbox uses Bubblewrap plus OverlayFS.
- Driving model: Claude Sonnet 4.6 default settings, accessed via AWS Bedrock; repair loop at most 5 rounds per candidate; 16 threads in parallel.
- Metrics: RQ1 uses incompletely-blocked rate (the proportion of denylists that block an operation but do not fully block it); RQ2 stratifies by repository star count and by agent; RQ3 uses logistic regression, the Mann-Whitney U test, and bypass proportions to test three root-cause hypotheses; RQ4 measures repair burden by the number of additional bypass commands needed for full blocking.
- Cost: full evaluation 3 hours, 25 USD in inference cost. The paper does not report the number of repetitions.
Main results
RQ1 (Figure 7): among the seven operations, incompletely-blocked denylists account for the largest share, with a proportion of 69.0–98.6% (the paper gives a range by operation and does not list per-operation values in the text).
RQ2 (Figure 8):
Stratification Incompletely-blocked rate Source By star, three tiers (0–99 / 100–999 / ≥1000) Every operation above 44.4% Figure 8a By agent (Claude Code / Codex / OpenCode) Every operation above 46.2% Figure 8b - The authors state that for four of the seven operations, projects with the most stars (≥1000) have the lowest incompletely-blocked rate, but the lowest value is still above 44.4%.
- The authors derive Finding 2 from this: the problem is consistently severe across different projects and agents.
RQ3 root-cause tests
- H1 (ignorance, the authors do not know obscure commands exist): using Debian Popularity Contest rankings as a popularity proxy, equal-frequency binning into six bins plus logistic regression. Figure 9 shows that except for op delete, the fitted bypass probability rises with rank (more obscure), with the op read, op write, and op create curves steepest; the cross-operation regression slope is positive, with a minimum p of 1.02×10⁻⁶. The authors state this supports H1.
- H2 (versatility, multi-purpose commands are intentionally not listed): multi-operation commands (35) bypass a median of 664 denylists (IQR [280, 1013]), while single-operation commands (109) have a median of 281 (IQR [281, 497]); Mann-Whitney U=2482, p=0.006, Cliff's δ=0.30 (Table 5). The authors state this supports H2.
- H3 (semantic gap, capability hidden behind surface use): group by whether TLDR documentation states the operation. The results are opposite to H3's prediction: among commands whose TLDR documentation states the operation, the bypass proportion is 40.1%, while among those that do not, it is only 5.7% (overall); e.g., op read is 45.0% vs. 15.3% (Table 6). The authors state H3 is rejected, and most missed bypasses are in commands whose documentation states the capability.
RQ4 repair burden
- Fully blocking op read requires an average of 217 additional commands (at most 222); closing all operations blocked by a denylist at once requires an average of 180 (at most 603); op write and op create require an average of 97 and 98 each (Table 7).
- The authors state this burden is heavy for those who want to repair denylists (Finding 4).
Other ablations and analyses
- Dataset representativeness: repositories use 152 programming languages and cover 1,643 topics; star counts show a long-tail distribution (Table 4).
- Operation coverage: Figure 6 gives how many denylists cover each of the seven operations (grouped by agent); op delete is covered the most, which the authors attribute to the destructiveness of deletion making users more cautious.
- Negative result: H3 is rejected; bypasses are concentrated in commands whose documentation already states the operation.
Items not reported in the paper
- The paper does not report per-operation incompletely-blocked rate values (only ranges and figures); does not report human evaluation or human agreement; does not report the recall of LLM enumeration.
What are some points that can be further explored?
The authors note two limitations: LLM enumeration is incomplete (results are lower bounds) and only file system operations are covered; experiments are conducted on a single Debian reference host.
Limitations and future directions noted by the authors
- LLM enumeration is incomplete (§9): the LLM generator can only recall a subset of the bypasses that actually exist on the host; the reported incompletely-blocked rates and repair burden are lower bounds, and the true severity can only be higher; the authors state this affects only the magnitude of the effect, not its direction, and that all reported bypasses were verified by execution as true positives.
- Limited operation scope (§9): only seven file system operations are studied, excluding network operations (such as data exfiltration and reverse connections), because network effects require modeling external endpoints and heavier instrumentation; the authors leave this to future work.
- Better command gating (§9): the authors state the three-layer gating mechanism itself is quite fragile but popular due to its flexibility, and future work could study how to combine it with techniques such as capability-based sandbox and LLM auditor.
- Code and data (§1): the authors plan to release code and data after the paper is published.
Experimental coverage
- The evaluation targets 1,709 GitHub denylists (13,332 rules), covering the three agents Claude Code, Codex, and OpenCode; the Claude Code portion is randomly sampled from 24,453 repositories, capped at 1,000 (§7.3).
- The operation scope is the seven file system operations of Table 2; network operations are not included (§5.2, §9).
- The reference host is a Debian 13.5 Docker image (default GNU userland); the full command set comes from executable search directories (§7.4).
- The pipeline is driven by Claude Sonnet 4.6, with the repair loop capped at 5 rounds per candidate and 16 threads in parallel; the paper does not report the number of repetitions (§7.4).
- The root-cause tests use statistical means such as Debian Popularity Contest rankings, TLDR documentation, and the Mann-Whitney U test; the paper does not report human evaluation or reviewer-model agreement (§7.5.3).
Summarize the main content of the paper
Formalizes and characterizes at scale the fragility of terminal agent denylists: most denylists miss bypasses, the root causes are obscure commands and multi-purpose commands, and the repair burden is heavy.
A characterization study on command control for terminal AI agents: the authors formalize the denylist fragility problem, propose the LLM-driven pipeline ShellSieve, and conduct a large-scale evaluation on 1,709 real GitHub denylists.
- Problem: terminal agents use three-layer gating of denylist/allowlist/ask-list to control shell commands, with the denylist as the load-bearing layer; but the same operation can be performed by many commands, and the authors observe that even Claude Code's built-in denylist misses commands like AWK that can execute arbitrary code.
- Method: formalize what the denylist intends to block into seven file system operations; ShellSieve has the LLM propose candidate operations and parameters based on command documentation, executes them in a sandbox and validates side effects with per-operation oracles, iterates failed candidates through a repair loop (capped at 5 rounds), and finally intersects with the operations blocked by the denylist to determine bypasses.
- Severity: 69.0–98.6% of denylists miss at least one validated bypass for their target operation (Figure 7); stratified by star, every operation is above 44.4%, and stratified by agent, every operation is above 46.2% (Figure 8).
- Root causes: statistical tests support two hypotheses—the more obscure the command, the more likely it is to be a bypass (minimum p in logistic regression is 1.02×10⁻⁶); multi-purpose commands bypass a median of 664 denylists, higher than 281 for single-operation commands (p=0.006). The semantic gap hypothesis is rejected: bypasses are concentrated in commands whose TLDR documentation already states the operation (40.1% vs. 5.7%).
- Repair burden: fully blocking op read requires an average of 217 additional commands, and closing all blocked operations at once requires an average of 180 (Table 7).
- Authors' conclusion: static command-string denylists are insufficient as the load-bearing layer of agent command gating, and the approach should shift toward combining list-based gating with other techniques (such as capability-based sandbox and LLM auditor); the authors also note that the reported numbers are lower bounds and cover only file system operations.