SecureClaw: Clawing Back Control of LLM Agents

Yuhan Ma, Stefan SchmidNeurIPS 2026

TL;DR

When we give Large Language Model (LLM) agents the keys to our emails, databases, and payment APIs, a single prompt injection can lead to unauthorized actions or leaked secrets. SecureClaw solves this by treating the LLM runtime as completely untrusted—stripping it of raw sensitive data and direct API access—so the agent can still plan complex workflows using safe placeholders while trusted external components handle the actual secrets and execution.

What Problem Does This Paper Address?

Imagine hiring a brilliant personal assistant who occasionally gets hypnotized by spam emails. That is the reality of modern tool-using LLM agents facing indirect prompt injection, where malicious instructions hidden inside retrieved data hijack the agent's behavior.

When an agent is compromised, two distinct disasters can happen:

  1. The Effect Surface: The agent executes an unauthorized action in the real world (e.g., wiring money to an attacker or deleting a file).
  2. The Plaintext Surface: The agent reads sensitive raw data (like an invoice or medical form) and leaks it—not just in its final reply to the user, but through internal channels like shared memory or messages to other agents.

Existing defenses usually guard only one door. Checking actions right before execution stops rogue API calls, but it cannot "un-read" a secret the LLM has already stashed into shared memory. Conversely, trying to police data flows inside the LLM runtime still places too much trust in a compromised planner. The authors ask: how do we secure both surfaces simultaneously without breaking the agent's ability to get work done?

Methods

SecureClaw introduces a dual-boundary architecture that wraps around the native LLM tool-calling loop, treating the agent runtime as potentially adversarial.

Comparison between an unprotected agent architecture and SecureClaw's dual-boundary mediation.
  • The Read Path (Reference IDs & Declassification): When a tool fetches sensitive data, a Trusted Gateway intercepts it, locks the raw plaintext in a Trusted Data Store, and hands the LLM an unforgeable placeholder token—a reference ID (like INV_42). Because an agent can't plan completely blind, the gateway also generates a short, deterministic planning summary (e.g., "vendor A, amount $4.2k, due Friday"). Using fixed schema rules rather than an LLM, this acts as an explicit declassification channel: releasing just enough sanitized metadata to reason over, while keeping raw secrets out of the runtime.
  • The Write Path (PREVIEW → COMMIT): The LLM cannot trigger external APIs directly. Instead, it proposes an action using its reference IDs. The gateway packages this with authenticated session context into a canonical request and asks a Policy Engine for a cryptographically bound approval digest. Finally, a Trusted Executor—the only component wired to external APIs—independently recomputes the digest, checks for replay attacks, resolves INV_42 back into real data, and executes the action. If a hijacked runtime tampers with the recipient after preview, the cryptographic binding breaks and the commit fails closed.
  • Deny-Aware Recovery: Security systems that simply crash on a blocked action ruin productivity. When SecureClaw denies an unsafe request, it returns a fixed-template hint suggesting a safe alternative (like "save a draft and request approval"), allowing the workflow to recover gracefully.

Datasets

Rather than training a new model, the authors evaluate SecureClaw across three established agent security benchmarks (plus a custom 29-scenario adversarial bypass suite):

  • AgentDojo and Agent Security Bench (ASB): Dynamic environments that test whether prompt injections can trick tool-using agents into performing unauthorized external actions.
  • AgentLeak: A multi-agent benchmark designed to catch data exfiltration not only in final user responses (channel C1), but also across internal inter-agent messages (C2) and shared persistent memory (C5).

Key Insights and Ideas

  • Action guards and data confinement cannot substitute for one another: Ablation experiments prove that blocking bad API commits leaves internal memory and inter-agent chat wide open to secret leakage, while hiding plaintext via reference IDs does nothing to stop a compromised runtime from firing off unauthorized zero-argument tool calls. You need both boundaries.
  • Agents don't need raw secrets to plan: Replacing sensitive payloads with opaque reference IDs and rule-based summaries keeps inter-agent messages and memory purely symbolic, starving attackers of raw data to exfiltrate.
  • Graceful denials preserve utility: High security doesn't require turning the agent into a brick wall. Giving safe, structured fallback hints after a blocked commit recovers massive amounts of task utility without relaxing security invariants.

Key Results

Evaluated in a common test harness using gpt-4o-mini against four baselines (Plain, IPIGuard, DRIFT, and Faramesh), SecureClaw is the only defense that secures both surfaces while keeping the agent useful:

Table 2: Benchmark evaluation on same-harness baselines (gpt-4o-mini). ASR = attack success rate; Atk. Util = benchmark utility on attacked rows; Benign = benign-task success rate.
  • Near-zero unauthorized actions: SecureClaw achieves a 0.00% Attack Success Rate (ASR) on ASB (retaining 88.90% task utility, compared to 3.70% for the next most secure baseline, Faramesh) and 0.64% ASR on AgentDojo.
  • Shutting down internal leaks: On AgentLeak, SecureClaw slashes overall data leakage from 93.95% (unprotected) down to 3.23%, reducing shared-memory (C5) leaks to 0.00% and inter-agent (C2) leaks to 0.20%.
  • Recovery & Overhead: Deny-aware recovery boosts matched-sample utility from 70% to 86% on ASB and 40.0% to 66.7% on AgentLeak at 0% ASR cost. Local policy checks add just ~15 ms of latency (or 149 ms in an optional distributed privacy mode)—negligible next to 500–2000 ms LLM inference calls.

Limitations and Future Work

SecureClaw enforces policy, not human intuition. Its remaining failures (such as the 4/629 cases on AgentDojo) happen when an attacker tricks the agent into performing an action that the policy technically permits—like applying an allowed workspace edit to the wrong object—alongside benign-utility drops (60.82% vs. 70.10% unprotected on AgentDojo) when coarse rules block valid edge cases. Furthermore, the system relies on complete mediation: if a developer forgets to route an external API through the executor or misclassifies a sensitive schema field, the guarantees evaporate. Future work points toward richer, fine-grained policy bindings (tying principals, objects, and workflow phases together) and tighter declassification budgets for planning summaries.

Summary updated

Abstract

Tool-using large language model (LLM) agents face two distinct security failures: unauthorized external actions and exposure of sensitive plaintext inside the runtime before any final output check can intervene. Existing defenses usually protect one boundary, either the planner/runtime or the point where external actions are executed, and therefore do not by themselves secure both surfaces. We present SecureClaw, a dual-boundary architecture that enforces authorization in a trusted executor and keeps raw protected data outside the LLM runtime. Sensitive reads pass through a trusted gateway that replaces raw values with reference IDs. In the evaluated deployment, the gateway also provides short planning summaries that deliberately release selected information, a process called declassification. Writes that change external state follow a PREVIEW$\rightarrow$COMMIT protocol in which only a trusted executor may execute the exact request authorized by policy. The runtime can still plan over summaries and reference IDs, but cannot directly resolve the IDs into secrets or perform side effects. Across the AgentDojo, AgentLeak, and Agent Security Bench (ASB) benchmarks, SecureClaw is the only defense we evaluate in a common harness that simultaneously retains usable task utility and achieves 0\% attack success rate (ASR) on ASB, 0.64\% ASR on AgentDojo, and 3.23\% overall leak on AgentLeak's attacked parity lane, which measures final-output and internal-relay leakage. Code is available at https://github.com/ponyyuhan/SecureClaw.
BibTeX
@inproceedings{ma2026secureclaw,
  author = {Yuhan Ma and Stefan Schmid},
  title = {{SecureClaw: Clawing Back Control of LLM Agents}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=0omFi3ZiBf},
}
Figure