{
  "$schema": "runback.audit/v2",
  "manifest": {
    "run_id": "demo-research-agent",
    "generated_at": "2026-06-20T14:49:42.802Z",
    "event_count": 6,
    "algorithm": "sha256-chain",
    "content_digest": "9dd93108e22c1b2afbed468b88119b3f2ef93e5ef67cd862fddedaf710e3d17c",
    "replay": {
      "cassette_digest": "f6c30057e09edaec0e600775e1903bbba0727961226990a6099ef431f45a19cf",
      "entry_count": 4,
      "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": "HMAC-SHA256",
      "value": "0cbb9bab93506c3af17e62cf525685a356d825cbcbc1e1db52f975f16e23252d"
    },
    "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 HMAC signature covers `${content_digest}:${cassette_digest}`. POST this record to /api/audit/verify."
  },
  "run": {
    "run_id": "demo-research-agent",
    "name": "research-email-agent",
    "status": "error",
    "input": "Research Next.js 16 and email a 3-sentence summary to alex[at]acme.co",
    "output": null,
    "error": {
      "name": "ToolError",
      "message": "send_email failed: invalid recipient."
    },
    "metadata": {
      "seed": "demo-v1",
      "scenario": "bad tool input"
    },
    "step_count": 2,
    "total_tokens": 1654,
    "started_at": "2026-06-19T03:00:00+00:00",
    "ended_at": "2026-06-19T03:00:01.5+00:00"
  },
  "events": [
    {
      "seq": 0,
      "name": "research-email-agent",
      "type": "run",
      "error": null,
      "input": "Research Next.js 16 and email a 3-sentence summary to alex[at]acme.co",
      "phase": "start",
      "output": null,
      "status": "running",
      "ts_end": "2026-06-19T03:00:01.500Z",
      "span_id": "r",
      "metadata": {
        "seed": "demo-v1"
      },
      "ts_start": "2026-06-19T03:00:00.000Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "928393747ba0c7459787b7a6455da6666b8b7bef10f88714cc99ef0be53f48c5"
    },
    {
      "seq": 1,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "llama-3.3-70b-versatile",
        "provider": "groq"
      },
      "usage": {
        "input_tokens": 712,
        "total_tokens": 740,
        "output_tokens": 28
      },
      "ts_end": "2026-06-19T03:00:00.440Z",
      "request": {
        "tools": [
          {
            "name": "web_search",
            "parameters": {}
          },
          {
            "name": "send_email",
            "parameters": {}
          }
        ],
        "params": {
          "temperature": 0.7
        },
        "system": "Research the topic, then email a 3-sentence summary to the address in the task.",
        "messages": [
          {
            "role": "user",
            "content": "Research Next.js 16 and email a summary to alex[at]acme.co"
          }
        ]
      },
      "span_id": "l1",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "query": "Next.js 16 release notes"
            },
            "tool_name": "web_search",
            "tool_call_id": "c1"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-06-19T03:00:00.020Z",
      "latency_ms": 420,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "acc7b80a2e96d10e93f7dadb03e75a7275d59049994571c5d662ae7e843d7dea"
    },
    {
      "seq": 2,
      "type": "tool",
      "error": null,
      "input": {
        "query": "Next.js 16 release notes"
      },
      "output": {
        "results": [
          {
            "url": "https://nextjs.org/blog/next-16",
            "title": "Next.js 16"
          }
        ]
      },
      "ts_end": "2026-06-19T03:00:00.465Z",
      "span_id": "t1",
      "ts_start": "2026-06-19T03:00:00.450Z",
      "tool_name": "web_search",
      "latency_ms": 15,
      "tool_call_id": "c1",
      "parent_span_id": "l1",
      "schema_version": 1,
      "_hash": "a871586a3fadacfa9ea31f87c4ce98917c781101e0d7f51ac4214c30d081e3ae"
    },
    {
      "seq": 3,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "llama-3.3-70b-versatile",
        "provider": "groq"
      },
      "usage": {
        "input_tokens": 880,
        "total_tokens": 914,
        "output_tokens": 34
      },
      "ts_end": "2026-06-19T03:00:01.300Z",
      "request": {
        "tools": [
          {
            "name": "send_email",
            "parameters": {}
          }
        ],
        "params": {
          "temperature": 0.7
        },
        "system": "Research the topic, then email a 3-sentence summary to the address in the task.",
        "messages": [
          {
            "role": "user",
            "content": "Research Next.js 16 and email a summary to alex[at]acme.co"
          },
          {
            "role": "tool",
            "content": "web_search → 1 result (nextjs.org/blog/next-16)"
          }
        ]
      },
      "span_id": "l2",
      "response": {
        "text": "Summary ready, sending the email.",
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "to": "alex[at]acme.co",
              "subject": "Next.js 16"
            },
            "tool_name": "send_email",
            "tool_call_id": "c2"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-06-19T03:00:00.480Z",
      "latency_ms": 820,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "10d112acad5aed88f53301d0c935f84388eeb193e348c0a7f7ef266b0bac8196"
    },
    {
      "seq": 4,
      "type": "tool",
      "error": {
        "name": "ToolError",
        "message": "Invalid recipient — \"alex[at]acme.co\" is not a valid email address. The model wrote \"[at]\" as plain text."
      },
      "input": {
        "to": "alex[at]acme.co",
        "subject": "Next.js 16"
      },
      "output": null,
      "ts_end": "2026-06-19T03:00:01.360Z",
      "span_id": "t2",
      "ts_start": "2026-06-19T03:00:01.310Z",
      "tool_name": "send_email",
      "latency_ms": 50,
      "tool_call_id": "c2",
      "parent_span_id": "l2",
      "schema_version": 1,
      "_hash": "36dfad66d9fc8ae600975f2d2de647c88ca2a9d608d6375a436ae2aea07d055b"
    },
    {
      "seq": 5,
      "name": "research-email-agent",
      "type": "run",
      "error": {
        "name": "ToolError",
        "message": "send_email failed: invalid recipient."
      },
      "input": null,
      "phase": "end",
      "output": null,
      "status": "error",
      "ts_end": "2026-06-19T03:00:01.500Z",
      "span_id": "re",
      "metadata": {},
      "ts_start": "2026-06-19T03:00:01.400Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "9dd93108e22c1b2afbed468b88119b3f2ef93e5ef67cd862fddedaf710e3d17c"
    }
  ]
}