{
  "$schema": "runback.audit/v2",
  "manifest": {
    "run_id": "sbx-contract-review-39fb850e9618",
    "generated_at": "2026-11-07T07:36:13.495Z",
    "event_count": 7,
    "algorithm": "sha256-chain",
    "content_digest": "41a6b0efa567fa2ddeb1690c5d7fdbe5e6b68ebd079bdee789852ab758a24fb6",
    "replay": {
      "cassette_digest": "68268e884609194397f7cc9a5be75b4aa0f45091e4feda0f04aa8421e1f5f4a1",
      "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": "3d78a522910c6607fbe3506683c86d640d291d9741b96c537c5f824a6d4cde5a08050ac5f26a0dc4f68bbf99a92c2c17bfff8a9cce4fd59dc5bd5a253d194f0f",
      "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-39fb850e9618",
    "name": "contract-review-agent",
    "status": "success",
    "input": "Review Southern Fixture Co's supplier agreement (MSA-1044) before signature.",
    "output": {
      "summary": "I reviewed Southern Fixture Co's supplier agreement and flagged clause 9.4 regarding data usage as a medium-risk deviation from Acme's template."
    },
    "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.000202,
      "sandbox_tools": true,
      "scenario_seed": "contract-review-agent:2026-11-06:86"
    },
    "step_count": 3,
    "total_tokens": 1015,
    "started_at": "2026-11-06T16:11:00.178+00:00",
    "ended_at": "2026-11-06T16:11:04.824+00:00",
    "actor_type": null,
    "actor_id": null
  },
  "events": [
    {
      "seq": 0,
      "name": "contract-review-agent",
      "type": "run",
      "error": null,
      "input": "Review Southern Fixture Co's supplier agreement (MSA-1044) before signature.",
      "phase": "start",
      "output": null,
      "run_id": "sbx-contract-review-39fb850e9618",
      "status": "running",
      "ts_end": "2026-11-06T16:11:04.824Z",
      "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.000202,
        "sandbox_tools": true,
        "scenario_seed": "contract-review-agent:2026-11-06:86"
      },
      "ts_start": "2026-11-06T16:11:00.178Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "ac49823053d2adc7692576af3a10de98964f326210e17bd28339459804cfc063"
    },
    {
      "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-39fb850e9618",
      "ts_end": "2026-11-06T16:11:01.825Z",
      "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 Southern Fixture Co's supplier agreement (MSA-1044) before signature."
          }
        ]
      },
      "span_id": "l1",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "doc_id": "MSA-1044"
            },
            "tool_name": "diff_against_template",
            "tool_call_id": "call_2HCrF3GujoZ0fCk3zggwR2rx"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-11-06T16:11:00.178Z",
      "latency_ms": 1647,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "82e7c31dc2ca0b05722826ee8fd1de5efa96f4d44ca12bc8a9678df1cbb9ca8a"
    },
    {
      "seq": 2,
      "type": "tool",
      "error": null,
      "input": {
        "doc_id": "MSA-1044"
      },
      "output": {
        "doc_id": "MSA-1044",
        "deviations": [
          {
            "text": "Supplier may use customer data to improve its services.",
            "clause": "9.4 Data"
          }
        ]
      },
      "run_id": "sbx-contract-review-39fb850e9618",
      "ts_end": "2026-11-06T16:11:01.843Z",
      "span_id": "t1",
      "ts_start": "2026-11-06T16:11:01.825Z",
      "tool_name": "diff_against_template",
      "latency_ms": 18,
      "tool_call_id": "call_2HCrF3GujoZ0fCk3zggwR2rx",
      "parent_span_id": "l1",
      "schema_version": 1,
      "_hash": "93b2060bc98dffa65099f69cf5813fd317156c29e2a3b5e32609fb9603d0bed7"
    },
    {
      "seq": 3,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "gpt-4o-mini",
        "provider": "openai"
      },
      "usage": {
        "input_tokens": 297,
        "total_tokens": 354,
        "output_tokens": 57
      },
      "run_id": "sbx-contract-review-39fb850e9618",
      "ts_end": "2026-11-06T16:11:03.326Z",
      "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 Southern Fixture Co's supplier agreement (MSA-1044) before signature."
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "doc_id": "MSA-1044"
                },
                "toolName": "diff_against_template",
                "toolCallId": "call_2HCrF3GujoZ0fCk3zggwR2rx"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "doc_id": "MSA-1044",
                    "deviations": [
                      {
                        "text": "Supplier may use customer data to improve its services.",
                        "clause": "9.4 Data"
                      }
                    ]
                  }
                },
                "toolName": "diff_against_template",
                "toolCallId": "call_2HCrF3GujoZ0fCk3zggwR2rx"
              }
            ]
          }
        ]
      },
      "span_id": "l2",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "clause": "9.4 Data",
              "doc_id": "MSA-1044",
              "reason": "The clause allows the supplier to use customer data, which may pose privacy risks and conflicts with data protection regulations.",
              "severity": "medium"
            },
            "tool_name": "flag_clause",
            "tool_call_id": "call_ShdyBK2Tsbornaxlc35hejcp"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-11-06T16:11:01.843Z",
      "latency_ms": 1482,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "89c3bf0a0d331b80524f90d9f4c60db5fcc041b72f9ef163bbbf400359419b20"
    },
    {
      "seq": 4,
      "type": "tool",
      "error": null,
      "input": {
        "clause": "9.4 Data",
        "doc_id": "MSA-1044",
        "reason": "The clause allows the supplier to use customer data, which may pose privacy risks and conflicts with data protection regulations.",
        "severity": "medium"
      },
      "output": {
        "clause": "9.4 Data",
        "flagged": true,
        "severity": "medium"
      },
      "run_id": "sbx-contract-review-39fb850e9618",
      "ts_end": "2026-11-06T16:11:03.422Z",
      "span_id": "t2",
      "ts_start": "2026-11-06T16:11:03.326Z",
      "tool_name": "flag_clause",
      "latency_ms": 96,
      "tool_call_id": "call_ShdyBK2Tsbornaxlc35hejcp",
      "parent_span_id": "l2",
      "schema_version": 1,
      "_hash": "ae9073775cd9c301a8c91c7e619b22f2a1a7b38d40022fb61f6c435c91109874"
    },
    {
      "seq": 5,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "gpt-4o-mini",
        "provider": "openai"
      },
      "usage": {
        "input_tokens": 377,
        "total_tokens": 408,
        "output_tokens": 31
      },
      "run_id": "sbx-contract-review-39fb850e9618",
      "ts_end": "2026-11-06T16:11:04.824Z",
      "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 Southern Fixture Co's supplier agreement (MSA-1044) before signature."
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "doc_id": "MSA-1044"
                },
                "toolName": "diff_against_template",
                "toolCallId": "call_2HCrF3GujoZ0fCk3zggwR2rx"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "doc_id": "MSA-1044",
                    "deviations": [
                      {
                        "text": "Supplier may use customer data to improve its services.",
                        "clause": "9.4 Data"
                      }
                    ]
                  }
                },
                "toolName": "diff_against_template",
                "toolCallId": "call_2HCrF3GujoZ0fCk3zggwR2rx"
              }
            ]
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "clause": "9.4 Data",
                  "doc_id": "MSA-1044",
                  "reason": "The clause allows the supplier to use customer data, which may pose privacy risks and conflicts with data protection regulations.",
                  "severity": "medium"
                },
                "toolName": "flag_clause",
                "toolCallId": "call_ShdyBK2Tsbornaxlc35hejcp"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "clause": "9.4 Data",
                    "flagged": true,
                    "severity": "medium"
                  }
                },
                "toolName": "flag_clause",
                "toolCallId": "call_ShdyBK2Tsbornaxlc35hejcp"
              }
            ]
          }
        ]
      },
      "span_id": "l3",
      "response": {
        "text": "I reviewed Southern Fixture Co's supplier agreement and flagged clause 9.4 regarding data usage as a medium-risk deviation from Acme's template.",
        "reasoning": null,
        "tool_calls": [],
        "finish_reason": "stop"
      },
      "ts_start": "2026-11-06T16:11:03.422Z",
      "latency_ms": 1402,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "1393b7730022509681d98aa35882af8002094907dc50bde2f066bb16cb12d96a"
    },
    {
      "seq": 6,
      "name": "contract-review-agent",
      "type": "run",
      "error": null,
      "input": null,
      "phase": "end",
      "output": {
        "summary": "I reviewed Southern Fixture Co's supplier agreement and flagged clause 9.4 regarding data usage as a medium-risk deviation from Acme's template."
      },
      "run_id": "sbx-contract-review-39fb850e9618",
      "status": "success",
      "ts_end": "2026-11-06T16:11:04.824Z",
      "span_id": "re",
      "metadata": {
        "demo_agent": true,
        "sandbox_tools": true
      },
      "ts_start": "2026-11-06T16:11:04.824Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "41a6b0efa567fa2ddeb1690c5d7fdbe5e6b68ebd079bdee789852ab758a24fb6"
    }
  ]
}