{
  "$schema": "runback.audit/v2",
  "manifest": {
    "run_id": "demo-charge-error-6a5225",
    "generated_at": "2026-09-22T11:06:07.013Z",
    "event_count": 4,
    "algorithm": "sha256-chain",
    "content_digest": "37bcb2e36641f2288aa4b60dbe247f66a63f5e7b39038472c473d2030b99b2d8",
    "replay": {
      "cassette_digest": "890d720b07aa161cd8976bd7d7b30c4481754c53db0220efc19556313e8b07d3",
      "entry_count": 2,
      "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": "9aa20244b250049525f1a039248ff3c5345319e3a381c45fc9d0087beca7dc0fb20b104fb9e7a88f2e788541bad4bc4ef302d58cd237d73f0011bffff50bb50e",
      "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-charge-error-6a5225",
    "name": "billing-agent",
    "status": "error",
    "input": "Charge customer #6631 $89 for the overdue invoice.",
    "output": null,
    "error": {
      "name": "ToolError",
      "message": "charge_card failed: CardDeclined"
    },
    "metadata": {
      "demo": true
    },
    "step_count": 1,
    "total_tokens": 340,
    "started_at": "2026-09-14T02:22:50.173+00:00",
    "ended_at": "2026-09-14T02:22:51.973+00:00",
    "actor_type": null,
    "actor_id": null
  },
  "events": [
    {
      "seq": 0,
      "name": "billing-agent",
      "type": "run",
      "error": null,
      "input": "Charge customer #6631 $89 for the overdue invoice.",
      "phase": "start",
      "output": null,
      "run_id": "demo-charge-error-6a5225",
      "status": "running",
      "ts_end": "2026-09-14T02:22:51.973Z",
      "span_id": "r",
      "metadata": {
        "demo": true
      },
      "ts_start": "2026-09-14T02:22:50.173Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "8e1ed1a837d2b94f267d79f2d250ffedcb07e89b657d7e922b0988688ea476b7"
    },
    {
      "seq": 1,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "gpt-4o",
        "provider": "openai"
      },
      "usage": {
        "input_tokens": 238,
        "total_tokens": 340,
        "output_tokens": 102
      },
      "run_id": "demo-charge-error-6a5225",
      "ts_end": "2026-09-14T02:22:50.873Z",
      "request": {
        "tools": [],
        "params": {
          "temperature": 0
        },
        "system": "You are a careful enterprise agent. Follow policy.",
        "messages": [
          {
            "role": "user",
            "content": "Charging the card on file."
          }
        ]
      },
      "span_id": "l1",
      "response": {
        "text": "Charging the card on file.",
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "amount": 89,
              "customer_id": 6631
            },
            "tool_name": "charge_card",
            "tool_call_id": "t1"
          }
        ],
        "finish_reason": "tool-call"
      },
      "ts_start": "2026-09-14T02:22:50.203Z",
      "latency_ms": 670,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "914a726ad2e890ea755fcbfd318850b945dd695dfc61d2089d2b19a56d83fb79"
    },
    {
      "seq": 2,
      "type": "tool",
      "error": {
        "name": "CardDeclined",
        "message": "Card declined by issuer — insufficient funds."
      },
      "input": {
        "amount": 89,
        "customer_id": 6631
      },
      "output": null,
      "run_id": "demo-charge-error-6a5225",
      "ts_end": "2026-09-14T02:22:51.573Z",
      "span_id": "t1",
      "ts_start": "2026-09-14T02:22:50.883Z",
      "tool_name": "charge_card",
      "latency_ms": 690,
      "tool_call_id": "t1",
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "571f303b5fba2337aca56a4cf8006f6697e367705140e86ce20921fd26b8c270"
    },
    {
      "seq": 3,
      "name": "billing-agent",
      "type": "run",
      "error": {
        "name": "ToolError",
        "message": "charge_card failed: CardDeclined"
      },
      "input": null,
      "phase": "end",
      "output": null,
      "run_id": "demo-charge-error-6a5225",
      "status": "error",
      "ts_end": "2026-09-14T02:22:51.973Z",
      "span_id": "re",
      "metadata": {
        "demo": true
      },
      "ts_start": "2026-09-14T02:22:51.923Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "37bcb2e36641f2288aa4b60dbe247f66a63f5e7b39038472c473d2030b99b2d8"
    }
  ]
}