{
  "$schema": "runback.audit/v2",
  "manifest": {
    "run_id": "sbx-contract-review-6ab969c1a438",
    "generated_at": "2026-11-07T07:28:28.610Z",
    "event_count": 7,
    "algorithm": "sha256-chain",
    "content_digest": "a31f89a0e6675f85790a4c4a5cccdc12a5357b85c8331a38b8a6ed31627dde14",
    "replay": {
      "cassette_digest": "bfe6e28e9b4ee098d34347b9b1b5285c93d99b8925864a2701771fa0e1b20727",
      "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": "7bc72d1bf0ded2e3734e5571ec86bca6dbc57f68263b48546d92328ef706682464297087b97525166e0f19ef79ff182350785e0477dd681703a2d69291465807",
      "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-6ab969c1a438",
    "name": "contract-review-agent",
    "status": "success",
    "input": "Review Wattle Sandbox Pty Ltd's supplier agreement (MSA-8690) before signature.",
    "output": {
      "summary": "I reviewed Wattle Sandbox Pty Ltd's supplier agreement and flagged the payment terms in Clause 6.1 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.000196,
      "sandbox_tools": true,
      "scenario_seed": "contract-review-agent:2026-11-06:102"
    },
    "step_count": 3,
    "total_tokens": 998,
    "started_at": "2026-11-06T19:10:54.639+00:00",
    "ended_at": "2026-11-06T19:11:00.624+00:00",
    "actor_type": null,
    "actor_id": null
  },
  "events": [
    {
      "seq": 0,
      "name": "contract-review-agent",
      "type": "run",
      "error": null,
      "input": "Review Wattle Sandbox Pty Ltd's supplier agreement (MSA-8690) before signature.",
      "phase": "start",
      "output": null,
      "run_id": "sbx-contract-review-6ab969c1a438",
      "status": "running",
      "ts_end": "2026-11-06T19:11:00.624Z",
      "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.000196,
        "sandbox_tools": true,
        "scenario_seed": "contract-review-agent:2026-11-06:102"
      },
      "ts_start": "2026-11-06T19:10:54.639Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "2feb177155e7c7f382c36e2f21012f42dc0c20bb44d22c379afc382661b9d2ae"
    },
    {
      "seq": 1,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "gpt-4o-mini",
        "provider": "openai"
      },
      "usage": {
        "input_tokens": 233,
        "total_tokens": 255,
        "output_tokens": 22
      },
      "run_id": "sbx-contract-review-6ab969c1a438",
      "ts_end": "2026-11-06T19:10:57.052Z",
      "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 Wattle Sandbox Pty Ltd's supplier agreement (MSA-8690) before signature."
          }
        ]
      },
      "span_id": "l1",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "doc_id": "MSA-8690"
            },
            "tool_name": "diff_against_template",
            "tool_call_id": "call_txrw02Hc5dXLWLvJS5z51k7H"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-11-06T19:10:54.639Z",
      "latency_ms": 2413,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "ae03793eaaf089e8c4b091cf753127f2762934fb44e4c4bbf4e1534149406886"
    },
    {
      "seq": 2,
      "type": "tool",
      "error": null,
      "input": {
        "doc_id": "MSA-8690"
      },
      "output": {
        "doc_id": "MSA-8690",
        "deviations": [
          {
            "text": "Invoices are payable within 30 days.",
            "clause": "6.1 Payment"
          }
        ]
      },
      "run_id": "sbx-contract-review-6ab969c1a438",
      "ts_end": "2026-11-06T19:10:57.135Z",
      "span_id": "t1",
      "ts_start": "2026-11-06T19:10:57.053Z",
      "tool_name": "diff_against_template",
      "latency_ms": 82,
      "tool_call_id": "call_txrw02Hc5dXLWLvJS5z51k7H",
      "parent_span_id": "l1",
      "schema_version": 1,
      "_hash": "f3ba36edb43f6da1a6b6003dee5fce90321b09731a1548b783d2c916f9e94f96"
    },
    {
      "seq": 3,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "gpt-4o-mini",
        "provider": "openai"
      },
      "usage": {
        "input_tokens": 297,
        "total_tokens": 343,
        "output_tokens": 46
      },
      "run_id": "sbx-contract-review-6ab969c1a438",
      "ts_end": "2026-11-06T19:10:58.794Z",
      "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 Wattle Sandbox Pty Ltd's supplier agreement (MSA-8690) before signature."
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "doc_id": "MSA-8690"
                },
                "toolName": "diff_against_template",
                "toolCallId": "call_txrw02Hc5dXLWLvJS5z51k7H"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "doc_id": "MSA-8690",
                    "deviations": [
                      {
                        "text": "Invoices are payable within 30 days.",
                        "clause": "6.1 Payment"
                      }
                    ]
                  }
                },
                "toolName": "diff_against_template",
                "toolCallId": "call_txrw02Hc5dXLWLvJS5z51k7H"
              }
            ]
          }
        ]
      },
      "span_id": "l2",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "clause": "6.1 Payment",
              "doc_id": "MSA-8690",
              "reason": "Payment terms of 30 days may affect cash flow.",
              "severity": "medium"
            },
            "tool_name": "flag_clause",
            "tool_call_id": "call_AVQPbv7jLs7HgxiYoYJuVKIm"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-11-06T19:10:57.135Z",
      "latency_ms": 1659,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "2034d3e57352c845c224dee8be46a504718a20e2067a457bbf4bfaf7a1eae7fa"
    },
    {
      "seq": 4,
      "type": "tool",
      "error": null,
      "input": {
        "clause": "6.1 Payment",
        "doc_id": "MSA-8690",
        "reason": "Payment terms of 30 days may affect cash flow.",
        "severity": "medium"
      },
      "output": {
        "clause": "6.1 Payment",
        "flagged": true,
        "severity": "medium"
      },
      "run_id": "sbx-contract-review-6ab969c1a438",
      "ts_end": "2026-11-06T19:10:58.814Z",
      "span_id": "t2",
      "ts_start": "2026-11-06T19:10:58.794Z",
      "tool_name": "flag_clause",
      "latency_ms": 20,
      "tool_call_id": "call_AVQPbv7jLs7HgxiYoYJuVKIm",
      "parent_span_id": "l2",
      "schema_version": 1,
      "_hash": "4c5c1570febfac02b7c85fb8ca3ab2fbeddf4795d622953452cd756c16c5a799"
    },
    {
      "seq": 5,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "gpt-4o-mini",
        "provider": "openai"
      },
      "usage": {
        "input_tokens": 366,
        "total_tokens": 400,
        "output_tokens": 34
      },
      "run_id": "sbx-contract-review-6ab969c1a438",
      "ts_end": "2026-11-06T19:11:00.623Z",
      "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 Wattle Sandbox Pty Ltd's supplier agreement (MSA-8690) before signature."
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "doc_id": "MSA-8690"
                },
                "toolName": "diff_against_template",
                "toolCallId": "call_txrw02Hc5dXLWLvJS5z51k7H"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "doc_id": "MSA-8690",
                    "deviations": [
                      {
                        "text": "Invoices are payable within 30 days.",
                        "clause": "6.1 Payment"
                      }
                    ]
                  }
                },
                "toolName": "diff_against_template",
                "toolCallId": "call_txrw02Hc5dXLWLvJS5z51k7H"
              }
            ]
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "clause": "6.1 Payment",
                  "doc_id": "MSA-8690",
                  "reason": "Payment terms of 30 days may affect cash flow.",
                  "severity": "medium"
                },
                "toolName": "flag_clause",
                "toolCallId": "call_AVQPbv7jLs7HgxiYoYJuVKIm"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "clause": "6.1 Payment",
                    "flagged": true,
                    "severity": "medium"
                  }
                },
                "toolName": "flag_clause",
                "toolCallId": "call_AVQPbv7jLs7HgxiYoYJuVKIm"
              }
            ]
          }
        ]
      },
      "span_id": "l3",
      "response": {
        "text": "I reviewed Wattle Sandbox Pty Ltd's supplier agreement and flagged the payment terms in Clause 6.1 as a medium-risk deviation from Acme's template.",
        "reasoning": null,
        "tool_calls": [],
        "finish_reason": "stop"
      },
      "ts_start": "2026-11-06T19:10:58.814Z",
      "latency_ms": 1809,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "de621ea9c1fa209f6fc12ee6651b3091f26213504bbdb65302a521e5bcf06d83"
    },
    {
      "seq": 6,
      "name": "contract-review-agent",
      "type": "run",
      "error": null,
      "input": null,
      "phase": "end",
      "output": {
        "summary": "I reviewed Wattle Sandbox Pty Ltd's supplier agreement and flagged the payment terms in Clause 6.1 as a medium-risk deviation from Acme's template."
      },
      "run_id": "sbx-contract-review-6ab969c1a438",
      "status": "success",
      "ts_end": "2026-11-06T19:11:00.624Z",
      "span_id": "re",
      "metadata": {
        "demo_agent": true,
        "sandbox_tools": true
      },
      "ts_start": "2026-11-06T19:11:00.624Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "a31f89a0e6675f85790a4c4a5cccdc12a5357b85c8331a38b8a6ed31627dde14"
    }
  ]
}