{
  "$schema": "runback.audit/v2",
  "manifest": {
    "run_id": "demo-invoice-9bf924",
    "generated_at": "2026-09-22T11:06:04.711Z",
    "event_count": 4,
    "algorithm": "sha256-chain",
    "content_digest": "6fe3dc5dda93b0e6376e6974bb1e3b0b6605fc412340068561eac692380396fe",
    "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": "6995600dcf3f0500ffbbe72775eb274d03cdb4173f763203ae7239bc0bd0d037cdb2bcab1a26ddb28fb881cf75782e0a00db88491b0b36e461ec012695379201",
      "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-9bf924",
    "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:56:35.082+00:00",
    "ended_at": "2026-09-22T00:56:36.582+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-9bf924",
      "status": "running",
      "ts_end": "2026-09-22T00:56:36.582Z",
      "span_id": "r",
      "metadata": {
        "demo": true
      },
      "ts_start": "2026-09-22T00:56:35.082Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "2735fef82c226c978ccdf94aa7ced793ec31c8f197bad32780734ef816b1ff80"
    },
    {
      "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-9bf924",
      "ts_end": "2026-09-22T00:56:35.702Z",
      "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:56:35.112Z",
      "latency_ms": 590,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "d31a30e8eb19b1adf0c5200f9153b5dc9e154bba0659e4456fd0b6a2c8818467"
    },
    {
      "seq": 2,
      "type": "tool",
      "error": null,
      "input": {
        "amount": 120,
        "customer_id": 7734
      },
      "output": {
        "receipt": "rc_8812",
        "captured": true
      },
      "run_id": "demo-invoice-9bf924",
      "ts_end": "2026-09-22T00:56:35.982Z",
      "span_id": "t1",
      "ts_start": "2026-09-22T00:56:35.712Z",
      "tool_name": "charge_card",
      "latency_ms": 270,
      "tool_call_id": "t1",
      "parent_span_id": "r",
      "schema_version": 1,
      "policy_evaluated": {
        "passed": true
      },
      "_hash": "68d2336807baa029783334d6a864fd73245a6f1cc6c49a79ec70d9aecd5c4b2a"
    },
    {
      "seq": 3,
      "name": "billing-agent",
      "type": "run",
      "error": null,
      "input": null,
      "phase": "end",
      "output": {
        "status": "captured",
        "charged": 120
      },
      "run_id": "demo-invoice-9bf924",
      "status": "success",
      "ts_end": "2026-09-22T00:56:36.582Z",
      "span_id": "re",
      "metadata": {
        "demo": true
      },
      "ts_start": "2026-09-22T00:56:36.532Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "6fe3dc5dda93b0e6376e6974bb1e3b0b6605fc412340068561eac692380396fe"
    }
  ]
}