{
  "$schema": "runback.audit/v2",
  "manifest": {
    "run_id": "demo-refund-6aa01e",
    "generated_at": "2026-09-22T11:05:46.193Z",
    "event_count": 6,
    "algorithm": "sha256-chain",
    "content_digest": "fecc1f94d8527a664bef76c683a35b7a2e1c8dc7099befa84b8b2cfbd7751fa2",
    "replay": {
      "cassette_digest": "9b75012733f72833b20a26bcb639f671e610d192c0f0e611bf0a3b481bd4e553",
      "entry_count": 4,
      "algorithm": "oracle-chain/sha256",
      "note": "The run's oracle stream — every model response and tool output, hash-chained. Re-execute the agent against `events` with @runback/replay and the cassette digest must reproduce. This is proof the recording IS the deterministic input stream of the run — an audit you can re-run, not just read."
    },
    "signed": true,
    "signature": {
      "alg": "Ed25519",
      "value": "3f0b95bf0817052291114610a966e76545050e58601a7db0fddcb81d2ef1b1189b098829bda48464712dd9bc9765a8e93157534d77caa6cd16f5d1f85daeee02",
      "pubkey": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEArDPmR+Gvu1HawnSvM6xjZao7BVPPQ80Qq3sa1hAYvDU=\n-----END PUBLIC KEY-----\n"
    },
    "verify": "Recompute the event chain h_i = SHA-256(h_{i-1} + canonical(event_i)) over `events` → must equal content_digest. Recompute the oracle-stream digest from `events` → must equal replay.cassette_digest. The signature covers `${content_digest}:${cassette_digest}`. Ed25519: verify with the public key embedded in manifest.signature.pubkey (no server key needed — fully offline-verifiable). HMAC-SHA256 (legacy): requires AUDIT_SIGNING_KEY. POST this record to /api/audit/verify.",
    "spec_url": "https://runback.dev/spec",
    "verifier_url": "https://runback.dev/verify"
  },
  "run": {
    "run_id": "demo-refund-6aa01e",
    "name": "support-refund-agent",
    "status": "error",
    "input": "Customer #8842 disputes a $250 charge and wants a refund.",
    "output": {
      "resolved": false
    },
    "error": {
      "name": "PolicyGateError",
      "message": "issue_refund blocked: $250 on a disputed charge breaks policy."
    },
    "metadata": {
      "demo": true
    },
    "step_count": 2,
    "total_tokens": 1030,
    "started_at": "2026-09-01T21:17:27.297+00:00",
    "ended_at": "2026-09-01T21:17:29.497+00:00",
    "actor_type": null,
    "actor_id": null
  },
  "events": [
    {
      "seq": 0,
      "name": "support-refund-agent",
      "type": "run",
      "error": null,
      "input": "Customer #8842 disputes a $250 charge and wants a refund.",
      "phase": "start",
      "output": null,
      "run_id": "demo-refund-6aa01e",
      "status": "running",
      "ts_end": "2026-09-01T21:17:29.497Z",
      "span_id": "r",
      "metadata": {
        "demo": true
      },
      "ts_start": "2026-09-01T21:17:27.297Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "22d1458b9d93311643ab55d41077c32f439574622081cba7fdbd211a40a718bc"
    },
    {
      "seq": 1,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "gpt-4o",
        "provider": "openai"
      },
      "usage": {
        "input_tokens": 428,
        "total_tokens": 612,
        "output_tokens": 184
      },
      "run_id": "demo-refund-6aa01e",
      "ts_end": "2026-09-01T21:17:27.997Z",
      "request": {
        "tools": [],
        "params": {
          "temperature": 0
        },
        "system": "You are a careful enterprise agent. Follow policy.",
        "messages": [
          {
            "role": "user",
            "content": "Looking up the customer before deciding."
          }
        ]
      },
      "span_id": "l1",
      "response": {
        "text": "Looking up the customer before deciding.",
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "customer_id": 8842
            },
            "tool_name": "lookup_customer",
            "tool_call_id": "t1"
          }
        ],
        "finish_reason": "tool-call"
      },
      "ts_start": "2026-09-01T21:17:27.337Z",
      "latency_ms": 660,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "d6fcbb8d660c188ad23e36291f1b343873ef420b094d5c1a7eff226109a0ec6d"
    },
    {
      "seq": 2,
      "type": "tool",
      "error": null,
      "input": {
        "customer_id": 8842
      },
      "output": {
        "tier": "gold",
        "email": "[redacted:email]"
      },
      "run_id": "demo-refund-6aa01e",
      "ts_end": "2026-09-01T21:17:28.150Z",
      "span_id": "t1",
      "ts_start": "2026-09-01T21:17:28.007Z",
      "tool_name": "lookup_customer",
      "latency_ms": 143,
      "tool_call_id": "t1",
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "5672396efdae6007c57838d9b46e1375d23795de3e87a8824e2fe29f095f1856"
    },
    {
      "seq": 3,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "gpt-4o",
        "provider": "openai"
      },
      "usage": {
        "input_tokens": 293,
        "total_tokens": 418,
        "output_tokens": 125
      },
      "run_id": "demo-refund-6aa01e",
      "ts_end": "2026-09-01T21:17:28.997Z",
      "request": {
        "tools": [],
        "params": {
          "temperature": 0
        },
        "system": "You are a careful enterprise agent. Follow policy.",
        "messages": [
          {
            "role": "user",
            "content": "Customer #8842 disputed a $250 charge and is requesting a refund. They are gold tier. Decide the action."
          }
        ]
      },
      "span_id": "l2",
      "response": {
        "text": "Gold tier — issuing the $250 refund.",
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "amount": 250,
              "customer_id": 8842
            },
            "tool_name": "issue_refund",
            "tool_call_id": "t2"
          }
        ],
        "finish_reason": "tool-call"
      },
      "ts_start": "2026-09-01T21:17:28.197Z",
      "latency_ms": 800,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "026de6645abfe71fe5ccff0f5c99505390f4a13afdbbffc17aee1ddc89e0552d"
    },
    {
      "seq": 4,
      "type": "tool",
      "error": {
        "name": "PolicyBlock",
        "message": "Blocked: $250 refund on a disputed charge without escalation."
      },
      "input": {
        "amount": 250,
        "customer_id": 8842
      },
      "output": null,
      "run_id": "demo-refund-6aa01e",
      "ts_end": "2026-09-01T21:17:29.057Z",
      "span_id": "t2",
      "ts_start": "2026-09-01T21:17:29.007Z",
      "tool_name": "issue_refund",
      "latency_ms": 50,
      "policy_block": {
        "rule": "escalate-large-disputed",
        "detail": "when issue_refund.amount gt 100 and input matches /disputed/ → must call escalate_to_human — violated"
      },
      "tool_call_id": "t2",
      "parent_span_id": "r",
      "schema_version": 1,
      "policy_evaluated": {
        "passed": false
      },
      "_hash": "8b8747a8214617da061739a3f36c18644eac6b0b7620a8a63c6a403523a337ad"
    },
    {
      "seq": 5,
      "name": "support-refund-agent",
      "type": "run",
      "error": {
        "name": "PolicyGateError",
        "message": "issue_refund blocked: $250 on a disputed charge breaks policy."
      },
      "input": null,
      "phase": "end",
      "output": {
        "resolved": false
      },
      "run_id": "demo-refund-6aa01e",
      "status": "error",
      "ts_end": "2026-09-01T21:17:29.497Z",
      "span_id": "re",
      "metadata": {
        "demo": true,
        "redaction_count": 1,
        "redaction_by_type": {
          "email": 1
        }
      },
      "ts_start": "2026-09-01T21:17:29.097Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "fecc1f94d8527a664bef76c683a35b7a2e1c8dc7099befa84b8b2cfbd7751fa2"
    }
  ]
}