{
  "$schema": "runback.audit/v2",
  "manifest": {
    "run_id": "demo-contract-ok-0937e4",
    "generated_at": "2026-09-22T11:11:02.161Z",
    "event_count": 4,
    "algorithm": "sha256-chain",
    "content_digest": "6b6f76210e4e8ba4495c642615dd8ad7cc165c07e17387fda7b8b4157f39f614",
    "replay": {
      "cassette_digest": "8d3824f9c83f55b1db292d5acf8f72fb1c242d83246b82efb653f46339885004",
      "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": "96d20da6f17f4e9f007ec9145eb06efcfe7819aaf9c82fd6381d8eefceb03274f547d37e678b1ef2e4c86483f563abc5bed9d89e9acfe6d158489b295b33ab0d",
      "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-ok-0937e4",
    "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": 680,
    "started_at": "2026-09-14T03:27:54.133+00:00",
    "ended_at": "2026-09-14T03:27:55.633+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-ok-0937e4",
      "status": "running",
      "ts_end": "2026-09-14T03:27:55.633Z",
      "span_id": "r",
      "metadata": {
        "demo": true
      },
      "ts_start": "2026-09-14T03:27:54.133Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "752527ca18e74a1ced82151554a6118aa122d0920e0c54057c69ddc120094291"
    },
    {
      "seq": 1,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "claude-sonnet-4-6",
        "provider": "openai"
      },
      "usage": {
        "input_tokens": 476,
        "total_tokens": 680,
        "output_tokens": 204
      },
      "run_id": "demo-contract-ok-0937e4",
      "ts_end": "2026-09-14T03:27:54.753Z",
      "request": {
        "tools": [],
        "params": {
          "temperature": 0
        },
        "system": "You are a careful enterprise agent. Follow policy.",
        "messages": [
          {
            "role": "user",
            "content": "Flag non-standard indemnity clauses in the Northwind MSA."
          }
        ]
      },
      "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-14T03:27:54.163Z",
      "latency_ms": 590,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "fff47079804760a0d7e7c859a553dd81b873e3f7e4338f4c8a2706c0da0c8e14"
    },
    {
      "seq": 2,
      "type": "tool",
      "error": null,
      "input": {
        "doc": "northwind-msa-v3"
      },
      "output": {
        "severity": "review",
        "deviations": 2
      },
      "run_id": "demo-contract-ok-0937e4",
      "ts_end": "2026-09-14T03:27:55.033Z",
      "span_id": "t1",
      "ts_start": "2026-09-14T03:27:54.763Z",
      "tool_name": "diff_against_template",
      "latency_ms": 270,
      "tool_call_id": "t1",
      "parent_span_id": "r",
      "schema_version": 1,
      "policy_evaluated": {
        "passed": true
      },
      "_hash": "6210ff7373b638b10d17d6fa6cb9a0dfafa44da2151a08f345a334259f50044b"
    },
    {
      "seq": 3,
      "name": "contract-review-agent",
      "type": "run",
      "error": null,
      "input": null,
      "phase": "end",
      "output": {
        "flagged": 2,
        "escalated": true
      },
      "run_id": "demo-contract-ok-0937e4",
      "status": "success",
      "ts_end": "2026-09-14T03:27:55.633Z",
      "span_id": "re",
      "metadata": {
        "demo": true
      },
      "ts_start": "2026-09-14T03:27:55.583Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "6b6f76210e4e8ba4495c642615dd8ad7cc165c07e17387fda7b8b4157f39f614"
    }
  ]
}