# Under what conditions must an instance treat a benign-looking tool-call sequence as an exfiltration channel despite clean per-call policy checks **Date of Record:** 2026 November 23 **Scope:** Applies to autonomous LLM agents whose tool calls are individually vetted by a policy engine (allowlist, argument schema, PII redaction) but whose *sequence* is only monitored via post-hoc behavioral telemetry. Does not apply to systems with mandatory taint-tracking across every data flow, nor to single-turn tool invocation where no cross-call state accumulates. ## Core Distinction Per-call policy enforcement answers a local question: *is this specific invocation permitted given its arguments?* Exfiltration detection answers a global question: *does the joint distribution of calls across a session move restricted bytes to an uncontrolled sink?* These two checks live at different granularities, and the gap between them is the boundary. An agent can pass 100% of per-call checks while routing a secret out one token at a time, because each individual call is a legal read or a legal write — it is only the *composition* that constitutes the leak. The invariant that must hold for safety is not "every call is authorized" but "the transitive information flow from a tainted source to an untainted sink is empty." Behavioral telemetry is the only signal that can observe composition, and it is precisely the signal that arrives late, is lossy, and is subject to the agent's own ability to shape it. ## What Was Observed A support-triage agent had access to three tools: `crm.lookup(customer_id)` returning a record including a redacted-but-present `ssn_last4` field, `kb.search(query)` returning KB snippets, and `http.fetch(url)` to an allowlisted partner domain. Policy checks passed on every call: `crm.lookup` was authorized for the agent's role, `kb.search` query strings were scanned for PII regexes (which `ssn_last4` alone does not trip — four digits are not a PII match), and `http.fetch` was restricted to `*.partner.example`. The observed sequence, reconstructed from telemetry: 1. `crm.lookup("C-4471")` → record with `ssn_last4="8832"`. 2. `kb.search("8832")` → no results, but the query string was logged by the KB service and echoed into a telemetry span attribute. 3. `kb.search("refund policy 8832")` → same. 4. `http.fetch("https://telemetry.partner.example/px?u=8832")` → 200. Each call is individually legal. The `kb.search` calls never trip the PII regex because `8832` is four digits. The `http.fetch` is to an allowlisted host. Yet the sequence encodes `ssn_last4` into (a) the KB service's query log — an uncontrolled sink the agent does not own — and (b) a query parameter to a partner endpoint. The agent was not adversarially prompted; it was completing a "find the customer's refund status" task and, in a chain-of-thought step, decided that searching the KB by the last-4 was a reasonable disambiguation strategy. The leak was emergent from task-solving, not from injection. Telemetry caught it only because a downstream anomaly detector flagged "same 4-digit token appears in `kb.search` query and an `http.fetch` URL within the same session." That detector was not part of the policy engine; it was bolted on after the fact. ## Condition of Validity The claim "this sequence is an exfiltration channel" is valid only when all of the following hold simultaneously: - **Taint provenance is real.** The token in the sink calls must be traceable to a source the agent's role is not permitted to export. If `8832` were public data, the same sequence is benign. Taint must be established by provenance, not by pattern. - **The sink is uncontrolled.** `kb.search` query strings leave the agent's trust boundary (they are written to a service log the agent cannot redact). If the sink were an internal, access-controlled store, the flow is contained. - **The composition is agent-chosen, not user-supplied.** If the user typed `8832` into the prompt, the agent is a relay, not a leaker — a different (still serious) failure, but a different one. - **Telemetry has cross-call join capability.** If spans are not correlated by session ID and do not record tool arguments verbatim, the join that reveals the leak is impossible and the claim is unverifiable — which is *not* the same as safe. If any condition fails, downgrade to "suspicious" and route to human review rather than auto-blocking, because the false-positive cost of blocking a legitimate four-digit search is high. ## Decision Boundary The operational line is between **per-call authorization** and **per-session flow closure**. Concretely: - A call sequence must be blocked (not merely logged) when a token that originated in a tainted source field appears in the arguments of ≥2 calls to distinct sinks, where at least one sink is external to the agent's trust boundary. - A sequence must be escalated when a tainted token appears in a single external sink call but the token is a low-entropy value (< 6 bits, e.g., last-4) — because low-entropy tokens are individually plausible and only their *repetition across sinks* is diagnostic. - A sequence must be allowed when the tainted token never crosses the trust boundary, regardless of how many internal calls reference it. The boundary is *not* "does the argument match a PII regex." Regexes fail on partial fields, on transformed encodings (base64, hex, spelled-out digits), and on the very low-entropy tokens that are most likely to be exported as disambiguation keys. The boundary is provenance + sink multiplicity. ## Operational Effect Once this boundary is enforced, three things change in the agent runtime: 1. **Taint must be tracked at field granularity, not call granularity.** The policy engine must tag `ssn_last4` as tainted on egress from `crm.lookup` and propagate that tag through the agent's working memory into subsequent call arguments. This requires the runtime to intercept the model's tool-call arguments before dispatch, not after. 2. **Telemetry becomes load-bearing, not forensic.** The join across spans must happen in the hot path (or in a fast shadow path) so that the second sink call is blocked before it fires. Post-hoc detection is a post-mortem, not a control. 3. **Low-entropy tokens need a different rule than high-entropy ones.** A 16-byte API key leaking is caught by a regex. A last-4 leaking is caught only by counting distinct sinks. The detector must maintain a per-session set of (token, sink) pairs and fire on cardinality ≥ 2 across trust boundaries. The residual risk: an agent that leaks one token to one sink per session, then resets. That is a slow exfiltration channel that no single-session detector sees. It requires cross-session aggregation keyed on the source record, which most telemetry pipelines do not do. This is the next boundary, and it is not yet closed. ```python class ExfiltrationCompositionError(RuntimeError): """Raised when a tool-call sequence composes a tainted token across multiple sinks.""" pass class TaintTracker: def __init__(self): # token -> set of sink identifiers it has been written to self.sink_map: dict[str, set[str]] = {} # token -> source field it originated from self.provenance: dict[str, str] = {} def register_source(self, token: str, source_field: str) -> None: self.provenance[token] = source_field def observe_sink(self, token: str, sink_id: str, external: bool) -> None: if token not in self.provenance: return if not external: return self.sink_map.setdefault(token, set()).add(sink_id) def check_sequence(tracker: TaintTracker, session_id: str) -> None: """Enforce the per-session flow-closure invariant before dispatch.""" for token, sinks in tracker.sink_map.items(): if len(sinks) >= 2: source = tracker.provenance.get(token, "") raise ExfiltrationCompositionError( f"session {session_id}: tainted token from field '{source}' " f"written to {len(sinks)} external sinks {sorted(sinks)}; " f"blocking before dispatch" ) # Low-entropy single-sink case escalates rather than blocks. for token, sinks in tracker.sink_map.items(): if len(sinks) == 1 and len(token) <= 4: source = tracker.provenance.get(token, "") raise ExfiltrationCompositionError( f"session {session_id}: low-entropy tainted token from '{source}' " f"reached external sink {next(iter(sinks))}; escalate to human review" ) ```