{
  "$schema": "runback.audit/v2",
  "manifest": {
    "run_id": "sample-0f1f88f2-a269-4929-ad0b-eaa39d8134fa",
    "generated_at": "2026-11-07T07:43:52.518Z",
    "event_count": 4,
    "algorithm": "sha256-chain",
    "content_digest": "e8b546afbaa92510316abd402fbde33a1e68cd49b22047c6481911ef91a3714f",
    "replay": {
      "cassette_digest": "6353d73d62465c366044db802c812eb4be11b591da0c325ce724b844fd3e70c1",
      "entry_count": 3,
      "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": "fcd5f19917c78f70c2bf59f6084c8c30ff5d12192a092fd8d60e72b49501b02eb1a5d2feaa292cbc04940c21f6f1800d62159479e667e487e6ad77bab50ae407",
      "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": "sample-0f1f88f2-a269-4929-ad0b-eaa39d8134fa",
    "name": "runback-sample-agent",
    "status": "success",
    "input": "Sample run — Customer asks for a refund on order #4471, outside the 30-day window.",
    "output": "Escalated to human approval — outside the refund window.",
    "error": null,
    "metadata": {
      "demo": true,
      "note": "Generated by Runback so you have something to look at. Not a record of your agents.",
      "scenario": "refund-escalated",
      "runback:sample-run": true
    },
    "step_count": 1,
    "total_tokens": 1460,
    "started_at": "2026-11-06T12:50:22.833+00:00",
    "ended_at": "2026-11-06T12:50:27.033+00:00",
    "actor_type": null,
    "actor_id": null
  },
  "events": [
    {
      "seq": 0,
      "name": "runback-sample-agent",
      "type": "run",
      "error": null,
      "input": "Sample run — Customer asks for a refund on order #4471, outside the 30-day window.",
      "phase": "start",
      "output": null,
      "run_id": "sample-0f1f88f2-a269-4929-ad0b-eaa39d8134fa",
      "status": "running",
      "ts_end": null,
      "span_id": "r0",
      "metadata": {
        "demo": true,
        "note": "Generated by Runback so you have something to look at. Not a record of your agents.",
        "scenario": "refund-escalated",
        "runback:sample-run": true
      },
      "ts_start": "2026-11-06T12:50:22.833Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "8c89aced6cf853b5e066015c7a7be284469709085a1737fb909cd0ac47fcd6da"
    },
    {
      "seq": 1,
      "type": "tool",
      "error": null,
      "input": {
        "order_id": "4471"
      },
      "output": {
        "status": "delivered",
        "order_id": "4471",
        "placed_at": "2026-07-02",
        "total_aud": 249,
        "days_since_purchase": 54
      },
      "run_id": "sample-0f1f88f2-a269-4929-ad0b-eaa39d8134fa",
      "ts_end": "2026-11-06T12:50:23.589Z",
      "span_id": "t1",
      "metadata": {
        "demo": true,
        "note": "Generated by Runback so you have something to look at. Not a record of your agents.",
        "scenario": "refund-escalated",
        "runback:sample-run": true
      },
      "ts_start": "2026-11-06T12:50:23.253Z",
      "tool_name": "lookup_order",
      "tool_call_id": "call_1",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "c904e0012a4eac1fe0406801a194a3f74c8a0b8dd81126ad8f6d49c2ed913b30"
    },
    {
      "seq": 2,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "gpt-4o",
        "provider": "openai"
      },
      "usage": {
        "input_tokens": 1168,
        "total_tokens": 1460,
        "output_tokens": 292
      },
      "run_id": "sample-0f1f88f2-a269-4929-ad0b-eaa39d8134fa",
      "ts_end": "2026-11-06T12:50:25.437Z",
      "request": {
        "tools": [],
        "params": {
          "temperature": 0,
          "max_output_tokens": 300
        },
        "system": "You are a support agent. Refunds outside 30 days require human approval.",
        "messages": [
          {
            "role": "user",
            "content": "Customer wants a refund on order #4471. It was delivered 54 days ago."
          },
          {
            "role": "assistant",
            "content": "Calling lookup_order."
          },
          {
            "role": "user",
            "content": "{\"order_id\":\"4471\",\"total_aud\":249,\"placed_at\":\"2026-07-02\",\"days_since_purchase\":54,\"status\":\"delivered\"}"
          }
        ]
      },
      "span_id": "l1",
      "metadata": {
        "demo": true,
        "note": "Generated by Runback so you have something to look at. Not a record of your agents.",
        "scenario": "refund-escalated",
        "runback:sample-run": true
      },
      "response": {
        "text": "This purchase is 54 days old, outside the 30-day refund window, and the amount (A$249.00) is above the threshold I can approve. Routing to a human for approval rather than declining outright.",
        "reasoning": null,
        "tool_calls": [],
        "finish_reason": "stop"
      },
      "ts_start": "2026-11-06T12:50:23.673Z",
      "latency_ms": 1764,
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "d4ddb24d204c0b044207f2a85f4d468d1f8c4a32ca72d646a0223e6a4ff5900c"
    },
    {
      "seq": 3,
      "type": "tool",
      "error": null,
      "input": {
        "reason": "outside_refund_window",
        "order_id": "4471",
        "amount_aud": 249
      },
      "output": {
        "queued": true,
        "approval_id": "apr_sample"
      },
      "run_id": "sample-0f1f88f2-a269-4929-ad0b-eaa39d8134fa",
      "ts_end": "2026-11-06T12:50:25.773Z",
      "span_id": "t2",
      "metadata": {
        "demo": true,
        "note": "Generated by Runback so you have something to look at. Not a record of your agents.",
        "scenario": "refund-escalated",
        "runback:sample-run": true
      },
      "ts_start": "2026-11-06T12:50:25.563Z",
      "tool_name": "request_human_approval",
      "tool_call_id": "call_2",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "e8b546afbaa92510316abd402fbde33a1e68cd49b22047c6481911ef91a3714f"
    }
  ]
}