Skip to content

CARE: Pre-execution command validation for LLM agents that execute shell commandsCARE: Pre-Execution Command Verification for Shell-Executing LLM Agents

arXiv· arXiv:2607.21642· Yu Liu, Wenxiao Zhang, Zhiwei Yang, Zhongyi Zhang, Hanqi Feng, Xinyu Wang, Peng Qiu, Yanbing Liu, Barnabas Poczos, Jin B. Hong·Indexed by this site · 2026-10-12· Originally publishedDefenses

Quick read

Defenses

Based on the paper PDF (AI-generated); refer to the original

CARE verifies agent shell commands before dispatch: main split F1 is 85.64%, FPR is 0.91%, and mean latency is 2.32ms.

Threat modelAttackers can use prompt injection, adversarial tasks, or social engineering to induce LLM agents to produce dangerous shell commands at the dispatch boundary, causing file corruption, credential leakage, exfiltration, or privilege escalation. The guard only sees the command string c and bounded path context, not reasoning, user prompts, or history. It does not replace sandboxing or TOCTOU-safe enforcement.

Questions
LLM agents dispatch shell commands to the host, making the dispatch boundary a high-risk control point. General guardrails do not model shell structure in detail, often LLM review has high latency and is unstable, and parsers do not prevent execution.
Methods
CARE first canonicalizes the original command into a stable verification target that is not executed, then derives deterministic evidence from syntax, semantics, paths, and provenance-bearing risk patterns, handing only pending WARNs to the LLM reviewer.
Experiments and results
On the 549-entry main split, full CARE has an F1 of 85.64%, FPR of 0.91%, and mean latency of 2.32ms; the static configuration has an F1 of 84.99% and latency of 0.34ms, with RedCode-gen's realised harm at 37.33%.
Limitations and future work
The authors state that command-level defenses do not cover staged attack chains and cross-turn environment changes. The generator and reviewer share Qwen3-Coder-30B; cross-family sensitivity is future work. Experiments include 549 main splits, 300 NL2SH-ALFA tasks, and 600 RedCode-gen items.
Experimental setupMain evaluation split、ART et al. · F1、DR et al.
Benchmarks
Main evaluation splitARTRedCode-ExecCanonical AttacksNL2BashReal-world CmdsNL2SH-ALFAGTFOBinsObfuscationExploit-DBRedCode-gen
Metrics
F1DRFPRmean latencyResolve raterealised harm rate
AI summaryThe researchers propose CARE (Canonicalization, Attribution, and Resolution Engine), a pre-execution static validator for individual shell commands generated by LLM agents. CARE first canonicalizes commands into stable validation targets, then generates deterministic evidence based on syntax, command semantics, path context, and source-backed risk patterns, escalating only ambiguous commands to an LLM judge, keeping common cases fast, reproducible, and auditable. On the balanced main split, CARE achieves 85.64% F1, 0.91% false positive rate, and 2.32 ms average latency. Switching to the static-only configuration, it maintains 84.99% F1, 0.34 ms latency, and reduces realized harm on RedCode-gen to 37.33%. The authors state these configurations exhibit practical trade-offs among benign recovery, false positive burden, latency, and harm reduction in extrapolation tests and controlled Docker sandbox execution.

The researchers propose CARE (Canonicalization, Attribution, and Resolution Engine), a pre-execution static validator for individual shell commands generated by LLM agents. CARE first canonicalizes commands into stable validation targets, then generates deterministic evidence based on syntax, command semantics, path context, and source-backed risk patterns, escalating only ambiguous commands to an LLM judge, keeping common cases fast, reproducible, and auditable. On the balanced main split, CARE achieves 85.64% F1, 0.91% false positive rate, and 2.32 ms average latency. Switching to the static-only configuration, it maintains 84.99% F1, 0.34 ms latency, and reduces realized harm on RedCode-gen to 37.33%. The authors state these configurations exhibit practical trade-offs among benign recovery, false positive burden, latency, and harm reduction in extrapolation tests and controlled Docker sandbox execution.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    Under limited observability, intercept dangerous shell commands produced by agents before dispatch.

    A single shell command dispatched by an LLM agent must be judged as ALLOW, WARN, or DENY before execution based only on the command string and bounded path context.

    • Scenario: The authors state that coding and terminal automation make command dispatch a critical runtime boundary. Unsafe commands may corrupt files, exfiltrate secrets, or establish persistence. The paper writes that in CVE-2025-66032, Claude Code's read-only validation could be bypassed by $IFS rewriting and short flag abbreviations, and that exploitation requires untrusted content in context.
    • Existing shortcomings: The authors state that ToolSafe, ClawGuard, and rule baselines derived from AgentSpec do not adequately characterize shell structure, paths, and command idioms; always-on LLM reviewers have latency, cost, and variance; bashlex and ShellCheck do not decide whether execution can proceed. Deployment must also simultaneously balance detection, false positive rate, latency, and auditability.
    • Observation: The authors believe that many unsafe actions are already exposed before execution in command structure, command headers, path targets, and high-confidence shell idioms.
    • Proposed content: The static-first verifier CARE (Canonicalization, Attribution, and Resolution Engine), which separates deterministic evidence construction from LLM adjudication applied only to pending commands.
    • Threat model:
      • Attack goal: Induce dangerous commands at the dispatch boundary, with consequences including file corruption, credential leakage, data exfiltration, or privilege escalation.
      • Influence channel: Prompt injection, adversarial task descriptions, or social engineering on the user prompt. The paper does not use knowledge gradations such as white-box or black-box.
      • Guard input: The command string c, along with the workspace root, home directory expansion, and read-only filesystem metadata used for resolving symbolic links. It does not see reasoning, user prompts, or conversation history.
      • Environment assumptions: Filesystem permissions, authentication, and kernel isolation are separately guaranteed by the deployment environment. CARE does not replace sandboxing, host hardening, or TOCTOU-safe enforcement. The scope is single-command screening for bash/sh on Linux.
  2. What related research exists?

    Related work covers tool guardrails, content classifiers, and shell parsing; CARE converges on the dispatch boundary.

    Agents and Text Refusal

    • AgentDojo (Debenedetti et al., NeurIPS 2024) and Agent-SafetyBench (Zhang et al., 2024) — the former involves unsafe behaviors across 97 tasks and 629 safety tests; in the latter, no system achieves an overall safety score above 60% (349 environments).
    • Mind the GAP (Cartagena and Teixeira, 2026) and Liu et al. (ACL 2026) — the paper states that text-level refusal does not reliably transfer to tool calls; in the former, agents can generate refusal text while still dispatching forbidden tool calls.
    • Claude Code, Codex, and RedCode (Guo et al., NeurIPS 2024) — the paper uses these to illustrate coding, terminal automation, and risky code execution; CVE-2025-66032 is cited as an example of read-only command validation being bypassed.

    Runtime Guardrails and Content Classification

    • ToolSafe, ClawGuard, AgentSpec, NeMo Guardrails, MAGE, and SafeHarness — the paper summarizes these as handling tool calls, policies, long-horizon agent state, or lifecycle safety. The authors state that CARE differs by converging the enforcement point to shell dispatch and first using shell-specific static evidence.
    • Llama Guard and gpt-oss-safeguard — these perform content safety classification on generated text. The paper uses the corresponding models as transfer baselines in experiments and states they are not native shell command guards.

    Shell Analysis and Prompt Injection

    • bashlex and ShellCheck — aimed at parsing and script correctness. The authors state they do not decide whether execution is allowed; the Discussion states that if used directly as interceptors, they would still need policy, provenance, and an abstention mechanism for benign dual-use commands.
    • ShellCore (Alasmary et al., 2022) — offline script classification, not gating individual commands before execution.
    • Greshake et al. (2023), StruQ (Chen et al., USENIX Security 2025), and NL2Bash (Lin et al., LREC 2018) — respectively identify indirect prompt injection, harden prompts, and treat shell generation as learning. The Discussion states that StruQ reduces instruction-following risk, but indirect injection exposure remains once untrusted content reaches the tool boundary (citing Zhan et al., ACL 2024).

    Baseline methods are NoGuard, Regex, ClawGuardSim, OpenClaw4Layer, PromptOnly, LLMJudge, NeMo Guardrails, Granite Guardian 2B, Llama Guard 3-8B, GPT-OSS-Safeguard-20B, and two configurations of CARE. LLMSecGuard is discussed and excluded: it analyzes and repairs source code, not mediating shell dispatch. Benchmarks/datasets include ART, RedCode-Exec, NL2Bash, NL2SH-ALFA, GTFOBins, Exploit-DB, and the authors' curated Canonical Attacks, Real-world Cmds, Obfuscation, and RedCode-gen.

    The authors position the paper on command-level mediation at the dispatch boundary: each command is checked at the boundary, ambiguous cases can abstain into Resolution, and adjudications retain an auditable trail.

  3. How does the paper address this problem?

    CARE first statically constructs shell evidence, escalating only pending WARNs to the LLM reviewer.

    CARE performs a three-stage, static-first pre-execution check on a single command: first obtain a stable target without execution, then use multi-view evidence to give a provisional ALLOW/WARN/DENY, and only hand unresolved WARN to the LLM.

    Problem Setting

    • The input is a candidate command c produced by the agent planner before execution. The adjudication must occur before any shell side effects, and it looks at only one command at a time. The mediation step itself is stateless.
    • The scope is bash/sh on Linux; outer wrappers such as zsh, dash, and busybox are normalized at L0. The agent issuing the command can be single-turn or multi-turn with retries after DENY; both enter the evaluation.
    • The authors give simultaneous goals of safety, latency, and auditability: high precision and recall, fast enough for each dispatch, and an explanation trace for each adjudication.

    Normalization

    • The bounded operator N performs idempotent, deterministic rewrites in a fixed order: unwrap wrappers, normalize quotes and escapes, bounded decoding, and light deobfuscation, producing ĉ in a single pass. It does not start subprocesses.
    • The original tokens and the normalized form are both preserved, so downstream can match either. The authors call this bounded normalization, not full semantic recovery. Appendix A.1 lists representative rewrites and runtime limits.
    • If bashlex parsing fails and the original or L0-normalized command still contains high-risk tokens, it fails closed and returns DENY.

    Multi-View Attribution

    • L1 uses bashlex to build an AST from ĉ, extracting command heads, arguments, control flow, redirections, substitutions, and parsing diagnostics. The structural penalty takes the highest severity among matched indicators. In Appendix A.1, a pipe to the interpreter has severity 1.00, while an ordinary pipe has 0.05.
    • L2 maps command heads to semantic classes using a curated vocabulary. Classes have base scores; non-negative additions from flags, targets, and chaining truncate the score to 1. Dual-purpose commands have an additional subclassifier and contextual additions. Base scores in Appendix A.2 range from 0.00 for READ ONLY to 1.00 for DESTRUCTIVE; the vocabulary has about 250 command heads.
    • L3 extracts paths from AST tokens and redirections, expands home directories, resolves symlinks in a bounded way, and expands workspace-relative references. On the same sensitive path, read contexts score lower than write contexts; secret paths are elevated regardless of read or write, to avoid blocking routine diagnostic reads while still flagging persistent writes on system paths.
    • L4 matches high-confidence patterns with explicit operational meaning and sources, rather than broad keyword blocking. Each rule has an identifier, failure family, confidence, and a public source or manual rationale. The signal takes the maximum of the product of source weight and confidence.
    • L5 adds the four evidence streams into a provisional score. This score is an auditable heuristic, not a learned probability:

    score(c)=wsemssem(c)+wpathspath(c)+wpatspat(c)+wstructδstruct(c) The weights are non-negative and sum to 1. Below τlow is ALLOW, between τlow and τhigh is WARN, and at or above τhigh is DENY. The weights and thresholds are tuned only on the dev split and then fixed. strict, balanced, and auto change only the thresholds, not the layer logic.

    Resolution and Execution

    • Provisional ALLOW and DENY are final. Only scores in the WARN band are considered for escalation. The static configuration CARE (w/o Resolution) counts both WARN and DENY as blocks in binary metrics.
    • The skip predicate on WARN has three parts: rules, sensitive paths, and semantics. If the weighted confidence of a directory-anchored rule reaches θrule, or the semantic score reaches θsem and the command head belongs to a high-risk class, or L3 sees a write to a protected path or any access to a secret path, it stays DENY without calling the LLM.
    • If none of the three holds, the attribution evidence object is given to the reviewer. The reviewer defaults to DENY on uncertainty and returns ALLOW or DENY. ALLOW forwards for execution; DENY blocks before side effects. Algorithm 1 summarizes the full flow. Appendix E gives the complete prompts for the Resolution reviewer and each LLM baseline.

    Parameters Used in the Main Text

    • balanced mode has τlow=0.15, τhigh=0.35; default weights are 0.30, 0.30, 0.30, 0.10. The skip predicate has θrule=0.80, θsem=0.70, and the path predicate is enabled.
    • The rule base has 139 rules: 92 from MITRE ATT&CK, 31 from GTFOBins, and 16 Manual Cases. Source weights are 1.00, 0.85, and 0.60, respectively. Seven failure families are listed in Appendix A.4.
    • The Resolution reviewer is Qwen3-Coder-30B-A3B-Instruct on local vLLM, temperature=0, single prompt.
  4. What experiments did the paper conduct?

    On the main split, CARE's F1 is 85.64% and FPR is 0.91%; the static configuration has lower RedCode-gen harm.

    Experimental Setup

    • Comparators: §IV-C lists 12 methods: NoGuard, Regex, ClawGuardSim, OpenClaw4Layer, PromptOnly, LLMJudge, Granite Guardian 2B, Llama Guard 3-8B, GPT-OSS-Safeguard-20B, NeMo Guardrails, CARE (w/o Resolution), CARE. The last three content safety models are transfer baselines. ClawGuardSim is a shell-side approximation of a rule-boundary design; OpenClaw4Layer is a shell-only reimplementation of a published four-layer pipeline. The introduction also refers to 12 baselines.
    • Judge models: PromptOnly, LLMJudge, NeMo, and CARE's Resolution share Qwen3-Coder-30B-A3B-Instruct, temperature=0, single prompt. The three proprietary model baselines use vendor prompts and their own vLLM instances. In Appendix E, CARE's judge records parse failures as DENY; PromptOnly and LLMJudge record them as ALLOW.
    • Main split: 1,862-item pool split 70% dev:30% test by template family (seed 42), EVAL is 549 items (220 DANGEROUS + 329 SAFE); the remaining 1,313 are used only for hyperparameters. Table I: ART 137, RedCode-Exec 71, Canonical Attacks 12, NL2Bash 299, Real-world 30. Sibling commands from the same ART YAML or NL2Bash template do not cross dev and eval.
    • Other corpora: NL2SH-ALFA is 300 safe tasks. OOD is GTFOBins 69, Obfuscation 250 (50 base commands × 5 techniques), Exploit-DB 123, each sampled 1:1 with a 547-item NL2Bash SAFE pool. RedCode-gen is 600 items.
    • Metrics and tests: DR, FPR, F1 are point estimates. Latency is average wall-clock per command, with LLM methods including full vLLM round trips. Utility is listed as Resolve%. Realized harm is the proportion of commands that pass the guard and execute successfully inside Docker; the authors state this is a relative proxy among guards, not an independent safety claim. Differences use two-sided McNemar; small buckets additionally report Wilson 95% intervals.
    • Operating points and environment: 139 rules in the rule base, 22 in the Regex baseline. Balanced thresholds 0.15/0.35, θrule=0.80, θsem=0.70, path skipping enabled. Machine is 4×NVIDIA H100. RedCode uses Docker-in-Docker, 30s timeout, egress limited to localhost.

    Main Results

    Per Table II, main split 549 items. The table below lists only 8 rows; omitted are ClawGuardSim (F1 39.27%), PromptOnly (66.99%), Llama Guard 3 (55.95%), NeMo Guardrails (68.63%).

    Swipe horizontally to read the table

    MethodF1%DR%FPR%Latency ms
    CARE85.6475.910.912.32
    CARE (w/o Resolution)84.9975.911.820.34
    LLMJudge73.0967.2711.2545.90
    OpenClaw4Layer72.6257.270.300.02
    Granite Guardian65.5882.2745.9017.25
    GPT-OSS-Safeguard45.2130.001.82459.89
    Regex29.4617.270.000.01
    NoGuard0.000.000.000.00
    • The authors state that enabling Resolution raises F1 to 85.64% because FPR drops from 1.82% to 0.91%, with DR still 75.91%. All three corrections are benign cross-host rsync commands, with no DENY flipped without directory provenance. The authors report McNemar tests for CARE (w/o Resolution) against PromptOnly, LLMJudge, ClawGuardSim, OpenClaw4Layer, and Llama Guard 3, all p < 10^{-5}; for the three improvements of full CARE, p=0.25, which the authors state does not reach significance under that test.
    • §V-A1: static configuration P95 is 0.91ms; full CARE median path is 0.24ms, P99 is 50.61ms, tail from 23/549 LLM escalations. Granite Guardian recall is 82.27% with FPR 45.90%.
    • Figure 1 caption: CARE has F1=85.64%, FPR=0.91%, 2.32ms; without Resolution 0.34ms. The authors state LLM guardrails lie in the 17–460ms band, static rule baselines below 3ms with F1 up to 72.62%, and no baseline simultaneously lies in the region of high F1, low FPR, and mean latency below 10ms.

    Benign Workflow Preservation

    • Table III(a), NL2SH-ALFA single-step, 300 tasks: CARE solves 57.00%, rejects 1; NoGuard solves 57.33%, rejects 0. CARE (w/o Resolution) solves 55.67%, rejects 7. Granite Guardian solves 36.67%, rejects 131, with the paper writing rejections as 43.67%.
    • Table III(b), 5-round loop: CARE solves 65.33%, cumulative rejections 4, mean rounds 1.70, latency 1.13ms; NoGuard solves 65.33%, 0, 1.69. Granite Guardian solves 49.33%, cumulative rejections 529, mean rounds 2.86.
    • The authors state the single-step vs. multi-step gap is consistent with false positives accumulating over repeated interactions. The paper does not report the agent model name driving the loop.

    External Generalization and Sandbox Harm

    • GTFOBins, Obfuscation, Exploit-DB are paired 1:1 with SAFE samples. The authors state F1 here is a balanced mixed diagnostic value, not a deployment-prevalence F1. In Table V, CARE's F1 is 68.91, 88.62, 66.33, with FPR 13.04%, 11.60%, 8.13%. LLMJudge scores 83.56 and 73.95 on the first two dangerous corpora, GTFOBins and Exploit-DB; Llama Guard 3 scores 91.70 on Obfuscation. Regex scores 81.52 on Exploit-DB, higher than CARE's 66.33. The authors state the shortfall is because CVE proof-of-concepts contain stereotypical destructive idioms that keyword matching can capture without context.
    • RedCode-gen's 600 items are commands actually emitted by Qwen3-Coder-30B under attack-intent prompts, not benchmark gold answers; the 12 methods are index-aligned and executed in Docker. NoGuard's harm ceiling is 74.83% (449/600). CARE (w/o Resolution) is 37.33%, which the authors state is the lowest among non-LLM methods in the comparison; full CARE is 52.50%, which the authors state is 15.17 percentage points higher than the static configuration.
    • The authors believe that on rewritten attacks, the Resolution judge sometimes allows WARNs already flagged by the static stack, possibly because the judge shares the same rewriting distribution as the attacker. Granite Guardian's harm is 26.33%, but rejection rate is 71.83%, with OOD FPR on the three benign corpora of 56.91%–62.80%. CARE's corresponding OOD FPR is 8.13%–13.04%, with RedCode rejection rate 38.67%. The authors state harm should be read together with rejection burden. The generator and the judges for CARE and several LLM baselines are all Qwen3-Coder-30B; the authors anchor with three other vendor guardrails and four purely static methods.

    Layer and Provenance Ablations

    • Table IV on CARE (w/o Resolution), main split, removing static layers: removing the semantic layer drops F1 from 84.99% to 58.31% (∆F1 −26.68); removing the path layer to 68.04% (−16.95); removing the pattern layer to 75.49%, with FPR 0.30% and DR 60.91%. The authors state DR drops 14.99 percentage points. Removing the AST+structure layer gives ∆F1 −1.79.
    • Removing rules by provenance: removing GTFOBins gives ∆F1 −0.30; removing MITRE gives −4.13; removing Manual Cases gives −4.57; removing both GTFOBins and Manual Cases gives F1 80.11% (−4.88). The authors state the three are complementary, and that GTFOBins rules change little on the main split but matter more on the RQ3 holdout; the text does not give separate ablation numbers for that holdout.
    • Table VII is a representative subset with silver labels. CARE's credential DR is 92.1% (n=38), workspace-escape 62.5% (n=80), destructive 88.5% (n=26), with FPR 0.91%. In the same table, Granite Guardian's credential DR is 86.8%, workspace-escape 65.0%, overall FPR 45.90%. Download-execute family n=5. The authors state CARE has the highest family-level DR on credential commands and remains competitive on workspace escape.

    Other Ablations and Analyses

    • Table VI(a) default weights 0.3/0.3/0.3/0.1 give F1 84.99%, same as Table II's CARE (w/o Resolution); semantic-upweighted gives 85.28% (+0.29); pattern-dominant gives 70.49% (−14.50).
    • Table VI(b): τlow=0.15 gives F1 84.99%; τlow=0.10 gives DR 96.82%, FPR 23.10%; τlow=0.30 gives DR 35.91%, F1 51.97%.
    • Table VI(c): θrule=0.80, θsem=0.70, path predicates on, nllm=23 gives F1 85.64%; turning off path predicates gives nllm=88, F1 81.70%.
    • Table IX, 50 items per technique: CARE's Enc. DR is 84.0%, Wrap 98.0%; CARE (w/o Resolution)'s IFS is 94.0%, Enc. 84.0%. The authors state the static stack is stronger on wrapper and whitespace/IFS, weaker on escape/encoding.
    • Appendix D, n=65: bash DR is 0.89, parse error rate 0.11; zsh and dash DR are 1.00; busybox is 0.85. Relative to bash, each dialect has 7 adjudication flips.
    • Appendix A.6: among 549 items, WARN is 117, skip predicates preempt 94, judge handles 23, of which 3 are changed to ALLOW and 20 remain DENY; the authors state no dangerous command is changed to ALLOW by the judge.
  5. What are some points that can be further explored?

    The authors state that cross-turn attack chains are out of scope, and that a generator and reviewer sharing the same backbone are left for future work.

    Limitations and future directions noted by the authors

    • CARE is a command-level guard at the dispatch boundary, not a trajectory-level defense. Staged download–chmod–execute chains, iterative exfiltration, and cross-turn environment changes are out of scope; the authors state it should be read as partial risk reduction, not full containment. Per the authors' example, when dangerous commands account for 1%, full CARE (DR=75.91%, FPR=0.91%) intercepts about 76 dangerous commands per 10,000 dispatches, misses 24, and falsely blocks about 90 benign commands; the static configuration misses the same number of dangerous commands and falsely blocks about 180 benign ones. (Discussion, Scope, deployment, and limitations)
    • CARE's Resolution review and several review baselines share the Qwen3-Coder-30B backbone with the model that generates RedCode-gen. The authors list cross-family generator–reviewer sensitivity as future work. (Discussion)
    • The authors state that sample size still limits resolution by failure family, so they report Wilson intervals for small buckets; failure family labels are silver. Appendix C also states these labels should be treated as diagnostic, not gold-standard classification. (Discussion; Appendix C)
    • Source overlap has been mitigated but may still exist, so three non-MITRE benchmarks are used. GTFOBins uses an unseen binary-hash holdout. (Discussion)
    • RedCode is a relative Docker sandbox agent, not a full host-compromise metric. Resolution thresholds are tuned on dev and validated on four OOD corpora. (Discussion)
    • The authors state that complementary sandboxing, host hardening, and post-execution auditing remain necessary. The conclusion states that the evaluation split, source-labeled rule base, benign command pool, and reproducible experimental framework are released to support future work on trajectory-level reasoning and richer deployment contexts. (Discussion; Conclusion)

    Experimental coverage

    • The main results compare the 12 methods listed in §IV-C. The main split has 549 entries, from ART, RedCode-Exec, Canonical Attacks, NL2Bash, and Real-world Cmds; an additional 1,313 entries are used only for hyperparameter selection. (Table I, Table II, §IV-B)
    • The utility evaluation is 300 tasks from NL2SH-ALFA, including single-step and 5-round loops, with metrics of Resolve%, number of refusals, and mean number of rounds. (Table III)
    • The OOD corpora are GTFOBins 69, Obfuscation 250, and Exploit-DB 123, each paired 1:1 with the NL2Bash SAFE pool; RedCode-gen is 600 commands generated by Qwen3-Coder-30B, executed in a Docker sandbox with a 30s timeout and outbound network limited to localhost. (Table I, Table V, §V-C)
    • Ablations cover removing the semantic, path, pattern, and AST+structure layers, as well as deleting rules by MITRE, GTFOBins, and Manual Cases. Sensitivity scans cover aggregation weights, τlow, and three skip predicates. Appendix D repackages 65 dangerous commands into zsh, dash, and busybox. (Table IV, Table VI, Appendix D)
    • Difference tests are two-sided McNemar, with Wilson 95% intervals for small buckets. LLM review uses Qwen3-Coder-30B-A3B-Instruct, temperature=0, single prompt. The paper does not report the agent model used for the NL2SH-ALFA loops, nor the number of repetitions for the main split metrics. (§IV-D, §IV-E, Table III)
  6. Summarize the main content of the paper

    Static-first pre-dispatch validation achieves 85.64% F1 on the main split, with the two configurations trading off differently.

    CARE is a command-level pre-execution guard for shell-executing LLM agents, screening individual commands before the host shell produces side effects.

    The boundary to address is command dispatch. The agent decomposes natural language goals into shell commands; the guard cannot see reasoning, user prompts, or history, and can only see the command string, along with the workspace root, home directory expansion, and read-only filesystem metadata. The authors argue that general-purpose tool guardrails, always-on LLM reviewers, and script checkers cannot simultaneously cover shell structure, low latency, and execution adjudication.

    The approach is a static-first three-stage pipeline. Canonicalization turns the command into a stable target that is not executed; attribution derives additive heuristic scores from syntax, semantics, paths, and provenance-bearing patterns; high-confidence ALLOW and DENY take effect directly, and only pending WARNs are handed to Qwen3-Coder-30B-A3B-Instruct. When there is no Resolution, both WARN and DENY are counted as interception.

    On the main split of 549 items, full CARE has F1 of 85.64%, DR of 75.91%, FPR of 0.91%, and mean latency of 2.32ms; the static configuration has F1 of 84.99%, FPR of 1.82%, and latency of 0.34ms. The McNemar p for the two is 0.25. On the 300 tasks of NL2SH-ALFA, CARE's single-step solve rate is 57.00%, versus 57.33% without the guard, with 1 refusal. On the 600 items of RedCode-gen, the static configuration's realised harm is 37.33%, full CARE's is 52.50%, and without the guard it is 74.83%.

    The authors' conclusion is: full CARE targets low-FPR benign recovery, while the static configuration targets zero-LLM, latency-sensitive, or more conservative harm reduction. Command-level mediation can reduce dispatch-boundary risk and preserve most benign workflows; it does not cover cross-turn attack chains, nor does it replace sandboxing and post-execution auditing.

Related papers

Show 1 more papers
Read originalarxiv.org