{
  "$schema": "runback.audit/v2",
  "manifest": {
    "run_id": "demo-refund-9bf924",
    "generated_at": "2026-09-22T11:05:40.810Z",
    "event_count": 6,
    "algorithm": "sha256-chain",
    "content_digest": "331e8d6fb41951e3cf118bbab368af57ced4c16452d7c71634886c90bea69213",
    "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": "008e17fb406a1197c6c31cd166e8177d98f8c3400ab331053cc14319693eeb51cc38a45023419cb5de0409eae36645d5c5e8e5efe1124dc10429bac04d79940e",
      "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-9bf924",
    "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-21T22:51:35.082+00:00",
    "ended_at": "2026-09-21T22:51:37.282+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-9bf924",
      "status": "running",
      "ts_end": "2026-09-21T22:51:37.282Z",
      "span_id": "r",
      "metadata": {
        "demo": true
      },
      "ts_start": "2026-09-21T22:51:35.082Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "30fdb1cd05fb2593c27a60b52ed4cdef6c7a5dfa1018ff17ba407d890750fed0"
    },
    {
      "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-9bf924",
      "ts_end": "2026-09-21T22:51:35.782Z",
      "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-21T22:51:35.122Z",
      "latency_ms": 660,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "c125ceab013b523180527568e17f8cbb26819eb200f4912c23efeb08f8a7da2f"
    },
    {
      "seq": 2,
      "type": "tool",
      "error": null,
      "input": {
        "customer_id": 8842
      },
      "output": {
        "tier": "gold",
        "email": "[redacted:email]"
      },
      "run_id": "demo-refund-9bf924",
      "ts_end": "2026-09-21T22:51:35.935Z",
      "span_id": "t1",
      "ts_start": "2026-09-21T22:51:35.792Z",
      "tool_name": "lookup_customer",
      "latency_ms": 143,
      "tool_call_id": "t1",
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "ba77953cd714217726d874ac3c31e8d201cb9cba82465939664334d28215cc44"
    },
    {
      "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-9bf924",
      "ts_end": "2026-09-21T22:51:36.782Z",
      "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-21T22:51:35.982Z",
      "latency_ms": 800,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "6d69cafcfe970eca80afc5dd6d2944b43b9c2912d17ee3b85dec2ca9e8c75317"
    },
    {
      "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-9bf924",
      "ts_end": "2026-09-21T22:51:36.842Z",
      "span_id": "t2",
      "ts_start": "2026-09-21T22:51:36.792Z",
      "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": "bee130a22b721d471fe3e892cc92fb6ab19a25eae8cda54c2bd090f9ae4b669d"
    },
    {
      "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-9bf924",
      "status": "error",
      "ts_end": "2026-09-21T22:51:37.282Z",
      "span_id": "re",
      "metadata": {
        "demo": true,
        "redaction_count": 1,
        "redaction_by_type": {
          "email": 1
        }
      },
      "ts_start": "2026-09-21T22:51:36.882Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "331e8d6fb41951e3cf118bbab368af57ced4c16452d7c71634886c90bea69213"
    }
  ]
}