{
  "$schema": "runback.audit/v2",
  "manifest": {
    "run_id": "demo-charge-error-e8e1b5",
    "generated_at": "2026-09-22T11:04:37.217Z",
    "event_count": 4,
    "algorithm": "sha256-chain",
    "content_digest": "e04b1d060f69d146adc52599af0ae359d9c3aea0e94c9ef0cbfc3b321a95eebd",
    "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": "0604c6a4335cb53ce755a19df63730038f36965e0d12c52513ec7fc8bf08bf40f6a3b83ac8ad1824ea3309f142dd7d3e0950fce50acaa9d9221d18c1fed5fb02",
      "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-e8e1b5",
    "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:35:56.592+00:00",
    "ended_at": "2026-09-14T02:35:58.392+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-e8e1b5",
      "status": "running",
      "ts_end": "2026-09-14T02:35:58.392Z",
      "span_id": "r",
      "metadata": {
        "demo": true
      },
      "ts_start": "2026-09-14T02:35:56.592Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "aa07a980c3468f587364882a3fe46a74c34e3ef16276558488e162bd22f8c275"
    },
    {
      "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-e8e1b5",
      "ts_end": "2026-09-14T02:35:57.292Z",
      "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:35:56.622Z",
      "latency_ms": 670,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "9c4912b666407003fd819ecafa2092b6a0dbd1beb55a3820ed045277827429ae"
    },
    {
      "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-e8e1b5",
      "ts_end": "2026-09-14T02:35:57.992Z",
      "span_id": "t1",
      "ts_start": "2026-09-14T02:35:57.302Z",
      "tool_name": "charge_card",
      "latency_ms": 690,
      "tool_call_id": "t1",
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "39fb4b220a6b502de65e94595d479ab0e2d0770c9f45f4da94e1de1431f6c6c7"
    },
    {
      "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-e8e1b5",
      "status": "error",
      "ts_end": "2026-09-14T02:35:58.392Z",
      "span_id": "re",
      "metadata": {
        "demo": true
      },
      "ts_start": "2026-09-14T02:35:58.342Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "e04b1d060f69d146adc52599af0ae359d9c3aea0e94c9ef0cbfc3b321a95eebd"
    }
  ]
}