{
  "$schema": "runback.audit/v2",
  "manifest": {
    "run_id": "sbx-contract-review-835b12f3ecdc",
    "generated_at": "2026-11-07T07:36:13.320Z",
    "event_count": 8,
    "algorithm": "sha256-chain",
    "content_digest": "7b8da00ee9c45db8f983dda878b51c83a239be2260aeaf8e8c3e12f8f444d9cb",
    "replay": {
      "cassette_digest": "cd7035184d43ee576b71309159c2eff864a4288ceeebea235d1b1e3af888c613",
      "entry_count": 6,
      "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": "517c6e837f1fc568f28241072f0ac98a91ed2c86f106b1dd29dadbc5cd7c500043d0f7ebd205a8ab30f46ce5243b0612dd4d9cec5032240c961ed7eef7663d01",
      "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-835b12f3ecdc",
    "name": "contract-review-agent",
    "status": "success",
    "input": "Review Harbour Mock Traders' supplier agreement (MSA-2270) before signature.",
    "output": {
      "summary": "I've reviewed Harbour Mock Traders' MSA-2270 and flagged two deviations: a low-severity payment term variance and a high-severity data usage clause that requires legal review before signature."
    },
    "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.005323,
      "sandbox_tools": true,
      "scenario_seed": "contract-review-agent:2026-11-06:70"
    },
    "step_count": 3,
    "total_tokens": 3683,
    "started_at": "2026-11-06T13:10:54.854+00:00",
    "ended_at": "2026-11-06T13:10:59.832+00:00",
    "actor_type": null,
    "actor_id": null
  },
  "events": [
    {
      "seq": 0,
      "name": "contract-review-agent",
      "type": "run",
      "error": null,
      "input": "Review Harbour Mock Traders' supplier agreement (MSA-2270) before signature.",
      "phase": "start",
      "output": null,
      "run_id": "sbx-contract-review-835b12f3ecdc",
      "status": "running",
      "ts_end": "2026-11-06T13:10:59.832Z",
      "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.005323,
        "sandbox_tools": true,
        "scenario_seed": "contract-review-agent:2026-11-06:70"
      },
      "ts_start": "2026-11-06T13:10:54.854Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "4addf6d516d421cb3c95d7baff4b55206dcece87e6a8a0b0f6238ae086be57b4"
    },
    {
      "seq": 1,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "claude-haiku-4-5",
        "provider": "anthropic"
      },
      "usage": {
        "input_tokens": 856,
        "total_tokens": 948,
        "output_tokens": 92
      },
      "run_id": "sbx-contract-review-835b12f3ecdc",
      "ts_end": "2026-11-06T13:10:56.049Z",
      "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 Harbour Mock Traders' supplier agreement (MSA-2270) before signature."
          }
        ]
      },
      "span_id": "l1",
      "response": {
        "text": "I'll review Harbour Mock Traders' supplier agreement by comparing it against Acme's template and flagging any risky deviations.",
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "doc_id": "MSA-2270"
            },
            "tool_name": "diff_against_template",
            "tool_call_id": "toolu_01Vnz15dW61dh7AscsH7jsvs"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-11-06T13:10:54.854Z",
      "latency_ms": 1194,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "310d4da4e34aa437156a27db0493d9a51e5ebdcde67416eb9d60781ff3dc7aea"
    },
    {
      "seq": 2,
      "type": "tool",
      "error": null,
      "input": {
        "doc_id": "MSA-2270"
      },
      "output": {
        "doc_id": "MSA-2270",
        "deviations": [
          {
            "text": "Invoices are payable within 30 days.",
            "clause": "6.1 Payment"
          },
          {
            "text": "Supplier may use customer data to improve its services.",
            "clause": "9.4 Data"
          }
        ]
      },
      "run_id": "sbx-contract-review-835b12f3ecdc",
      "ts_end": "2026-11-06T13:10:56.076Z",
      "span_id": "t1",
      "ts_start": "2026-11-06T13:10:56.049Z",
      "tool_name": "diff_against_template",
      "latency_ms": 27,
      "tool_call_id": "toolu_01Vnz15dW61dh7AscsH7jsvs",
      "parent_span_id": "l1",
      "schema_version": 1,
      "_hash": "e55157e29440ce8f66ed9ecc56093bfeae7c1b354115e2a190e2de6fab800fc4"
    },
    {
      "seq": 3,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "claude-haiku-4-5",
        "provider": "anthropic"
      },
      "usage": {
        "input_tokens": 1024,
        "total_tokens": 1294,
        "output_tokens": 270
      },
      "run_id": "sbx-contract-review-835b12f3ecdc",
      "ts_end": "2026-11-06T13:10:58.719Z",
      "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 Harbour Mock Traders' supplier agreement (MSA-2270) before signature."
          },
          {
            "role": "assistant",
            "content": [
              {
                "text": "I'll review Harbour Mock Traders' supplier agreement by comparing it against Acme's template and flagging any risky deviations.",
                "type": "text"
              },
              {
                "type": "tool-call",
                "input": {
                  "doc_id": "MSA-2270"
                },
                "toolName": "diff_against_template",
                "toolCallId": "toolu_01Vnz15dW61dh7AscsH7jsvs"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "doc_id": "MSA-2270",
                    "deviations": [
                      {
                        "text": "Invoices are payable within 30 days.",
                        "clause": "6.1 Payment"
                      },
                      {
                        "text": "Supplier may use customer data to improve its services.",
                        "clause": "9.4 Data"
                      }
                    ]
                  }
                },
                "toolName": "diff_against_template",
                "toolCallId": "toolu_01Vnz15dW61dh7AscsH7jsvs"
              }
            ]
          }
        ]
      },
      "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-2270",
              "reason": "30-day payment terms are standard but should be verified against Acme's cash flow policy and template default",
              "severity": "low"
            },
            "tool_name": "flag_clause",
            "tool_call_id": "toolu_01WHWNvcNfVrCUBV7bWA9ptt"
          },
          {
            "input": {
              "clause": "9.4 Data",
              "doc_id": "MSA-2270",
              "reason": "Supplier's right to use customer data for service improvement creates IP and confidentiality risk; requires explicit consent controls and data handling restrictions",
              "severity": "high"
            },
            "tool_name": "flag_clause",
            "tool_call_id": "toolu_01Gtqka5n9yXHaNeNyQ3wsbx"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-11-06T13:10:56.076Z",
      "latency_ms": 2643,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "b78bc5f80dc1b18ff7962fc778588b8bfa0d18080f1e5e63c41f29db2ba2f535"
    },
    {
      "seq": 4,
      "type": "tool",
      "error": null,
      "input": {
        "clause": "6.1 Payment",
        "doc_id": "MSA-2270",
        "reason": "30-day payment terms are standard but should be verified against Acme's cash flow policy and template default",
        "severity": "low"
      },
      "output": {
        "clause": "6.1 Payment",
        "flagged": true,
        "severity": "low"
      },
      "run_id": "sbx-contract-review-835b12f3ecdc",
      "ts_end": "2026-11-06T13:10:58.804Z",
      "span_id": "t2",
      "ts_start": "2026-11-06T13:10:58.719Z",
      "tool_name": "flag_clause",
      "latency_ms": 85,
      "tool_call_id": "toolu_01WHWNvcNfVrCUBV7bWA9ptt",
      "parent_span_id": "l2",
      "schema_version": 1,
      "_hash": "2644c5d1d053aff8bcf97b632a0b7868727dc6d194d5984d23ebdb7af0deafc3"
    },
    {
      "seq": 5,
      "type": "tool",
      "error": null,
      "input": {
        "clause": "9.4 Data",
        "doc_id": "MSA-2270",
        "reason": "Supplier's right to use customer data for service improvement creates IP and confidentiality risk; requires explicit consent controls and data handling restrictions",
        "severity": "high"
      },
      "output": {
        "clause": "9.4 Data",
        "flagged": true,
        "severity": "high"
      },
      "run_id": "sbx-contract-review-835b12f3ecdc",
      "ts_end": "2026-11-06T13:10:58.835Z",
      "span_id": "t3",
      "ts_start": "2026-11-06T13:10:58.804Z",
      "tool_name": "flag_clause",
      "latency_ms": 31,
      "tool_call_id": "toolu_01Gtqka5n9yXHaNeNyQ3wsbx",
      "parent_span_id": "l2",
      "schema_version": 1,
      "_hash": "29de4300965bb9f09353e4c3a10bd1035ba80c574d3b4912fa0d85c727231b3d"
    },
    {
      "seq": 6,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "claude-haiku-4-5",
        "provider": "anthropic"
      },
      "usage": {
        "input_tokens": 1393,
        "total_tokens": 1441,
        "output_tokens": 48
      },
      "run_id": "sbx-contract-review-835b12f3ecdc",
      "ts_end": "2026-11-06T13:10:59.832Z",
      "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 Harbour Mock Traders' supplier agreement (MSA-2270) before signature."
          },
          {
            "role": "assistant",
            "content": [
              {
                "text": "I'll review Harbour Mock Traders' supplier agreement by comparing it against Acme's template and flagging any risky deviations.",
                "type": "text"
              },
              {
                "type": "tool-call",
                "input": {
                  "doc_id": "MSA-2270"
                },
                "toolName": "diff_against_template",
                "toolCallId": "toolu_01Vnz15dW61dh7AscsH7jsvs"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "doc_id": "MSA-2270",
                    "deviations": [
                      {
                        "text": "Invoices are payable within 30 days.",
                        "clause": "6.1 Payment"
                      },
                      {
                        "text": "Supplier may use customer data to improve its services.",
                        "clause": "9.4 Data"
                      }
                    ]
                  }
                },
                "toolName": "diff_against_template",
                "toolCallId": "toolu_01Vnz15dW61dh7AscsH7jsvs"
              }
            ]
          },
          {
            "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-2270",
                  "reason": "30-day payment terms are standard but should be verified against Acme's cash flow policy and template default",
                  "severity": "low"
                },
                "toolName": "flag_clause",
                "toolCallId": "toolu_01WHWNvcNfVrCUBV7bWA9ptt"
              },
              {
                "type": "tool-call",
                "input": {
                  "clause": "9.4 Data",
                  "doc_id": "MSA-2270",
                  "reason": "Supplier's right to use customer data for service improvement creates IP and confidentiality risk; requires explicit consent controls and data handling restrictions",
                  "severity": "high"
                },
                "toolName": "flag_clause",
                "toolCallId": "toolu_01Gtqka5n9yXHaNeNyQ3wsbx"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "clause": "6.1 Payment",
                    "flagged": true,
                    "severity": "low"
                  }
                },
                "toolName": "flag_clause",
                "toolCallId": "toolu_01WHWNvcNfVrCUBV7bWA9ptt"
              },
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "clause": "9.4 Data",
                    "flagged": true,
                    "severity": "high"
                  }
                },
                "toolName": "flag_clause",
                "toolCallId": "toolu_01Gtqka5n9yXHaNeNyQ3wsbx"
              }
            ]
          }
        ]
      },
      "span_id": "l3",
      "response": {
        "text": "I've reviewed Harbour Mock Traders' MSA-2270 and flagged two deviations: a low-severity payment term variance and a high-severity data usage clause that requires legal review before signature.",
        "reasoning": null,
        "tool_calls": [],
        "finish_reason": "stop"
      },
      "ts_start": "2026-11-06T13:10:58.835Z",
      "latency_ms": 997,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "70cacd6832db2ef48b97ef650e2238978ae6226020ad7ef300b4fb27fb30e113"
    },
    {
      "seq": 7,
      "name": "contract-review-agent",
      "type": "run",
      "error": null,
      "input": null,
      "phase": "end",
      "output": {
        "summary": "I've reviewed Harbour Mock Traders' MSA-2270 and flagged two deviations: a low-severity payment term variance and a high-severity data usage clause that requires legal review before signature."
      },
      "run_id": "sbx-contract-review-835b12f3ecdc",
      "status": "success",
      "ts_end": "2026-11-06T13:10:59.832Z",
      "span_id": "re",
      "metadata": {
        "demo_agent": true,
        "sandbox_tools": true
      },
      "ts_start": "2026-11-06T13:10:59.832Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "7b8da00ee9c45db8f983dda878b51c83a239be2260aeaf8e8c3e12f8f444d9cb"
    }
  ]
}