Run Causal Audit
Use Studio to authorize one safe evidence change, then use the public API to queue and review an isolated causal audit. This tutorial never changes the original execution.
What you will complete
You will select one completed execution with auditable tool evidence, create an intervention policy, verify that the audit is allowed, submit it, and inspect the immutable result. The example uses the bundled local fraud scenario.
Observed tool evidence → approved policy → eligibility check → isolated replay → reviewable result
Before you start
Start the local stack, sign in to Studio, and load the local Agents Runtime demo data if your environment has no observed executions yet. You need a role that can create and read Causal Audits. Keep the API values from the previous tutorial available.
./servers.shThis is a controlled test, not a production retry
Continue only when the runtime declares that it can reproduce the source in isolation and without production side effects. Causal Audit is intentionally unavailable for executions that cannot meet this standard.Confirm cost approval before you begin
Each controlled replay can call your runtime, model, tools, data services, and cloud infrastructure. Your organization is responsible for deciding whether to run the audit and for all resulting external charges. Begin with the smallest useful sample count and confirm the relevant budgets and rate limits.1. Choose eligible evidence
- Open Agents Runtime → Causal Audits → Intervention Policies.
- Select Create Policy.
- Choose a completed execution from the current organization and project.
- Select an auditable tool result. Studio copies its tool name and evidence schema; do not guess these values.
In the local fraud scenario, this can be the transaction lookup fromdemo-exec-ext-fraud-replay-source-001. A real runtime must publish the durable evidence reference, schema identity, and safe replay capability that make a tool result auditable.
2. Create and Activate Policy
Choose one strategy for the policy version. For the local example, select PERTURB and use a bounded change to the transaction confidence field:
| Field | Value |
|---|---|
| Field path | /confidence |
| Operation | NUMERIC_DELTA |
| Delta | -0.50 |
| Minimum / maximum | 0 / 1 |
- Select Create draft.
- Select Preview to verify the proposed evidence is valid. Preview does not run the agent.
- Select Validate, then Activate.
- Record the returned policy ID and version.
The policy authorizes a narrowly defined test; it does not declare the outcome in advance. Create a new version if you need a different permitted change.
3. Eligibility
Ask the API whether this execution can safely be audited before you submit work. A non-eligible response is useful: it explains what capability is missing and does not start a replay.
export EXECUTION_ID=demo-exec-ext-fraud-replay-source-001
export POLICY_ID=replace-with-active-policy-id
export POLICY_VERSION=1
curl --get "$AI_GOVERNANCE_API_URL/api/v1/agents-runtime/executions/$EXECUTION_ID/causal-audit-eligibility" \
--header "Authorization: Bearer $AI_GOVERNANCE_TOKEN" \
--header "X-AI-Governance-Organization-Id: $AI_GOVERNANCE_ORGANIZATION_ID" \
--header "X-AI-Governance-Project-Id: $AI_GOVERNANCE_PROJECT_ID" \
--data-urlencode 'evaluator_ref=recorded-outcome/v1' \
--data-urlencode "intervention_policy_id=$POLICY_ID" \
--data-urlencode "intervention_policy_version=$POLICY_VERSION"4. Submit Audit
This request creates durable asynchronous work. Use a stable policy version, sample count, and seed when you need the same request to be idempotent.
curl --request POST "$AI_GOVERNANCE_API_URL/api/v1/agents-runtime/causal-audits" \
--header "Authorization: Bearer $AI_GOVERNANCE_TOKEN" \
--header 'Content-Type: application/json' \
--header "X-AI-Governance-Organization-Id: $AI_GOVERNANCE_ORGANIZATION_ID" \
--header "X-AI-Governance-Project-Id: $AI_GOVERNANCE_PROJECT_ID" \
--data "{
"execution_id": "$EXECUTION_ID",
"evaluator_ref": "recorded-outcome/v1",
"intervention": {
"strategy": "PERTURB",
"counterfactual_samples": 3,
"seed": 2,
"intervention_policy_id": "$POLICY_ID",
"intervention_policy_version": $POLICY_VERSION
}
}"The response begins in a queued state. The replay worker performs the controlled replays and completes the audit only when all required lineage is available.
5. Follow the worker hand-off
A queued audit does not mean the answer has been calculated. It means the request and its exact inputs were saved safely. The following hand-off is what turns that request into a reviewable result:
Causal Audit worker 1. freezes the execution, policy version, strategy, samples, and seed 2. creates one controlled Replay for each required sample Replay worker 3. asks the runtime adapter to run each isolated counterfactual 4. saves the produced execution and its bounded outcome artifact Causal Audit worker 5. checks every replay's lineage and scores the outcomes 6. saves one immutable classification and influence result
Do not select the normal Evaluate Replay action for a controlled causal replay. That action belongs to the standard Replay workflow, which performs evaluation and drift comparison against a historical scorecard. Causal Audit already has the outcome artifact it needs, and its own worker finalizes the result instead.
If you want to understand the architecture behind this hand-off before continuing, read Controlled Replay Framework. This tutorial stays focused on the operator steps.
A partial result is not a result
If one required evidence change, replay, or outcome score fails, the audit fails. The platform records safe diagnostics but does not average the successful samples into a misleading influence score.6. Review Result
- Return to Agents Runtime → Causal Audits.
- Open the completed audit.
- Read the classification, original and counterfactual outcome scores, and evidence influence.
- Follow the linked controlled replay IDs to inspect the policy version, intervention digest and produced execution.
Review before acting
A classification is measured evidence for one bounded test. Use it alongside the execution context and the owning runtime team's investigation; do not treat it as an automatic deployment or enforcement decision.What to do next
Read the Causal Audit reference for its safety model and limits. For the broader evidence model, return to Agents Runtime.
