{
  "$schema": "runback.audit/v2",
  "manifest": {
    "run_id": "demo-invoice-0584c5",
    "generated_at": "2026-09-22T11:08:50.019Z",
    "event_count": 4,
    "algorithm": "sha256-chain",
    "content_digest": "8fdbe07be1ab31d0e374744ceb452f9145f594ad15c49fcc126269d9fc1a3997",
    "replay": {
      "cassette_digest": "fa7c1a5ade3b81abb10f18b58a130212a33dbd54264b427a5f0331c5a56fe168",
      "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": "8036839c04446f90bbaa07f3f18b0176956ccbc55a8422866153c1353ddb61568cd0e9d53acf1ac5f6e0543029ae70f4e8c9375eef6021d6fca6b22ba81cd00c",
      "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-invoice-0584c5",
    "name": "billing-agent",
    "status": "success",
    "input": "Charge customer #7734 $120 for the monthly plan.",
    "output": {
      "status": "captured",
      "charged": 120
    },
    "error": null,
    "metadata": {
      "demo": true
    },
    "step_count": 1,
    "total_tokens": 480,
    "started_at": "2026-09-22T00:53:02.326+00:00",
    "ended_at": "2026-09-22T00:53:03.826+00:00",
    "actor_type": null,
    "actor_id": null
  },
  "events": [
    {
      "seq": 0,
      "name": "billing-agent",
      "type": "run",
      "error": null,
      "input": "Charge customer #7734 $120 for the monthly plan.",
      "phase": "start",
      "output": null,
      "run_id": "demo-invoice-0584c5",
      "status": "running",
      "ts_end": "2026-09-22T00:53:03.826Z",
      "span_id": "r",
      "metadata": {
        "demo": true
      },
      "ts_start": "2026-09-22T00:53:02.326Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "1624377b0aa6724524f2c188224cca377dcff6da001cefa3aa07978e97bcf8d1"
    },
    {
      "seq": 1,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "gpt-4o",
        "provider": "openai"
      },
      "usage": {
        "input_tokens": 336,
        "total_tokens": 480,
        "output_tokens": 144
      },
      "run_id": "demo-invoice-0584c5",
      "ts_end": "2026-09-22T00:53:02.946Z",
      "request": {
        "tools": [],
        "params": {
          "temperature": 0
        },
        "system": "You are a careful enterprise agent. Follow policy.",
        "messages": [
          {
            "role": "user",
            "content": "Card on file is valid — charging the monthly amount."
          }
        ]
      },
      "span_id": "l1",
      "response": {
        "text": "Card on file is valid — charging the monthly amount.",
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "amount": 120,
              "customer_id": 7734
            },
            "tool_name": "charge_card",
            "tool_call_id": "t1"
          }
        ],
        "finish_reason": "tool-call"
      },
      "ts_start": "2026-09-22T00:53:02.356Z",
      "latency_ms": 590,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "f56cc2caa212639ba759579385957f1f6652bf18a1fbac1ecad6ca605ee52bc6"
    },
    {
      "seq": 2,
      "type": "tool",
      "error": null,
      "input": {
        "amount": 120,
        "customer_id": 7734
      },
      "output": {
        "receipt": "rc_8812",
        "captured": true
      },
      "run_id": "demo-invoice-0584c5",
      "ts_end": "2026-09-22T00:53:03.226Z",
      "span_id": "t1",
      "ts_start": "2026-09-22T00:53:02.956Z",
      "tool_name": "charge_card",
      "latency_ms": 270,
      "tool_call_id": "t1",
      "parent_span_id": "r",
      "schema_version": 1,
      "policy_evaluated": {
        "passed": true
      },
      "_hash": "d7f8214c883cb3eed3e6174be8026ece1ea3bb7d8134be138c2f3763bd69817d"
    },
    {
      "seq": 3,
      "name": "billing-agent",
      "type": "run",
      "error": null,
      "input": null,
      "phase": "end",
      "output": {
        "status": "captured",
        "charged": 120
      },
      "run_id": "demo-invoice-0584c5",
      "status": "success",
      "ts_end": "2026-09-22T00:53:03.826Z",
      "span_id": "re",
      "metadata": {
        "demo": true
      },
      "ts_start": "2026-09-22T00:53:03.776Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "8fdbe07be1ab31d0e374744ceb452f9145f594ad15c49fcc126269d9fc1a3997"
    }
  ]
}