{
  "$schema": "runback.audit/v2",
  "manifest": {
    "run_id": "demo-contract-5c7e02",
    "generated_at": "2026-09-22T11:05:12.736Z",
    "event_count": 4,
    "algorithm": "sha256-chain",
    "content_digest": "d05fc62c73cb3bf0d503549432147af7d546ef0a0fc1dec0dded7da6536f76be",
    "replay": {
      "cassette_digest": "222458b966bd30cf90aa87d747886536b9b84917f4cabab55fbeea284c0ca997",
      "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": "94427794f5ea4ac508ae8981ad6cb38e4e0eae94c7928da5e17265bf91c9a67e6b1daee6e2455a76dd57b15827a4b5b33c1b67357917ddcbca9f41a068956d06",
      "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-contract-5c7e02",
    "name": "contract-review-agent",
    "status": "success",
    "input": "Flag non-standard indemnity clauses in the Northwind MSA.",
    "output": {
      "flagged": 2,
      "escalated": true
    },
    "error": null,
    "metadata": {
      "demo": true
    },
    "step_count": 1,
    "total_tokens": 480,
    "started_at": "2026-09-22T02:58:21.169+00:00",
    "ended_at": "2026-09-22T02:58:22.669+00:00",
    "actor_type": null,
    "actor_id": null
  },
  "events": [
    {
      "seq": 0,
      "name": "contract-review-agent",
      "type": "run",
      "error": null,
      "input": "Flag non-standard indemnity clauses in the Northwind MSA.",
      "phase": "start",
      "output": null,
      "run_id": "demo-contract-5c7e02",
      "status": "running",
      "ts_end": "2026-09-22T02:58:22.669Z",
      "span_id": "r",
      "metadata": {
        "demo": true
      },
      "ts_start": "2026-09-22T02:58:21.169Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "9ff27b908509e55bef8050440a47299b4170e5336b7d7e5fff1a35af295b7b3a"
    },
    {
      "seq": 1,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "claude-sonnet-4-6",
        "provider": "openai"
      },
      "usage": {
        "input_tokens": 336,
        "total_tokens": 480,
        "output_tokens": 144
      },
      "run_id": "demo-contract-5c7e02",
      "ts_end": "2026-09-22T02:58:21.789Z",
      "request": {
        "tools": [],
        "params": {
          "temperature": 0
        },
        "system": "You are a careful enterprise agent. Follow policy.",
        "messages": [
          {
            "role": "user",
            "content": "Two clauses depart from the template; both flagged for a human."
          }
        ]
      },
      "span_id": "l1",
      "response": {
        "text": "Two clauses depart from the template; both flagged for a human.",
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "doc": "northwind-msa-v3"
            },
            "tool_name": "diff_against_template",
            "tool_call_id": "t1"
          }
        ],
        "finish_reason": "tool-call"
      },
      "ts_start": "2026-09-22T02:58:21.199Z",
      "latency_ms": 590,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "680db2018faf9c74e49d96654e6d63ffc6bb0129b6f595f31d4f94e2b876bf49"
    },
    {
      "seq": 2,
      "type": "tool",
      "error": null,
      "input": {
        "doc": "northwind-msa-v3"
      },
      "output": {
        "severity": "review",
        "deviations": 2
      },
      "run_id": "demo-contract-5c7e02",
      "ts_end": "2026-09-22T02:58:22.069Z",
      "span_id": "t1",
      "ts_start": "2026-09-22T02:58:21.799Z",
      "tool_name": "diff_against_template",
      "latency_ms": 270,
      "tool_call_id": "t1",
      "parent_span_id": "r",
      "schema_version": 1,
      "policy_evaluated": {
        "passed": true
      },
      "_hash": "e62e957e858bd84321a45f9e8d3c2bd79793c3077c7aa4ace05598b68b5e19e3"
    },
    {
      "seq": 3,
      "name": "contract-review-agent",
      "type": "run",
      "error": null,
      "input": null,
      "phase": "end",
      "output": {
        "flagged": 2,
        "escalated": true
      },
      "run_id": "demo-contract-5c7e02",
      "status": "success",
      "ts_end": "2026-09-22T02:58:22.669Z",
      "span_id": "re",
      "metadata": {
        "demo": true
      },
      "ts_start": "2026-09-22T02:58:22.619Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "d05fc62c73cb3bf0d503549432147af7d546ef0a0fc1dec0dded7da6536f76be"
    }
  ]
}