{
  "$schema": "runback.audit/v2",
  "manifest": {
    "run_id": "sbx-contract-review-971d8384bb0e",
    "generated_at": "2026-11-07T07:28:22.355Z",
    "event_count": 8,
    "algorithm": "sha256-chain",
    "content_digest": "35b7b6892cf910211293ed2f64b51504d1a5a242afebd7909ea4b47d93bdabd5",
    "replay": {
      "cassette_digest": "f00190b5c964e03614ef2b4b2e70b38087432ae9c90b537ed3d1b4d1d7688e37",
      "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": "2a087f39a9d9defa885cf3f5853de87c64e15a6eb488c2cb9112e5c470a5d0aa6fc4783acfcc77e1b034e961fcd5dcf38784844b41faf70895cd1a7b512ccb02",
      "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-971d8384bb0e",
    "name": "contract-review-agent",
    "status": "success",
    "input": "Review Bluegum Example Foods' supplier agreement (MSA-8733) before signature.",
    "output": {
      "summary": "I reviewed the supplier agreement for Bluegum Example Foods and flagged two risky deviations: a medium severity for the 30-day payment terms and a high severity for capping liability at one month of fees."
    },
    "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.000256,
      "sandbox_tools": true,
      "scenario_seed": "contract-review-agent:2026-11-06:46"
    },
    "step_count": 3,
    "total_tokens": 1189,
    "started_at": "2026-11-06T08:11:02.686+00:00",
    "ended_at": "2026-11-06T08:11:09.114+00:00",
    "actor_type": null,
    "actor_id": null
  },
  "events": [
    {
      "seq": 0,
      "name": "contract-review-agent",
      "type": "run",
      "error": null,
      "input": "Review Bluegum Example Foods' supplier agreement (MSA-8733) before signature.",
      "phase": "start",
      "output": null,
      "run_id": "sbx-contract-review-971d8384bb0e",
      "status": "running",
      "ts_end": "2026-11-06T08:11:09.114Z",
      "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.000256,
        "sandbox_tools": true,
        "scenario_seed": "contract-review-agent:2026-11-06:46"
      },
      "ts_start": "2026-11-06T08:11:02.686Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "89715a5d8ed83818706e861aa0e5b75f5066b7744a43b1b629b8aded7faf0904"
    },
    {
      "seq": 1,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "gpt-4o-mini",
        "provider": "openai"
      },
      "usage": {
        "input_tokens": 232,
        "total_tokens": 254,
        "output_tokens": 22
      },
      "run_id": "sbx-contract-review-971d8384bb0e",
      "ts_end": "2026-11-06T08:11:04.026Z",
      "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 Bluegum Example Foods' supplier agreement (MSA-8733) before signature."
          }
        ]
      },
      "span_id": "l1",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "doc_id": "MSA-8733"
            },
            "tool_name": "diff_against_template",
            "tool_call_id": "call_oNCsumP38zxpUBdKY3xkbXpC"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-11-06T08:11:02.686Z",
      "latency_ms": 1340,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "1d0fcf3f87d137f84769267356442308c77891f8a3685d471bff60cfd78e6b88"
    },
    {
      "seq": 2,
      "type": "tool",
      "error": null,
      "input": {
        "doc_id": "MSA-8733"
      },
      "output": {
        "doc_id": "MSA-8733",
        "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"
          }
        ]
      },
      "run_id": "sbx-contract-review-971d8384bb0e",
      "ts_end": "2026-11-06T08:11:04.119Z",
      "span_id": "t1",
      "ts_start": "2026-11-06T08:11:04.026Z",
      "tool_name": "diff_against_template",
      "latency_ms": 93,
      "tool_call_id": "call_oNCsumP38zxpUBdKY3xkbXpC",
      "parent_span_id": "l1",
      "schema_version": 1,
      "_hash": "c0852c513a90f9eab6267119bc7195dcd4a5fd7729204bbc6a64a2fd64fe9b4d"
    },
    {
      "seq": 3,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "gpt-4o-mini",
        "provider": "openai"
      },
      "usage": {
        "input_tokens": 322,
        "total_tokens": 430,
        "output_tokens": 108
      },
      "run_id": "sbx-contract-review-971d8384bb0e",
      "ts_end": "2026-11-06T08:11:07.116Z",
      "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 Bluegum Example Foods' supplier agreement (MSA-8733) before signature."
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "doc_id": "MSA-8733"
                },
                "toolName": "diff_against_template",
                "toolCallId": "call_oNCsumP38zxpUBdKY3xkbXpC"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "doc_id": "MSA-8733",
                    "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"
                      }
                    ]
                  }
                },
                "toolName": "diff_against_template",
                "toolCallId": "call_oNCsumP38zxpUBdKY3xkbXpC"
              }
            ]
          }
        ]
      },
      "span_id": "l2",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "clause": "6.1 Payment",
              "doc_id": "MSA-8733",
              "reason": "30-day payment terms may affect cash flow.",
              "severity": "medium"
            },
            "tool_name": "flag_clause",
            "tool_call_id": "call_vemtZDtAO80ZhZh176FvES2M"
          },
          {
            "input": {
              "clause": "12.3 Indemnity",
              "doc_id": "MSA-8733",
              "reason": "Capping liability at one month of fees poses significant risk.",
              "severity": "high"
            },
            "tool_name": "flag_clause",
            "tool_call_id": "call_fftKocU1vuJtclu9y6ogpmbk"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-11-06T08:11:04.119Z",
      "latency_ms": 2997,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "ed244fe1bd96719b146a3b3ebe1bd9a1429b4089a94dd2d1dc0280adb43cf506"
    },
    {
      "seq": 4,
      "type": "tool",
      "error": null,
      "input": {
        "clause": "6.1 Payment",
        "doc_id": "MSA-8733",
        "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-971d8384bb0e",
      "ts_end": "2026-11-06T08:11:07.262Z",
      "span_id": "t2",
      "ts_start": "2026-11-06T08:11:07.116Z",
      "tool_name": "flag_clause",
      "latency_ms": 146,
      "tool_call_id": "call_vemtZDtAO80ZhZh176FvES2M",
      "parent_span_id": "l2",
      "schema_version": 1,
      "_hash": "72074025a10ef853b02e6a5069111b453ad159c045c59bc404b1be0537306f13"
    },
    {
      "seq": 5,
      "type": "tool",
      "error": null,
      "input": {
        "clause": "12.3 Indemnity",
        "doc_id": "MSA-8733",
        "reason": "Capping liability at one month of fees poses significant risk.",
        "severity": "high"
      },
      "output": {
        "clause": "12.3 Indemnity",
        "flagged": true,
        "severity": "high"
      },
      "run_id": "sbx-contract-review-971d8384bb0e",
      "ts_end": "2026-11-06T08:11:07.293Z",
      "span_id": "t3",
      "ts_start": "2026-11-06T08:11:07.262Z",
      "tool_name": "flag_clause",
      "latency_ms": 31,
      "tool_call_id": "call_fftKocU1vuJtclu9y6ogpmbk",
      "parent_span_id": "l2",
      "schema_version": 1,
      "_hash": "f6577c588322a41cab1e79c68f625942677548a810a989767e5f016765bad8bb"
    },
    {
      "seq": 6,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "gpt-4o-mini",
        "provider": "openai"
      },
      "usage": {
        "input_tokens": 463,
        "total_tokens": 505,
        "output_tokens": 42
      },
      "run_id": "sbx-contract-review-971d8384bb0e",
      "ts_end": "2026-11-06T08:11:09.113Z",
      "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 Bluegum Example Foods' supplier agreement (MSA-8733) before signature."
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "doc_id": "MSA-8733"
                },
                "toolName": "diff_against_template",
                "toolCallId": "call_oNCsumP38zxpUBdKY3xkbXpC"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "doc_id": "MSA-8733",
                    "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"
                      }
                    ]
                  }
                },
                "toolName": "diff_against_template",
                "toolCallId": "call_oNCsumP38zxpUBdKY3xkbXpC"
              }
            ]
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "clause": "6.1 Payment",
                  "doc_id": "MSA-8733",
                  "reason": "30-day payment terms may affect cash flow.",
                  "severity": "medium"
                },
                "toolName": "flag_clause",
                "toolCallId": "call_vemtZDtAO80ZhZh176FvES2M"
              },
              {
                "type": "tool-call",
                "input": {
                  "clause": "12.3 Indemnity",
                  "doc_id": "MSA-8733",
                  "reason": "Capping liability at one month of fees poses significant risk.",
                  "severity": "high"
                },
                "toolName": "flag_clause",
                "toolCallId": "call_fftKocU1vuJtclu9y6ogpmbk"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "clause": "6.1 Payment",
                    "flagged": true,
                    "severity": "medium"
                  }
                },
                "toolName": "flag_clause",
                "toolCallId": "call_vemtZDtAO80ZhZh176FvES2M"
              },
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "clause": "12.3 Indemnity",
                    "flagged": true,
                    "severity": "high"
                  }
                },
                "toolName": "flag_clause",
                "toolCallId": "call_fftKocU1vuJtclu9y6ogpmbk"
              }
            ]
          }
        ]
      },
      "span_id": "l3",
      "response": {
        "text": "I reviewed the supplier agreement for Bluegum Example Foods and flagged two risky deviations: a medium severity for the 30-day payment terms and a high severity for capping liability at one month of fees.",
        "reasoning": null,
        "tool_calls": [],
        "finish_reason": "stop"
      },
      "ts_start": "2026-11-06T08:11:07.293Z",
      "latency_ms": 1820,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "0cf268312fa9c1fc2ca4b5d35ec9648307f9bbf139582e8724bd074d01bbd07f"
    },
    {
      "seq": 7,
      "name": "contract-review-agent",
      "type": "run",
      "error": null,
      "input": null,
      "phase": "end",
      "output": {
        "summary": "I reviewed the supplier agreement for Bluegum Example Foods and flagged two risky deviations: a medium severity for the 30-day payment terms and a high severity for capping liability at one month of fees."
      },
      "run_id": "sbx-contract-review-971d8384bb0e",
      "status": "success",
      "ts_end": "2026-11-06T08:11:09.114Z",
      "span_id": "re",
      "metadata": {
        "demo_agent": true,
        "sandbox_tools": true
      },
      "ts_start": "2026-11-06T08:11:09.114Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "35b7b6892cf910211293ed2f64b51504d1a5a242afebd7909ea4b47d93bdabd5"
    }
  ]
}