{
  "$schema": "runback.audit/v2",
  "manifest": {
    "run_id": "sbx-contract-review-76303e1c6507",
    "generated_at": "2026-11-07T07:28:26.044Z",
    "event_count": 7,
    "algorithm": "sha256-chain",
    "content_digest": "3c9ef8d26464913c2d94808f9d4085af0a390f01ba23517c3d08bf092047e1b5",
    "replay": {
      "cassette_digest": "e461e19451fe2970120cbdc63567bb4bc9979df1adcf5fc9bebb9460508703e4",
      "entry_count": 5,
      "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": "2a654fc8e97909b26ea04915900bfa05edd31331ce9cc7fed558cf944a083b4d8fe5b77f68575139a7e33c67c304b9a058ab0fbd591ccc390a01beb9c9ea9606",
      "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-76303e1c6507",
    "name": "contract-review-agent",
    "status": "success",
    "input": "Review Bluegum Example Foods' supplier agreement (MSA-7468) before signature.",
    "output": {
      "summary": "I reviewed Bluegum Example Foods' supplier agreement and flagged a high-severity deviation regarding the indemnity clause, which limits the supplier's liability."
    },
    "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.000203,
      "sandbox_tools": true,
      "scenario_seed": "contract-review-agent:2026-11-07:22"
    },
    "step_count": 3,
    "total_tokens": 1028,
    "started_at": "2026-11-07T04:10:48.843+00:00",
    "ended_at": "2026-11-07T04:10:55.75+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-7468) before signature.",
      "phase": "start",
      "output": null,
      "run_id": "sbx-contract-review-76303e1c6507",
      "status": "running",
      "ts_end": "2026-11-07T04:10:55.750Z",
      "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.000203,
        "sandbox_tools": true,
        "scenario_seed": "contract-review-agent:2026-11-07:22"
      },
      "ts_start": "2026-11-07T04:10:48.843Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "1cee9b703556bbab53cbf7034c9426b5460177bacd9d18b4e3d5d219f0901f51"
    },
    {
      "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-76303e1c6507",
      "ts_end": "2026-11-07T04:10:51.165Z",
      "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-7468) before signature."
          }
        ]
      },
      "span_id": "l1",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "doc_id": "MSA-7468"
            },
            "tool_name": "diff_against_template",
            "tool_call_id": "call_7DFgmPRBoKMn1YXXx7EMMmXi"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-11-07T04:10:48.843Z",
      "latency_ms": 2322,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "8f727bb11cb6fad6f5da6272adffd037da4500830d1f097e7da87a737b61316a"
    },
    {
      "seq": 2,
      "type": "tool",
      "error": null,
      "input": {
        "doc_id": "MSA-7468"
      },
      "output": {
        "doc_id": "MSA-7468",
        "deviations": [
          {
            "text": "Supplier's liability is capped at fees paid in the prior month.",
            "clause": "12.3 Indemnity"
          }
        ]
      },
      "run_id": "sbx-contract-review-76303e1c6507",
      "ts_end": "2026-11-07T04:10:51.299Z",
      "span_id": "t1",
      "ts_start": "2026-11-07T04:10:51.165Z",
      "tool_name": "diff_against_template",
      "latency_ms": 134,
      "tool_call_id": "call_7DFgmPRBoKMn1YXXx7EMMmXi",
      "parent_span_id": "l1",
      "schema_version": 1,
      "_hash": "ccb81b6dda253b3552cc101286f8fd79dad35fa4d036930eed2addd10ba28ad9"
    },
    {
      "seq": 3,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "gpt-4o-mini",
        "provider": "openai"
      },
      "usage": {
        "input_tokens": 303,
        "total_tokens": 359,
        "output_tokens": 56
      },
      "run_id": "sbx-contract-review-76303e1c6507",
      "ts_end": "2026-11-07T04:10:54.324Z",
      "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-7468) before signature."
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "doc_id": "MSA-7468"
                },
                "toolName": "diff_against_template",
                "toolCallId": "call_7DFgmPRBoKMn1YXXx7EMMmXi"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "doc_id": "MSA-7468",
                    "deviations": [
                      {
                        "text": "Supplier's liability is capped at fees paid in the prior month.",
                        "clause": "12.3 Indemnity"
                      }
                    ]
                  }
                },
                "toolName": "diff_against_template",
                "toolCallId": "call_7DFgmPRBoKMn1YXXx7EMMmXi"
              }
            ]
          }
        ]
      },
      "span_id": "l2",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "clause": "12.3 Indemnity",
              "doc_id": "MSA-7468",
              "reason": "Capping liability at fees paid in the prior month significantly limits the supplier's accountability for damages.",
              "severity": "high"
            },
            "tool_name": "flag_clause",
            "tool_call_id": "call_pOMJT0FDmA2F5I3XXAoIMt9q"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-11-07T04:10:51.299Z",
      "latency_ms": 3025,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "da95c4c29db5a252116c856187bea96b3a4123d75969da85fbfbcc185c9a0977"
    },
    {
      "seq": 4,
      "type": "tool",
      "error": null,
      "input": {
        "clause": "12.3 Indemnity",
        "doc_id": "MSA-7468",
        "reason": "Capping liability at fees paid in the prior month significantly limits the supplier's accountability for damages.",
        "severity": "high"
      },
      "output": {
        "clause": "12.3 Indemnity",
        "flagged": true,
        "severity": "high"
      },
      "run_id": "sbx-contract-review-76303e1c6507",
      "ts_end": "2026-11-07T04:10:54.354Z",
      "span_id": "t2",
      "ts_start": "2026-11-07T04:10:54.324Z",
      "tool_name": "flag_clause",
      "latency_ms": 30,
      "tool_call_id": "call_pOMJT0FDmA2F5I3XXAoIMt9q",
      "parent_span_id": "l2",
      "schema_version": 1,
      "_hash": "8c0be78672e0fc8b91ee0d0c5b70219908786cf1b81ca5a1b9e788a6037ed48a"
    },
    {
      "seq": 5,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "gpt-4o-mini",
        "provider": "openai"
      },
      "usage": {
        "input_tokens": 384,
        "total_tokens": 415,
        "output_tokens": 31
      },
      "run_id": "sbx-contract-review-76303e1c6507",
      "ts_end": "2026-11-07T04:10:55.750Z",
      "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-7468) before signature."
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "doc_id": "MSA-7468"
                },
                "toolName": "diff_against_template",
                "toolCallId": "call_7DFgmPRBoKMn1YXXx7EMMmXi"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "doc_id": "MSA-7468",
                    "deviations": [
                      {
                        "text": "Supplier's liability is capped at fees paid in the prior month.",
                        "clause": "12.3 Indemnity"
                      }
                    ]
                  }
                },
                "toolName": "diff_against_template",
                "toolCallId": "call_7DFgmPRBoKMn1YXXx7EMMmXi"
              }
            ]
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "clause": "12.3 Indemnity",
                  "doc_id": "MSA-7468",
                  "reason": "Capping liability at fees paid in the prior month significantly limits the supplier's accountability for damages.",
                  "severity": "high"
                },
                "toolName": "flag_clause",
                "toolCallId": "call_pOMJT0FDmA2F5I3XXAoIMt9q"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "clause": "12.3 Indemnity",
                    "flagged": true,
                    "severity": "high"
                  }
                },
                "toolName": "flag_clause",
                "toolCallId": "call_pOMJT0FDmA2F5I3XXAoIMt9q"
              }
            ]
          }
        ]
      },
      "span_id": "l3",
      "response": {
        "text": "I reviewed Bluegum Example Foods' supplier agreement and flagged a high-severity deviation regarding the indemnity clause, which limits the supplier's liability.",
        "reasoning": null,
        "tool_calls": [],
        "finish_reason": "stop"
      },
      "ts_start": "2026-11-07T04:10:54.354Z",
      "latency_ms": 1396,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "b34fa6cd1cb02691dbf813fd51ae585bbefc1155ec2e93a6331c5c3fb96b6ca1"
    },
    {
      "seq": 6,
      "name": "contract-review-agent",
      "type": "run",
      "error": null,
      "input": null,
      "phase": "end",
      "output": {
        "summary": "I reviewed Bluegum Example Foods' supplier agreement and flagged a high-severity deviation regarding the indemnity clause, which limits the supplier's liability."
      },
      "run_id": "sbx-contract-review-76303e1c6507",
      "status": "success",
      "ts_end": "2026-11-07T04:10:55.750Z",
      "span_id": "re",
      "metadata": {
        "demo_agent": true,
        "sandbox_tools": true
      },
      "ts_start": "2026-11-07T04:10:55.750Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "3c9ef8d26464913c2d94808f9d4085af0a390f01ba23517c3d08bf092047e1b5"
    }
  ]
}