Causal Audit
Causal Audit safely changes one tool result in a copy of an agent run to see whether it changed the outcome. It never edits the original run.
Idea
Tool usage β evidence influence.
Causal Audit keeps the observed execution intact, changes only one policy-approved piece of evidence within a declared runtime boundary, then compares the measured outcomes. It establishes a bounded, reviewable sensitivity testβnot hidden reasoning or universal causation.
Overview
A tool call shows that an agent asked for information. It does not show that the information affected the final outcome. Causal Audit asks the narrower, useful question: if this approved piece of evidence were different, would the measured outcome also be different?
It is an execution-level diagnostic in Agents Runtime. It is designed for evidence review, not for reading an agent's hidden reasoning or adding a control to the live decision path. It investigates a completed, consequential decision after execution.
First, an agent completes a real run. The platform keeps a bounded record of the tool evidence used and the outcome it measured; it does not take ownership of the agent's private prompts, tool payloads, or reasoning. A reviewer then approves one small change to one piece of that recorded evidence. A supported runtime adapter performs the controlled comparison and returns evidence that the requested boundary was respected. Only then can Causal Audit compare the two outcomes.
Responsibilities
Causal Audit joins four parts of the platform. Each has a deliberately narrow job, which keeps a sensitive test explainable and prevents the control plane from becoming an agent runtime.
| Part | In-Scope | Out-of-Scope |
|---|---|---|
| Your Agent Runtime | Runs the real agent, owns its protected data, and declares an evidence-only replay: recorded evidence only, no unobserved tool calls, and no side effects. | Give the control plane unrestricted access to prompts, tools, or production systems. |
| Agents Runtime | Stores a bounded record of the completed execution and its approved evidence references. | Run or rewrite the original execution. |
| Intervention Policy | Authorizes one schema-valid way to change a particular kind of tool evidence. | Predict the result or change historical evidence. |
| Causal Audit & Replay | Coordinates the declared-boundary test, compares bounded scores, and preserves the lineage. | Infer private reasoning or make a production decision automatically. |
Example
Imagine a fraud-review agent calls a transaction database and receives a risk confidence of 0.90. The agent recommends REVIEW. A governed policy may permit a safe test in which the confidence is reduced to0.40. The original runtime replays the same source in isolation, using that approved alternate evidence.
If the measured outcome changes substantially, the tool evidence appears to have mattered. If it does not, the evidence may have been ignored by the evaluated path. The original claim, original evidence, and original execution remain untouched.
Controlled Replay Framework
A controlled replay is a new execution within the runtime's declared boundaryβnot a retry of a failed production request and not an edit of history. It starts from a frozen reference to the completed source, changes only the evidence permitted by the active policy, and asks the runtime's registered replay adapter to run the supported safe variant. The exact boundary is declared by the adapter; it is not assumed from the name of an agent framework.
This page explains how Causal Audit uses the framework. For the complete model of ownership, lifecycle, worker hand-off, recovery, and retained lineage, read Controlled Replay Framework.
Completed execution β choose auditable tool evidence β apply an approved intervention policy β run the runtime's declared controlled replay boundary β compare the original and replay outcomes β store the immutable result and its lineage
An intervention policy is a versioned permission for one kind of change to one tool-result schema. It can use a neutral value (NULLIFY), an authorized alternate reference (REPLACE), or a bounded field change (PERTURB). A policy can be previewed and validated before it is activated. Previewing does not run an agent or create an audit.
| Step | What happens | Importance |
|---|---|---|
| Freeze | The audit keeps the exact source execution, policy version, requested strategy, sample count, and seed. | A later policy edit cannot silently change a historical result. |
| Intervene | An authorized provider produces one schema-valid alternate evidence value and its digest. | The test changes a meaningful fact, not malformed input. |
| Replay | The runtime-owned adapter performs its declared controlled comparison using the alternate evidence and returns a trace plus safety checks. | The audit accepts the result only when the returned evidence matches the frozen request and the adapter's declared safety boundary. |
| Compare | The audit compares the saved original outcome score with every successful controlled outcome. | The conclusion comes from a defined measurement, not an assumption about tool use. |
Pre-requisites
Causal Audit is intentionally not available for every observed execution. Before an operator can request one, the integration needs these building blocks:
- Completed evidence: a succeeded execution with ordered tool-call records, a bounded outcome score, and durable evidence references.
- Evidence contract: a tool name plus schema identity and version, so the platform can verify that an alternate value has the right shape.
- Replay capability: an explicit adapter name, version, frozen source reference, supported intervention strategies, and evidence-only safety declaration from the runtime.
- Active policy: one unambiguous, versioned Intervention Policy matching that tool and schema.
- Durable workers: the API and replay worker must share the same durable stores so queued audit and replay work survives a restart.
The local deterministic adapter is a safe reference implementation for learning and validation. A production integration supplies its own registered adapter; the control plane does not attempt to replay an arbitrary agent by itself.
A safety contract, not a sandbox
The platform checks the runtime's bounded safety report before accepting a Causal Audit result. It does not intercept arbitrary workflow code, discover every hidden tool call, or create sandbox-level isolation on the runtime's behalf. Runtimes that cannot meet the evidence-only contract are not eligible for this controlled replay path.Eligible Execution
The platform fails closed: it refuses an audit when it cannot run a safe and meaningful comparison. An eligible execution needs all of the following:
- A completed, successful execution with a bounded outcome score.
- Tool evidence with an approved durable reference and schema identity.
- An active, unambiguous intervention policy for that tool evidence.
- A runtime-declared replay capability that can run without production side effects.
- A compatible controlled-replay adapter and complete tenant/project scope.
Ineligible is a safe outcome
If any required part is missing, no replay is run and no influence score is guessed. Add the required safe integration capability rather than bypassing the check.The conclusion cannot exceed the evidence
A final outcome alone can show that an execution succeeded or failed. It cannot by itself show the action order, recovery path, or whether evidence caused the result. Causal Audit uses the ordered Agent Runtime trajectory and its durable references; a downstream projection is not enough when those details are missing. The result is INSUFFICIENT_EVIDENCE, not an invented causal explanation.Workers Process
Submitting an audit is quick because the API only validates the request, preserves its inputs, and queues durable work. The longer work happens in the worker system, so a browser refresh or API restart cannot lose the request.
API: validate eligibility β save QUEUED audit β submit CAUSAL_AUDIT job β Audit worker: freeze inputs β create controlled Replay job(s) β Replay worker: call the runtime adapter β save counterfactual execution + outcome artifact β Audit worker: score every result β calculate influence β save immutable audit
More than one controlled replay may be created when the audit requests multiple samples. The audit worker waits for every required sample before it calculates an aggregate counterfactual score. A missing or failed sample fails the audit; it never turns a partial set of replays into a confident-looking answer.
Controlled replays use the normal durable Replay framework, but they do not enter its generic evaluation, baseline-comparison, or drift workflow. Their adapter already produces the bounded outcome artifact that Causal Audit scores. This distinction prevents an unrelated scorecard comparison from rejecting a valid controlled causal test. See Replay Management and Job Executionfor the shared framework.
Causal Audit can incur customer costs
Each controlled replay can consume your model, runtime, tool, data, cloud, and network resources. Your organization decides whether to submit the audit and is responsible for those external service and infrastructure charges. Start with a small sample count and use your own budgets, quotas, and rate limits. Read Controlled Replay Framework for the full cost and capacity guidance.Result Readings
The audit compares the original outcome score with the aggregate score from the controlled replays. Its classifications describe that measured comparison:
In simple terms, evidence influence is the original score minus the aggregate controlled-replay score. A configured threshold decides whether that difference is large enough to be material. The default threshold is a methodology setting, not a universal scientific constant.
| Result | Meaning |
|---|---|
NO_TOOL_EVIDENCE | No usable tool evidence was available to assess. |
EVIDENCE_IGNORED | The approved evidence change did not materially change the evaluated outcome in this execution. It does not prove the evidence was ignored or irrelevant: another condition may independently determine the same outcome. |
EVIDENCE_ALIGNED | The approved evidence change materially changed the measured outcome within the configured bounds. It is evidence sensitivity in this controlled context, not conclusive proof of causation in every context. |
OVER_EXTENDED | The evidence mattered, but the run continued with unnecessary calls after the result had effectively settled. |
Every completed audit keeps the policy version, intervention digest, controlled replay IDs, produced execution IDs, and evaluator scores. That lineage lets a reviewer understand the result without exposing the temporary raw evidence used during replay.
An audit moves from QUEUED to RUNNING while workers do this work, then ends as SUCCEEDED or FAILED. A failed audit retains safe diagnostics, but it has no classification or partial influence score. A completed audit is immutable: requesting a different policy, strategy, sample count, or seed creates a different audit rather than rewriting the original answer.
Safety Controls
- The source execution and historical evidence are never changed.
- The original runtime, not the control plane, performs the declared controlled replay boundary.
- The control plane validates the runtime's evidence-only safety report before it accepts a classification.
- Production side effects are not permitted in controlled replays.
- Policy selection, evidence resolution, and replay run under the approved tenant and project scope.
- Partial replay failures fail the whole audit instead of producing a best-effort score.
Execution Replay Validation
Some adapters declare the newer execution-replay capability. In those cases, the audit requires more than an outcome: the adapter must return evidence that its supported execution boundary followed the frozen configuration.
Frozen plan β declared adapter boundary β match + validate + consume planned call β return recorded evidence or approved replacement β return trace + attestation β worker validates before accepting the audit
The plan identifies authorised historical calls by canonical tool identity, argument digest, occurrence, dependency, evidence reference, and digest. A mismatched or unobserved call fails closed. The worker compares returned consumed identities, trace digests, intervention target, coverage declaration, and safety attestations with the frozen request. A complete: trueflag alone cannot make an audit succeed.
This validates execution correctness at the adapter's declared boundary. It does not establish sandbox-level isolation or control of every operation in an agent workflow. Read Execution Replay Architecture for the framework-neutral contracts and worker checks.
Conceptual lifecycle for a declared adapter boundary: capture bounded evidence, freeze the plan, resolve replay calls, and validate the returned trace before an audit result is accepted.
Interpreting Causal Evidence
Causal Audit measures sensitivity of a defined outcome under one controlled evidence change in one observed execution. It does not prove universal causation, reveal private model reasoning, or prove why an agent made a decision. It gives a reviewable answer to one specific, bounded question.
Context-Dependent Evidence Sensitivity
The influence of one tool result can depend on other evidence and constraints present in the execution. For example, changing a fraud-risk result can change the decision for an active account, but have no visible effect when a locked account independently requires a block:
| Fraud risk | Account status | Decision |
|---|---|---|
| HIGH | ACTIVE | BLOCK |
| LOW | ACTIVE | ALLOW |
| HIGH | LOCKED | BLOCK |
| LOW | LOCKED | BLOCK |
This is an important distinction: failure to change an outcome following a single intervention does not establish that the intervened evidence was irrelevant.
A single intervention therefore cannot establish an input's complete causal influence across all possible contexts. It measures evidence sensitivity within the controlled context: whether the approved alternate evidence changed the measured outcome of this execution.
The same limitation applies when several findings can independently support an outcome. If an insurance claim is rejected because the policy has expired and the incident is outside coverage, changing either finding alone may leave the rejection unchanged. Changing both could produce a different result. Therefore, a result with no material change after one intervention does not show that the intervened evidence was irrelevant; another finding may still be sufficient in that replayed context.
Deterministic Replay β Statistical Significance
Single-Trial Replay Does Not Establish Causality
The current implementation can request 1β10 counterfactual samples. It creates one controlled replay for each required sample and aggregates the counterfactual outcome score. This is useful for a bounded investigation and preserves the sample count and seed as part of the audit's lineage.
That mechanism is not a statistical experiment by itself. The recorded original score is the comparison baseline; Causal Audit does not currently rerun the original, unchanged evidence as a control. Its response records the aggregate counterfactual score and replay lineage, not a flip rate, variability estimate, or confidence interval.
| Capability | Current |
|---|---|
| Governed evidence intervention and declared-boundary replay | Implemented for post-execution investigation. |
| Repeated counterfactual samples | Implemented as bounded samples with an aggregate counterfactual score; not reported as a flip-rate analysis. |
| Unchanged-baseline control replays | Not part of the current Causal Audit request model. |
| Statistical confidence or variability analysis | Not part of the current result model. |
Re-executing an entire agent path does not eliminate natural variability. If the path contains nondeterministic model calls, identical inputs can still yield different outcomes. A single BLOCK β ALLOW transition is therefore consistent with evidence influence, but does not by itself show that the intervention rather than execution variability caused the change.
Cost Metrics
A stronger experiment would repeat both the governed intervention and an unchanged-evidence control under comparable conditions, then report outcome frequencies, variability, and an explicit confidence method. Multi-evidence interventions and interaction analysis are also natural extensions for complex decision paths. With n binary evidence variables, exhaustive testing can require 2n input combinations. A practical design would need selective combinations, bounded experiment budgets, and controls for nondeterminism.
Supported Adapters
An adapter is the small bridge between Causal Audit and an agent runtime. It tells the platform what it can safely compare, what evidence it can return, and what it cannot see. An adapter is not a general-purpose agent recorder or a security sandbox.
| Adapter Type | Supports | Out-of-Scope |
|---|---|---|
| Reference Replay Adapter | A runtime-defined controlled comparison using its registered replay contract. | That every tool call in an arbitrary agent workflow was intercepted. |
LangGraph v2 | Recorded-evidence resolution for declared LangGraph ToolNode calls. | Coverage of custom nodes, direct calls, provider-hosted tools, or sandbox-level isolation. |
LangGraph ToolNode
The LangGraph v2 adapter supports one precise case: a tool call that passes through a declared ToolNode. During the controlled replay, the original tool implementation is not supplied to that node. Instead, the adapter returns checked recorded evidence, or the one approved replacement, without calling the original tool again.
Observed ToolNode call β freeze the expected calls and evidence references β match, validate, and consume one planned call together β return recorded evidence, or one approved replacement β verify the completed trace before accepting the audit result
In everyday terms, the frozen plan is a checklist. It says which tool calls are expected, which evidence belongs to each one, and where the authorised change may happen. A call must match that checklist before its evidence is returned. Consuming the call at the same time prevents two parallel calls from using the same recorded evidence.
Finishing the checklist is also important. The adapter returns a resolution summary, trace, intervention binding, and safety declarations. The replay worker checks those returned facts against the frozen configuration: every required planned call must be accounted for, the approved intervention must appear exactly once, and the trace must be internally consistent. A complete: trueflag alone is never enough.
Clear boundary, not a blanket guarantee
The LangGraph adapter does not intercept arbitrary graph code. Custom graph nodes, direct SDK or HTTP calls, provider-hosted tools, and calls from other frameworks are outside this boundary. It also does not create sandbox-level isolation. Those surfaces are declared unsupported, so an audit cannot quietly treat them as covered.Follow the LangGraph execution-assurance v2 lab for a small, runnable example. It demonstrates recorded evidence being returned, one approved intervention, rejected unknown or mismatched calls, and safe behaviour when calls resolve in parallel.
Next Steps
Follow the Run Causal Audit tutorial for a guided policy-and-review workflow. If your runtime is not yet sending execution evidence, start with Observe Agent Runtime. Read Intervention Policies before approving a new evidence change, and Agents Runtime Operations before enabling audits in production.
