{
  "$schema": "runback.audit/v2",
  "manifest": {
    "run_id": "sbx-contract-review-a704da742f9f",
    "generated_at": "2026-11-07T07:28:25.132Z",
    "event_count": 8,
    "algorithm": "sha256-chain",
    "content_digest": "86d18cc19c791295d6e1fc6ab35bad4180be5fc2696d73402f79bae55f41b568",
    "replay": {
      "cassette_digest": "0cd8743649b0671a8a7ae36ad7e7aa3d075e35618d0276fc66d10055b168e87a",
      "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": "6d7dd5749e5e056fdb206eec1cd797303fba6f08fc0a74c791535d42a2c0ce01ec47e0138701d65dfd4cb93ec1f05612eeb6b2f7d561c43866a20835ccaf2707",
      "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-a704da742f9f",
    "name": "contract-review-agent",
    "status": "success",
    "input": "Review Harbour Mock Traders' supplier agreement (MSA-2242) before signature.",
    "output": {
      "summary": "I reviewed the supplier agreement for Harbour Mock Traders and flagged two deviations: a medium risk for the payment terms and a low risk for the governing law clause."
    },
    "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": "gpt-4o-mini",
      "demo_agent": true,
      "est_cost_usd": 0.000251,
      "sandbox_tools": true,
      "scenario_seed": "contract-review-agent:2026-11-06:54"
    },
    "step_count": 3,
    "total_tokens": 1181,
    "started_at": "2026-11-06T10:10:48.704+00:00",
    "ended_at": "2026-11-06T10:10:56.443+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-2242) before signature.",
      "phase": "start",
      "output": null,
      "run_id": "sbx-contract-review-a704da742f9f",
      "status": "running",
      "ts_end": "2026-11-06T10:10:56.443Z",
      "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": "gpt-4o-mini",
        "demo_agent": true,
        "est_cost_usd": 0.000251,
        "sandbox_tools": true,
        "scenario_seed": "contract-review-agent:2026-11-06:54"
      },
      "ts_start": "2026-11-06T10:10:48.704Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "9a2bad9f39a3c894331e300ee78e85afbdb92ba80f88bc57024780de4e051cb1"
    },
    {
      "seq": 1,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "gpt-4o-mini",
        "provider": "openai"
      },
      "usage": {
        "input_tokens": 231,
        "total_tokens": 253,
        "output_tokens": 22
      },
      "run_id": "sbx-contract-review-a704da742f9f",
      "ts_end": "2026-11-06T10:10:51.404Z",
      "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-2242) before signature."
          }
        ]
      },
      "span_id": "l1",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "doc_id": "MSA-2242"
            },
            "tool_name": "diff_against_template",
            "tool_call_id": "call_H28ryMYrdVde1zK4gSIwV3Pn"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-11-06T10:10:48.704Z",
      "latency_ms": 2699,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "faaf0d5e5b7be4bda441e7c24341124e7eaa68fcbb390e62b39d540fdf36d018"
    },
    {
      "seq": 2,
      "type": "tool",
      "error": null,
      "input": {
        "doc_id": "MSA-2242"
      },
      "output": {
        "doc_id": "MSA-2242",
        "deviations": [
          {
            "text": "Invoices are payable within 30 days.",
            "clause": "6.1 Payment"
          },
          {
            "text": "This agreement is governed by the laws of the State of Delaware.",
            "clause": "15.2 Governing law"
          }
        ]
      },
      "run_id": "sbx-contract-review-a704da742f9f",
      "ts_end": "2026-11-06T10:10:51.526Z",
      "span_id": "t1",
      "ts_start": "2026-11-06T10:10:51.404Z",
      "tool_name": "diff_against_template",
      "latency_ms": 122,
      "tool_call_id": "call_H28ryMYrdVde1zK4gSIwV3Pn",
      "parent_span_id": "l1",
      "schema_version": 1,
      "_hash": "6ecef06f8adc0a087fd0a08e9ba25ce7b90e510eed3f0c1697f9a52ed313c930"
    },
    {
      "seq": 3,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "gpt-4o-mini",
        "provider": "openai"
      },
      "usage": {
        "input_tokens": 321,
        "total_tokens": 431,
        "output_tokens": 110
      },
      "run_id": "sbx-contract-review-a704da742f9f",
      "ts_end": "2026-11-06T10:10:54.528Z",
      "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-2242) before signature."
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "doc_id": "MSA-2242"
                },
                "toolName": "diff_against_template",
                "toolCallId": "call_H28ryMYrdVde1zK4gSIwV3Pn"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "doc_id": "MSA-2242",
                    "deviations": [
                      {
                        "text": "Invoices are payable within 30 days.",
                        "clause": "6.1 Payment"
                      },
                      {
                        "text": "This agreement is governed by the laws of the State of Delaware.",
                        "clause": "15.2 Governing law"
                      }
                    ]
                  }
                },
                "toolName": "diff_against_template",
                "toolCallId": "call_H28ryMYrdVde1zK4gSIwV3Pn"
              }
            ]
          }
        ]
      },
      "span_id": "l2",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "clause": "6.1 Payment",
              "doc_id": "MSA-2242",
              "reason": "30-day payment terms may affect cash flow.",
              "severity": "medium"
            },
            "tool_name": "flag_clause",
            "tool_call_id": "call_9OppBjhKOxdU6QqWEZAHCTBQ"
          },
          {
            "input": {
              "clause": "15.2 Governing law",
              "doc_id": "MSA-2242",
              "reason": "Governing law in Delaware may not be favorable for dispute resolution.",
              "severity": "low"
            },
            "tool_name": "flag_clause",
            "tool_call_id": "call_LLIgHtUUy7Nj5RVTuhHltx6i"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-11-06T10:10:51.526Z",
      "latency_ms": 3002,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "367d5a74ec722b48923af09aca8785a11c28537a76eda284c8353a4e31e98d57"
    },
    {
      "seq": 4,
      "type": "tool",
      "error": null,
      "input": {
        "clause": "6.1 Payment",
        "doc_id": "MSA-2242",
        "reason": "30-day payment terms may affect cash flow.",
        "severity": "medium"
      },
      "output": {
        "clause": "6.1 Payment",
        "flagged": true,
        "severity": "medium"
      },
      "run_id": "sbx-contract-review-a704da742f9f",
      "ts_end": "2026-11-06T10:10:54.556Z",
      "span_id": "t2",
      "ts_start": "2026-11-06T10:10:54.528Z",
      "tool_name": "flag_clause",
      "latency_ms": 28,
      "tool_call_id": "call_9OppBjhKOxdU6QqWEZAHCTBQ",
      "parent_span_id": "l2",
      "schema_version": 1,
      "_hash": "b69f927126d202521a096d4528bab69cadcfde886bdd769020e5f3af60b3effe"
    },
    {
      "seq": 5,
      "type": "tool",
      "error": null,
      "input": {
        "clause": "15.2 Governing law",
        "doc_id": "MSA-2242",
        "reason": "Governing law in Delaware may not be favorable for dispute resolution.",
        "severity": "low"
      },
      "output": {
        "clause": "15.2 Governing law",
        "flagged": true,
        "severity": "low"
      },
      "run_id": "sbx-contract-review-a704da742f9f",
      "ts_end": "2026-11-06T10:10:54.599Z",
      "span_id": "t3",
      "ts_start": "2026-11-06T10:10:54.556Z",
      "tool_name": "flag_clause",
      "latency_ms": 43,
      "tool_call_id": "call_LLIgHtUUy7Nj5RVTuhHltx6i",
      "parent_span_id": "l2",
      "schema_version": 1,
      "_hash": "65e97b5b37cbe17f2a76d99520b1aff2dc3209ddb4ecfd1d4bf70a298b8ebe34"
    },
    {
      "seq": 6,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "gpt-4o-mini",
        "provider": "openai"
      },
      "usage": {
        "input_tokens": 464,
        "total_tokens": 497,
        "output_tokens": 33
      },
      "run_id": "sbx-contract-review-a704da742f9f",
      "ts_end": "2026-11-06T10:10:56.443Z",
      "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-2242) before signature."
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "doc_id": "MSA-2242"
                },
                "toolName": "diff_against_template",
                "toolCallId": "call_H28ryMYrdVde1zK4gSIwV3Pn"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "doc_id": "MSA-2242",
                    "deviations": [
                      {
                        "text": "Invoices are payable within 30 days.",
                        "clause": "6.1 Payment"
                      },
                      {
                        "text": "This agreement is governed by the laws of the State of Delaware.",
                        "clause": "15.2 Governing law"
                      }
                    ]
                  }
                },
                "toolName": "diff_against_template",
                "toolCallId": "call_H28ryMYrdVde1zK4gSIwV3Pn"
              }
            ]
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "clause": "6.1 Payment",
                  "doc_id": "MSA-2242",
                  "reason": "30-day payment terms may affect cash flow.",
                  "severity": "medium"
                },
                "toolName": "flag_clause",
                "toolCallId": "call_9OppBjhKOxdU6QqWEZAHCTBQ"
              },
              {
                "type": "tool-call",
                "input": {
                  "clause": "15.2 Governing law",
                  "doc_id": "MSA-2242",
                  "reason": "Governing law in Delaware may not be favorable for dispute resolution.",
                  "severity": "low"
                },
                "toolName": "flag_clause",
                "toolCallId": "call_LLIgHtUUy7Nj5RVTuhHltx6i"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "clause": "6.1 Payment",
                    "flagged": true,
                    "severity": "medium"
                  }
                },
                "toolName": "flag_clause",
                "toolCallId": "call_9OppBjhKOxdU6QqWEZAHCTBQ"
              },
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "clause": "15.2 Governing law",
                    "flagged": true,
                    "severity": "low"
                  }
                },
                "toolName": "flag_clause",
                "toolCallId": "call_LLIgHtUUy7Nj5RVTuhHltx6i"
              }
            ]
          }
        ]
      },
      "span_id": "l3",
      "response": {
        "text": "I reviewed the supplier agreement for Harbour Mock Traders and flagged two deviations: a medium risk for the payment terms and a low risk for the governing law clause.",
        "reasoning": null,
        "tool_calls": [],
        "finish_reason": "stop"
      },
      "ts_start": "2026-11-06T10:10:54.599Z",
      "latency_ms": 1844,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "050473de9e8c0950b923a90be63e6b3660a01c25cf7851a5ab5b0fbeba4bed84"
    },
    {
      "seq": 7,
      "name": "contract-review-agent",
      "type": "run",
      "error": null,
      "input": null,
      "phase": "end",
      "output": {
        "summary": "I reviewed the supplier agreement for Harbour Mock Traders and flagged two deviations: a medium risk for the payment terms and a low risk for the governing law clause."
      },
      "run_id": "sbx-contract-review-a704da742f9f",
      "status": "success",
      "ts_end": "2026-11-06T10:10:56.443Z",
      "span_id": "re",
      "metadata": {
        "demo_agent": true,
        "sandbox_tools": true
      },
      "ts_start": "2026-11-06T10:10:56.443Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "86d18cc19c791295d6e1fc6ab35bad4180be5fc2696d73402f79bae55f41b568"
    }
  ]
}