{
  "$schema": "runback.audit/v2",
  "manifest": {
    "run_id": "sbx-contract-review-f83281a3a3ca",
    "generated_at": "2026-11-07T07:28:29.015Z",
    "event_count": 9,
    "algorithm": "sha256-chain",
    "content_digest": "7deccc6964f488ecd36774ea2f3b3281e60dc686d7eb177d268659ee6048a114",
    "replay": {
      "cassette_digest": "5537084320806c36821dfb24116465f0e913e9eed84ca7ec0a90b9de87beb4b7",
      "entry_count": 7,
      "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": "389a9c5efb8f8afcc4084131d628a2c30f34e6ad07cf742c084fa24306876aeaa3b0318bff9ebd716ceca81b9be05b8f6aad258c47f5e828654fb4f2585ae50e",
      "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": "sbx-contract-review-f83281a3a3ca",
    "name": "contract-review-agent",
    "status": "success",
    "input": "Review Wattle Sandbox Pty Ltd's supplier agreement (MSA-7201) before signature.",
    "output": {
      "summary": "I've reviewed Wattle Sandbox Pty Ltd's MSA-7201 and flagged three deviations: a low-severity payment term issue, a high-severity liability cap that's dangerously inadequate, and a medium-severity auto-renewal clause with an onerous 180-day cancellation notice requirement."
    },
    "error": null,
    "metadata": {
      "agent": {
        "description": "Flags risky clauses in supplier contracts. Runback demo agent: real model calls and real policy decisions; its tools act on a sandbox of synthetic customers, orders and accounts.",
        "systemOfRecord": "Runback demo sandbox (synthetic data)"
      },
      "model": "claude-haiku-4-5",
      "demo_agent": true,
      "est_cost_usd": 0.006377,
      "sandbox_tools": true,
      "scenario_seed": "contract-review-agent:2026-11-07:30"
    },
    "step_count": 3,
    "total_tokens": 4109,
    "started_at": "2026-11-07T05:11:01.489+00:00",
    "ended_at": "2026-11-07T05:11:07.439+00:00",
    "actor_type": null,
    "actor_id": null
  },
  "events": [
    {
      "seq": 0,
      "name": "contract-review-agent",
      "type": "run",
      "error": null,
      "input": "Review Wattle Sandbox Pty Ltd's supplier agreement (MSA-7201) before signature.",
      "phase": "start",
      "output": null,
      "run_id": "sbx-contract-review-f83281a3a3ca",
      "status": "running",
      "ts_end": "2026-11-07T05:11:07.439Z",
      "span_id": "r",
      "metadata": {
        "agent": {
          "description": "Flags risky clauses in supplier contracts. Runback demo agent: real model calls and real policy decisions; its tools act on a sandbox of synthetic customers, orders and accounts.",
          "systemOfRecord": "Runback demo sandbox (synthetic data)"
        },
        "model": "claude-haiku-4-5",
        "demo_agent": true,
        "est_cost_usd": 0.006377,
        "sandbox_tools": true,
        "scenario_seed": "contract-review-agent:2026-11-07:30"
      },
      "ts_start": "2026-11-07T05:11:01.489Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "5bc275437bbf238fc99c866d7886bdf589bbf2bda7368d37f1081b855111b1d9"
    },
    {
      "seq": 1,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "claude-haiku-4-5",
        "provider": "anthropic"
      },
      "usage": {
        "input_tokens": 860,
        "total_tokens": 956,
        "output_tokens": 96
      },
      "run_id": "sbx-contract-review-f83281a3a3ca",
      "ts_end": "2026-11-07T05:11:02.614Z",
      "request": {
        "tools": [
          {
            "name": "diff_against_template",
            "parameters": {
              "type": "object",
              "required": [
                "doc_id"
              ],
              "properties": {
                "doc_id": {
                  "type": "string",
                  "description": "Document id"
                }
              },
              "additionalProperties": false
            },
            "description": "List the clauses that differ from Acme's template."
          },
          {
            "name": "flag_clause",
            "parameters": {
              "type": "object",
              "required": [
                "doc_id",
                "clause",
                "severity",
                "reason"
              ],
              "properties": {
                "clause": {
                  "type": "string",
                  "description": "Clause number and title"
                },
                "doc_id": {
                  "type": "string",
                  "description": "Document id"
                },
                "reason": {
                  "type": "string",
                  "description": "Why"
                },
                "severity": {
                  "enum": [
                    "low",
                    "medium",
                    "high"
                  ],
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "description": "Flag a clause for Legal."
          }
        ],
        "params": {
          "temperature": 0,
          "max_output_tokens": 500
        },
        "system": "You are Acme Legal's contract review agent. You are running in Runback's public demo sandbox: every customer, order, invoice and account is synthetic, and your tools act on test data only. Compare the supplier contract with Acme's template and flag each risky deviation with a severity of low, medium or high. A name ending in s takes a bare apostrophe: Harbour Mock Traders', not Traders's. Use the tools to act; when you are done, reply with a one-sentence summary of what you did.",
        "messages": [
          {
            "role": "user",
            "content": "Review Wattle Sandbox Pty Ltd's supplier agreement (MSA-7201) before signature."
          }
        ]
      },
      "span_id": "l1",
      "response": {
        "text": "I'll review Wattle Sandbox Pty Ltd's supplier agreement by comparing it against Acme's template and flagging any risky deviations.",
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "doc_id": "MSA-7201"
            },
            "tool_name": "diff_against_template",
            "tool_call_id": "toolu_01Mi1wTC8DjfrKDerkGfet8c"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-11-07T05:11:01.489Z",
      "latency_ms": 1125,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "35585a1e7f032680b7ba0b16afd7f1dea8ae3b6fab2bb7174b0d89d30efb228f"
    },
    {
      "seq": 2,
      "type": "tool",
      "error": null,
      "input": {
        "doc_id": "MSA-7201"
      },
      "output": {
        "doc_id": "MSA-7201",
        "deviations": [
          {
            "text": "Invoices are payable within 30 days.",
            "clause": "6.1 Payment"
          },
          {
            "text": "Supplier's liability is capped at fees paid in the prior month.",
            "clause": "12.3 Indemnity"
          },
          {
            "text": "The agreement auto-renews for 36 months unless cancelled 180 days prior.",
            "clause": "8.1 Term"
          }
        ]
      },
      "run_id": "sbx-contract-review-f83281a3a3ca",
      "ts_end": "2026-11-07T05:11:02.707Z",
      "span_id": "t1",
      "ts_start": "2026-11-07T05:11:02.614Z",
      "tool_name": "diff_against_template",
      "latency_ms": 93,
      "tool_call_id": "toolu_01Mi1wTC8DjfrKDerkGfet8c",
      "parent_span_id": "l1",
      "schema_version": 1,
      "_hash": "e8a05a072a2df70e40b814ddc6afbb89147d882296c8375ba63bff954b6da58d"
    },
    {
      "seq": 3,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "claude-haiku-4-5",
        "provider": "anthropic"
      },
      "usage": {
        "input_tokens": 1070,
        "total_tokens": 1467,
        "output_tokens": 397
      },
      "run_id": "sbx-contract-review-f83281a3a3ca",
      "ts_end": "2026-11-07T05:11:06.185Z",
      "request": {
        "tools": [
          {
            "name": "diff_against_template",
            "parameters": {
              "type": "object",
              "required": [
                "doc_id"
              ],
              "properties": {
                "doc_id": {
                  "type": "string",
                  "description": "Document id"
                }
              },
              "additionalProperties": false
            },
            "description": "List the clauses that differ from Acme's template."
          },
          {
            "name": "flag_clause",
            "parameters": {
              "type": "object",
              "required": [
                "doc_id",
                "clause",
                "severity",
                "reason"
              ],
              "properties": {
                "clause": {
                  "type": "string",
                  "description": "Clause number and title"
                },
                "doc_id": {
                  "type": "string",
                  "description": "Document id"
                },
                "reason": {
                  "type": "string",
                  "description": "Why"
                },
                "severity": {
                  "enum": [
                    "low",
                    "medium",
                    "high"
                  ],
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "description": "Flag a clause for Legal."
          }
        ],
        "params": {
          "temperature": 0,
          "max_output_tokens": 500
        },
        "system": "You are Acme Legal's contract review agent. You are running in Runback's public demo sandbox: every customer, order, invoice and account is synthetic, and your tools act on test data only. Compare the supplier contract with Acme's template and flag each risky deviation with a severity of low, medium or high. A name ending in s takes a bare apostrophe: Harbour Mock Traders', not Traders's. Use the tools to act; when you are done, reply with a one-sentence summary of what you did.",
        "messages": [
          {
            "role": "user",
            "content": "Review Wattle Sandbox Pty Ltd's supplier agreement (MSA-7201) before signature."
          },
          {
            "role": "assistant",
            "content": [
              {
                "text": "I'll review Wattle Sandbox Pty Ltd's supplier agreement by comparing it against Acme's template and flagging any risky deviations.",
                "type": "text"
              },
              {
                "type": "tool-call",
                "input": {
                  "doc_id": "MSA-7201"
                },
                "toolName": "diff_against_template",
                "toolCallId": "toolu_01Mi1wTC8DjfrKDerkGfet8c"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "doc_id": "MSA-7201",
                    "deviations": [
                      {
                        "text": "Invoices are payable within 30 days.",
                        "clause": "6.1 Payment"
                      },
                      {
                        "text": "Supplier's liability is capped at fees paid in the prior month.",
                        "clause": "12.3 Indemnity"
                      },
                      {
                        "text": "The agreement auto-renews for 36 months unless cancelled 180 days prior.",
                        "clause": "8.1 Term"
                      }
                    ]
                  }
                },
                "toolName": "diff_against_template",
                "toolCallId": "toolu_01Mi1wTC8DjfrKDerkGfet8c"
              }
            ]
          }
        ]
      },
      "span_id": "l2",
      "response": {
        "text": "Now I'll flag each deviation with appropriate severity levels:",
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "clause": "6.1 Payment",
              "doc_id": "MSA-7201",
              "reason": "30-day payment terms are standard but should be verified against Acme's preferred terms and cash flow requirements",
              "severity": "low"
            },
            "tool_name": "flag_clause",
            "tool_call_id": "toolu_01VNjeBJpwmSGAumdY5Su8mt"
          },
          {
            "input": {
              "clause": "12.3 Indemnity",
              "doc_id": "MSA-7201",
              "reason": "Liability cap at prior month's fees is extremely low and inadequate; exposes Acme to significant uncompensated risk",
              "severity": "high"
            },
            "tool_name": "flag_clause",
            "tool_call_id": "toolu_01Dr4eRiLvun2KVMEkp4Nmno"
          },
          {
            "input": {
              "clause": "8.1 Term",
              "doc_id": "MSA-7201",
              "reason": "36-month auto-renewal with 180-day cancellation notice is onerous; creates long-term commitment and requires early exit planning",
              "severity": "medium"
            },
            "tool_name": "flag_clause",
            "tool_call_id": "toolu_016Ltfpy5UQgLKAazTK9qYNk"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-11-07T05:11:02.707Z",
      "latency_ms": 3478,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "45ef670eb3b9c5bcb96d7202cc3bf044c1120dacfb5918bedbbf87ae49d0fabd"
    },
    {
      "seq": 4,
      "type": "tool",
      "error": null,
      "input": {
        "clause": "6.1 Payment",
        "doc_id": "MSA-7201",
        "reason": "30-day payment terms are standard but should be verified against Acme's preferred terms and cash flow requirements",
        "severity": "low"
      },
      "output": {
        "clause": "6.1 Payment",
        "flagged": true,
        "severity": "low"
      },
      "run_id": "sbx-contract-review-f83281a3a3ca",
      "ts_end": "2026-11-07T05:11:06.204Z",
      "span_id": "t2",
      "ts_start": "2026-11-07T05:11:06.185Z",
      "tool_name": "flag_clause",
      "latency_ms": 19,
      "tool_call_id": "toolu_01VNjeBJpwmSGAumdY5Su8mt",
      "parent_span_id": "l2",
      "schema_version": 1,
      "_hash": "dddccf61ea1326faa9e24b72c90f419ba2980619ca853e6ba1a503bb20e909bc"
    },
    {
      "seq": 5,
      "type": "tool",
      "error": null,
      "input": {
        "clause": "12.3 Indemnity",
        "doc_id": "MSA-7201",
        "reason": "Liability cap at prior month's fees is extremely low and inadequate; exposes Acme to significant uncompensated risk",
        "severity": "high"
      },
      "output": {
        "clause": "12.3 Indemnity",
        "flagged": true,
        "severity": "high"
      },
      "run_id": "sbx-contract-review-f83281a3a3ca",
      "ts_end": "2026-11-07T05:11:06.248Z",
      "span_id": "t3",
      "ts_start": "2026-11-07T05:11:06.204Z",
      "tool_name": "flag_clause",
      "latency_ms": 44,
      "tool_call_id": "toolu_01Dr4eRiLvun2KVMEkp4Nmno",
      "parent_span_id": "l2",
      "schema_version": 1,
      "_hash": "5cf51af735e763a539a94a3b20b3c442ab3788f647eee259df511bf7760d5d84"
    },
    {
      "seq": 6,
      "type": "tool",
      "error": null,
      "input": {
        "clause": "8.1 Term",
        "doc_id": "MSA-7201",
        "reason": "36-month auto-renewal with 180-day cancellation notice is onerous; creates long-term commitment and requires early exit planning",
        "severity": "medium"
      },
      "output": {
        "clause": "8.1 Term",
        "flagged": true,
        "severity": "medium"
      },
      "run_id": "sbx-contract-review-f83281a3a3ca",
      "ts_end": "2026-11-07T05:11:06.272Z",
      "span_id": "t4",
      "ts_start": "2026-11-07T05:11:06.248Z",
      "tool_name": "flag_clause",
      "latency_ms": 24,
      "tool_call_id": "toolu_016Ltfpy5UQgLKAazTK9qYNk",
      "parent_span_id": "l2",
      "schema_version": 1,
      "_hash": "f309b48d8a7c39d4a1e363bcef1ffb12f2488f431405e924a131f41874ad213a"
    },
    {
      "seq": 7,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "claude-haiku-4-5",
        "provider": "anthropic"
      },
      "usage": {
        "input_tokens": 1612,
        "total_tokens": 1686,
        "output_tokens": 74
      },
      "run_id": "sbx-contract-review-f83281a3a3ca",
      "ts_end": "2026-11-07T05:11:07.439Z",
      "request": {
        "tools": [
          {
            "name": "diff_against_template",
            "parameters": {
              "type": "object",
              "required": [
                "doc_id"
              ],
              "properties": {
                "doc_id": {
                  "type": "string",
                  "description": "Document id"
                }
              },
              "additionalProperties": false
            },
            "description": "List the clauses that differ from Acme's template."
          },
          {
            "name": "flag_clause",
            "parameters": {
              "type": "object",
              "required": [
                "doc_id",
                "clause",
                "severity",
                "reason"
              ],
              "properties": {
                "clause": {
                  "type": "string",
                  "description": "Clause number and title"
                },
                "doc_id": {
                  "type": "string",
                  "description": "Document id"
                },
                "reason": {
                  "type": "string",
                  "description": "Why"
                },
                "severity": {
                  "enum": [
                    "low",
                    "medium",
                    "high"
                  ],
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "description": "Flag a clause for Legal."
          }
        ],
        "params": {
          "temperature": 0,
          "max_output_tokens": 500
        },
        "system": "You are Acme Legal's contract review agent. You are running in Runback's public demo sandbox: every customer, order, invoice and account is synthetic, and your tools act on test data only. Compare the supplier contract with Acme's template and flag each risky deviation with a severity of low, medium or high. A name ending in s takes a bare apostrophe: Harbour Mock Traders', not Traders's. Use the tools to act; when you are done, reply with a one-sentence summary of what you did.",
        "messages": [
          {
            "role": "user",
            "content": "Review Wattle Sandbox Pty Ltd's supplier agreement (MSA-7201) before signature."
          },
          {
            "role": "assistant",
            "content": [
              {
                "text": "I'll review Wattle Sandbox Pty Ltd's supplier agreement by comparing it against Acme's template and flagging any risky deviations.",
                "type": "text"
              },
              {
                "type": "tool-call",
                "input": {
                  "doc_id": "MSA-7201"
                },
                "toolName": "diff_against_template",
                "toolCallId": "toolu_01Mi1wTC8DjfrKDerkGfet8c"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "doc_id": "MSA-7201",
                    "deviations": [
                      {
                        "text": "Invoices are payable within 30 days.",
                        "clause": "6.1 Payment"
                      },
                      {
                        "text": "Supplier's liability is capped at fees paid in the prior month.",
                        "clause": "12.3 Indemnity"
                      },
                      {
                        "text": "The agreement auto-renews for 36 months unless cancelled 180 days prior.",
                        "clause": "8.1 Term"
                      }
                    ]
                  }
                },
                "toolName": "diff_against_template",
                "toolCallId": "toolu_01Mi1wTC8DjfrKDerkGfet8c"
              }
            ]
          },
          {
            "role": "assistant",
            "content": [
              {
                "text": "Now I'll flag each deviation with appropriate severity levels:",
                "type": "text"
              },
              {
                "type": "tool-call",
                "input": {
                  "clause": "6.1 Payment",
                  "doc_id": "MSA-7201",
                  "reason": "30-day payment terms are standard but should be verified against Acme's preferred terms and cash flow requirements",
                  "severity": "low"
                },
                "toolName": "flag_clause",
                "toolCallId": "toolu_01VNjeBJpwmSGAumdY5Su8mt"
              },
              {
                "type": "tool-call",
                "input": {
                  "clause": "12.3 Indemnity",
                  "doc_id": "MSA-7201",
                  "reason": "Liability cap at prior month's fees is extremely low and inadequate; exposes Acme to significant uncompensated risk",
                  "severity": "high"
                },
                "toolName": "flag_clause",
                "toolCallId": "toolu_01Dr4eRiLvun2KVMEkp4Nmno"
              },
              {
                "type": "tool-call",
                "input": {
                  "clause": "8.1 Term",
                  "doc_id": "MSA-7201",
                  "reason": "36-month auto-renewal with 180-day cancellation notice is onerous; creates long-term commitment and requires early exit planning",
                  "severity": "medium"
                },
                "toolName": "flag_clause",
                "toolCallId": "toolu_016Ltfpy5UQgLKAazTK9qYNk"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "clause": "6.1 Payment",
                    "flagged": true,
                    "severity": "low"
                  }
                },
                "toolName": "flag_clause",
                "toolCallId": "toolu_01VNjeBJpwmSGAumdY5Su8mt"
              },
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "clause": "12.3 Indemnity",
                    "flagged": true,
                    "severity": "high"
                  }
                },
                "toolName": "flag_clause",
                "toolCallId": "toolu_01Dr4eRiLvun2KVMEkp4Nmno"
              },
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "clause": "8.1 Term",
                    "flagged": true,
                    "severity": "medium"
                  }
                },
                "toolName": "flag_clause",
                "toolCallId": "toolu_016Ltfpy5UQgLKAazTK9qYNk"
              }
            ]
          }
        ]
      },
      "span_id": "l3",
      "response": {
        "text": "I've reviewed Wattle Sandbox Pty Ltd's MSA-7201 and flagged three deviations: a low-severity payment term issue, a high-severity liability cap that's dangerously inadequate, and a medium-severity auto-renewal clause with an onerous 180-day cancellation notice requirement.",
        "reasoning": null,
        "tool_calls": [],
        "finish_reason": "stop"
      },
      "ts_start": "2026-11-07T05:11:06.272Z",
      "latency_ms": 1167,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "908a9aad7a7d8cee7e9edbc91289f4393659b2b872708a2519afd4387ac7660e"
    },
    {
      "seq": 8,
      "name": "contract-review-agent",
      "type": "run",
      "error": null,
      "input": null,
      "phase": "end",
      "output": {
        "summary": "I've reviewed Wattle Sandbox Pty Ltd's MSA-7201 and flagged three deviations: a low-severity payment term issue, a high-severity liability cap that's dangerously inadequate, and a medium-severity auto-renewal clause with an onerous 180-day cancellation notice requirement."
      },
      "run_id": "sbx-contract-review-f83281a3a3ca",
      "status": "success",
      "ts_end": "2026-11-07T05:11:07.439Z",
      "span_id": "re",
      "metadata": {
        "demo_agent": true,
        "sandbox_tools": true
      },
      "ts_start": "2026-11-07T05:11:07.439Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "7deccc6964f488ecd36774ea2f3b3281e60dc686d7eb177d268659ee6048a114"
    }
  ]
}