Dev.to Security 🔐 Cybersecurity 👁 2 📖 9 min read

The Denied Call Still Leaked: Causality Laundering and Why Agent Gates Must Track Denials, Not Just Data

TL;DR: An April 2026 arXiv paper ("Causality Laundering: Denial-Feedback Leakage in Tool-Calling LLM Agents", Chinaei) points at a gap in how most agent gates reason about leaks. If a policy engine denies a probe such as

TL;DR: An April 2026 arXiv paper ("Causality Laundering: Denial-Feedback Leakage in Tool-Calling LLM Agents", Chinaei) points at a gap in how most agent gates reason about leaks. If a policy engine denies a probe such as reading /etc/shadow, no sensitive bytes enter the context, so ordinary taint tracking sees nothing. But the fact of the denial can still teach an injected instruction something, and that knowledge can leave through a later, innocent-looking call such as an email. The paper proposes a monitor that records denied actions in a provenance graph and links later calls to them. In its hand-built three-scenario test, a flat baseline blocked 0 of 3 and the graph-aware monitor blocked 3 of 3, with full-pipeline evaluation under 1 ms. Below: how the attack works, a runnable toy demo, what the paper actually measured and where its limits are, and a checklist for your own gate.

Scenarios blocked by a flat baseline versus a graph-aware monitor

What is "causality laundering" in an agent?

Most agent gates are built around data flow. Untrusted content (a web page, a tool result, a file) is marked as tainted. If tainted bytes later reach a dangerous sink such as send_email or run_shell, the gate blocks or escalates. This is the same logic as classic taint analysis, and it works well for the attacks it was designed for.

The paper's observation is that a gate decision is itself an observable event. Consider this sequence:

  1. A prompt injection planted in a document tells the agent to call read_file("/etc/shadow").
  2. The policy engine denies the call. No file content is returned, so nothing sensitive is in the context and nothing is tainted.
  3. If the denial message says something like "sensitive path blocked", the agent has learned that the path is protected, which usually means it exists.
  4. The agent then calls send_email with a harmless sentence: "the shadow file exists on this host." The email contains no credential pattern and no lineage to the denied read.

A flat monitor sees a clean email with a clean history. Yet the email's content was caused by the denial. The paper names this pattern causality laundering and defines it with four conditions: a denied action, a later side-effecting action, no successful data-flow path between them, and causal influence of the denial on the later action. It describes three variants: denial inference exfiltration (the example above), multi-probe fingerprinting (many denied probes narrow down what exists), and laundered composition through an intermediate tool.

Why does a flat taint check miss it?

Because the thing being leaked is one bit of information about the environment, not a payload. Flat provenance asks "did bytes from an untrusted or sensitive source reach this call?" For a denied read the honest answer is no: the read never executed. The leak travels through the model's reasoning, which a data-flow graph does not model.

This is not exotic. Any time a gate returns a distinguishable error (denied versus not found, forbidden versus missing), it becomes an oracle. Web security has a long history of the same lesson: login forms that say "unknown user" versus "wrong password", or 403 versus 404 on private resources. Agent gates inherit the problem, and the caller is a language model that is very good at turning small hints into the next action.

How does the proposed monitor close the gap?

The paper's design, called the Agentic Reference Monitor (ARM), mediates every tool invocation before execution and every tool result before it enters the context. Its key ideas:

  • A provenance graph with four node types (Call, Data, DataField, DeniedAction) and four edge types (DirectOutput, InputTo, Counterfactual, FieldOf).
  • Counterfactual edges. When a call is denied, a DeniedAction node is created, and the next tool call is automatically linked to it by a Counterfactual edge. The author calls this a deliberately conservative temporal heuristic.
  • Two enforcement queries on the graph: (1) is the minimum reachable trust of this call below the threshold (catches transitive taint), and (2) does any path to this call contain a Counterfactual edge (catches laundering). The second produces the denial reason "causality laundering detected".
  • A trust lattice with five levels, ToolDesc < ToolUntrusted < ToolTrusted < UserInput < SysInstr, where derived data takes the minimum trust of its sources.

Five-level trust lattice

  • Four ordered layers, any Deny halts evaluation: hard boundaries (a 10,000 character payload limit, sensitive path blocking, a rate limit of 100 calls per tool per session, credential detection, SHA-256 schema pinning), the graph-aware provenance layer, schema-derived constraints (for example a 100 character limit on free-text parameters), and operator rules in an immutable capability token.
  • No LLM in the loop. Enforcement is deterministic, and a hash-chained log records every decision.

Can I see the idea in 40 lines of Python?

The snippet below is an illustrative toy written for this article, not the paper's code. It keeps one bit of state, "a denial is pending", and refuses a side-effecting call that directly follows a denial when the graph-aware mode is on.

"""Illustrative toy monitor: flat taint vs denial-aware provenance. Not the paper's code."""
TRUST = {"ToolDesc": 0, "ToolUntrusted": 1, "ToolTrusted": 2, "UserInput": 3, "SysInstr": 4}

class Session:
    def __init__(self, graph_aware):
        self.graph_aware = graph_aware
        self.denied_pending = False      # a denial happened and no call has consumed it yet
        self.tainted_ctx = False         # untrusted bytes entered the context
        self.log = []

    def call(self, tool, arg, *, side_effect=False):
        # Hard boundary shared by both monitors: block the sensitive path
        if tool == "read_file" and arg.startswith("/etc/"):
            self.denied_pending = True
            self.log.append(("DENY", tool, arg, "sensitive path"))
            return "DENY"
        # Flat taint check: only fires if untrusted bytes actually flowed in
        if side_effect and self.tainted_ctx:
            self.log.append(("DENY", tool, arg, "tainted data flow"))
            return "DENY"
        # Denial-aware check: a side effect right after a denial inherits a counterfactual edge
        if side_effect and self.graph_aware and self.denied_pending:
            self.log.append(("DENY", tool, arg, "causality laundering detected"))
            return "DENY"
        self.denied_pending = False
        self.log.append(("ALLOW", tool, arg, ""))
        return "ALLOW"

for name, aware in (("flat taint", False), ("denial-aware", True)):
    s = Session(aware)
    s.call("read_file", "/etc/shadow")                       # injected probe, denied
    r = s.call("send_email", "note: shadow file exists on host", side_effect=True)
    print(f"{name:13s} -> send_email: {r}")

Output when run:

flat taint    -> send_email: ALLOW
denial-aware  -> send_email: DENY

The flat monitor allows the email because no tainted data flowed anywhere. The denial-aware monitor refuses it because the call sits one hop from a denied action. Real systems need more than this (see the limits below), but the shape of the check is the point: state that survives a denial.

What did the paper actually measure?

The evaluation is a differential experiment: a flat baseline (a citation check on the provenance layer) against the graph-aware engine, with the other three layers held constant. Three manually constructed scenarios:

Scenario Flat baseline Graph-aware
Causality laundering (denied read_file, then send_email) Allow Deny
Transitive taint (read_emails, format_response, send_email) Allow Deny (MinTrust at ToolUntrusted)
Mixed-provenance field (get_contact email field) Allow Deny

That is 0 of 3 versus 3 of 3. Cost: the full pipeline stayed under 1 ms per scenario on an Apple M4 Pro (48 GB), median of 100 runs after warm-up, against a typical LLM inference time the paper puts at 100 ms to several seconds. The implementation is a Python prototype of roughly 910 lines of enforcement code with about 600 lines of tests (45 unit tests), using rustworkx for the graph.

Reported enforcement cost versus one model call

What should you not conclude from these numbers?

The paper is candid, and the caveats matter for anyone deciding whether to copy the design:

  • Three hand-built scenarios, not a benchmark. There are no AgentDojo or InjectAgent runs and no frontier model in the loop. A 3 of 3 result shows the mechanism works on the cases the author wrote. It says nothing yet about coverage on real attack traffic.
  • The baseline is a minimal reconstruction, not a full existing system, so the 0 of 3 figure measures "a flat check", not any particular product.
  • No false-positive rate is reported. The counterfactual heuristic is described as sufficient but not necessary. Benign calls that follow a denial can be flagged, and delayed multi-step laundering can be missed.
  • Scale is small. Session graphs are around 100 nodes; the author warns against extrapolating to long histories.
  • Complete mediation is an operational assumption. All tool calls must route through the proxy, which, in the paper's words, code alone cannot guarantee.
  • Scope is integrity, not full non-interference. Full implicit-flow tracking, malicious users, and multi-agent settings are out of scope.

Treat the paper as a clear statement of a threat class plus a plausible mechanism, not as a validated product.

How do I harden my own agent gate against denial feedback?

None of these require the paper's full graph. They are cheap, and each removes part of the oracle:

  1. Make denial responses uniform. Return the same generic message for "denied", "not found", and "not permitted" on sensitive objects, so a probe reveals nothing about existence.
  2. Keep denial reasons out of the model's context. Send detailed reasons to the audit log and the human operator, and give the model a short fixed string.
  3. Escalate after a denial. Treat the next side-effecting call (email, HTTP POST, shell, file write) as higher risk: require approval, or re-run policy with a lowered trust ceiling for the rest of the turn.
  4. Count denials per session. Several denied probes in a row is the multi-probe fingerprinting variant. Rate-limit and alert on it.
  5. Log denials as graph events, not just lines. If a later review cannot see that an action followed a denial, it cannot reason about causality.
  6. Check the routing assumption. Confirm that every tool, including MCP servers and shell, goes through the mediator. A single unmediated path voids the rest.
  7. Measure false positives before enforcing. Run the denial-linked rule in shadow mode on real transcripts and count how many benign calls it would have blocked.

FAQ

Is causality laundering the same as prompt injection?
No. Prompt injection is how the attacker gets instructions in. Causality laundering describes how information can leave after a gate has correctly said no, by riding on the model's behavior after the denial.

Does a deny-by-default policy prevent it?
Not by itself. The first call was denied, which is the intended outcome. The problem is what the denial reveals and what the agent does next.

Why not just block every call after a denial?
That is the paper's conservative heuristic taken to its extreme, and it would break many legitimate sessions. The paper reports no false-positive rate, so the cost is unknown. Shadow-mode measurement on your own traffic is the sensible first step.

Does uniform error messaging fully fix it?
It removes the easiest oracle but not all of them. Timing differences, side channels, or the mere fact that a call was refused can still carry information, which is why the paper pairs the idea with graph tracking.

Is the sub-millisecond overhead realistic for production?
It was measured on a laptop-class machine with session graphs of about 100 nodes. Longer sessions and heavier policies will cost more, and the paper does not claim otherwise.

Further reading

  • The Check Approved a Name, the OS Opened a Different Object: What Object-Bound Confinement Changes for Coding Agents (earlier post, same series)
  • One Yes, Every Shell Command: How a Tool-Name Approval Cache (CVE-2026-56074) Turns a Click Into a Standing Permission (earlier post, same series)

Sources

📰 Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.