{
  "$schema": "runback.audit/v2",
  "manifest": {
    "run_id": "sbx-contract-review-fbf59ba8ccbd",
    "generated_at": "2026-11-07T07:28:27.515Z",
    "event_count": 9,
    "algorithm": "sha256-chain",
    "content_digest": "4f0383f56caf830ba1a6fef5c213713802d0a62838b81ea8a615e571bf0f2479",
    "replay": {
      "cassette_digest": "76a4c3bdedb992af907bc497f206ca1bcd6074a62cd10d12aa2224d701a31247",
      "entry_count": 7,
      "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": "17c64d5f1ad953bd77d0b01c7a1ff5bccb920f17c540b1e9fcffe68d4114608c519a0c460a954559acb021f7015462b83d761d40e81d972584c6c02377854d06",
      "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-fbf59ba8ccbd",
    "name": "contract-review-agent",
    "status": "success",
    "input": "Review Bluegum Example Foods' supplier agreement (MSA-3610) before signature.",
    "output": {
      "summary": "I've reviewed Bluegum Example Foods' MSA-3610 and flagged three risky deviations: a medium-severity auto-renewal term with excessive notice period, and two high-severity issues involving inadequate liability caps and unauthorized customer data usage."
    },
    "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": "claude-haiku-4-5",
      "demo_agent": true,
      "est_cost_usd": 0.006241,
      "sandbox_tools": true,
      "scenario_seed": "contract-review-agent:2026-11-06:38"
    },
    "step_count": 3,
    "total_tokens": 4065,
    "started_at": "2026-11-06T07:10:48.537+00:00",
    "ended_at": "2026-11-06T07:10:55.012+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-3610) before signature.",
      "phase": "start",
      "output": null,
      "run_id": "sbx-contract-review-fbf59ba8ccbd",
      "status": "running",
      "ts_end": "2026-11-06T07:10:55.012Z",
      "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": "claude-haiku-4-5",
        "demo_agent": true,
        "est_cost_usd": 0.006241,
        "sandbox_tools": true,
        "scenario_seed": "contract-review-agent:2026-11-06:38"
      },
      "ts_start": "2026-11-06T07:10:48.537Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "94f24e48e5e6590788e28811f11a0a827e56eb56f65f345f3887c5822f4813e1"
    },
    {
      "seq": 1,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "claude-haiku-4-5",
        "provider": "anthropic"
      },
      "usage": {
        "input_tokens": 857,
        "total_tokens": 951,
        "output_tokens": 94
      },
      "run_id": "sbx-contract-review-fbf59ba8ccbd",
      "ts_end": "2026-11-06T07:10:49.925Z",
      "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-3610) before signature."
          }
        ]
      },
      "span_id": "l1",
      "response": {
        "text": "I'll review the Bluegum Example Foods' supplier agreement by comparing it against Acme's template and flagging any risky deviations.",
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "doc_id": "MSA-3610"
            },
            "tool_name": "diff_against_template",
            "tool_call_id": "toolu_01SQU5jJoAti56T7vgWMZUoD"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-11-06T07:10:48.537Z",
      "latency_ms": 1388,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "cb5d80e9134fa56c36d0d8e4ea1e5d56a0003e67407d18e6650a720ba5e25d55"
    },
    {
      "seq": 2,
      "type": "tool",
      "error": null,
      "input": {
        "doc_id": "MSA-3610"
      },
      "output": {
        "doc_id": "MSA-3610",
        "deviations": [
          {
            "text": "The agreement auto-renews for 36 months unless cancelled 180 days prior.",
            "clause": "8.1 Term"
          },
          {
            "text": "Supplier's liability is capped at fees paid in the prior month.",
            "clause": "12.3 Indemnity"
          },
          {
            "text": "Supplier may use customer data to improve its services.",
            "clause": "9.4 Data"
          }
        ]
      },
      "run_id": "sbx-contract-review-fbf59ba8ccbd",
      "ts_end": "2026-11-06T07:10:50.071Z",
      "span_id": "t1",
      "ts_start": "2026-11-06T07:10:49.926Z",
      "tool_name": "diff_against_template",
      "latency_ms": 145,
      "tool_call_id": "toolu_01SQU5jJoAti56T7vgWMZUoD",
      "parent_span_id": "l1",
      "schema_version": 1,
      "_hash": "16f0d74fe749125cf34ba038bfa99f8c131fd0a3b1e8f290bf54ce3d180f2867"
    },
    {
      "seq": 3,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "claude-haiku-4-5",
        "provider": "anthropic"
      },
      "usage": {
        "input_tokens": 1064,
        "total_tokens": 1455,
        "output_tokens": 391
      },
      "run_id": "sbx-contract-review-fbf59ba8ccbd",
      "ts_end": "2026-11-06T07:10:53.674Z",
      "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-3610) before signature."
          },
          {
            "role": "assistant",
            "content": [
              {
                "text": "I'll review the Bluegum Example Foods' supplier agreement by comparing it against Acme's template and flagging any risky deviations.",
                "type": "text"
              },
              {
                "type": "tool-call",
                "input": {
                  "doc_id": "MSA-3610"
                },
                "toolName": "diff_against_template",
                "toolCallId": "toolu_01SQU5jJoAti56T7vgWMZUoD"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "doc_id": "MSA-3610",
                    "deviations": [
                      {
                        "text": "The agreement auto-renews for 36 months unless cancelled 180 days prior.",
                        "clause": "8.1 Term"
                      },
                      {
                        "text": "Supplier's liability is capped at fees paid in the prior month.",
                        "clause": "12.3 Indemnity"
                      },
                      {
                        "text": "Supplier may use customer data to improve its services.",
                        "clause": "9.4 Data"
                      }
                    ]
                  }
                },
                "toolName": "diff_against_template",
                "toolCallId": "toolu_01SQU5jJoAti56T7vgWMZUoD"
              }
            ]
          }
        ]
      },
      "span_id": "l2",
      "response": {
        "text": "Now I'll flag each risky deviation:",
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "clause": "8.1 Term",
              "doc_id": "MSA-3610",
              "reason": "Auto-renewal with 180-day cancellation notice creates long lock-in period; template requires shorter notice or explicit renewal",
              "severity": "medium"
            },
            "tool_name": "flag_clause",
            "tool_call_id": "toolu_01KFTVrJzJ7JVt2U1w1hyFJt"
          },
          {
            "input": {
              "clause": "12.3 Indemnity",
              "doc_id": "MSA-3610",
              "reason": "Liability cap of one month's fees is severely restrictive and inadequate for potential damages; template allows higher caps",
              "severity": "high"
            },
            "tool_name": "flag_clause",
            "tool_call_id": "toolu_01WYEpMseniSGa3Q8mJydnkM"
          },
          {
            "input": {
              "clause": "9.4 Data",
              "doc_id": "MSA-3610",
              "reason": "Supplier's unrestricted right to use customer data for service improvement violates data protection standards; template prohibits secondary use",
              "severity": "high"
            },
            "tool_name": "flag_clause",
            "tool_call_id": "toolu_01KUZ5deNHraZ5YMmssSFZXB"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-11-06T07:10:50.071Z",
      "latency_ms": 3603,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "980c513656fb05eb43f66e0c0d416bec15e70a3682dc35641b0fdf6a19a1b2cd"
    },
    {
      "seq": 4,
      "type": "tool",
      "error": null,
      "input": {
        "clause": "8.1 Term",
        "doc_id": "MSA-3610",
        "reason": "Auto-renewal with 180-day cancellation notice creates long lock-in period; template requires shorter notice or explicit renewal",
        "severity": "medium"
      },
      "output": {
        "clause": "8.1 Term",
        "flagged": true,
        "severity": "medium"
      },
      "run_id": "sbx-contract-review-fbf59ba8ccbd",
      "ts_end": "2026-11-06T07:10:53.699Z",
      "span_id": "t2",
      "ts_start": "2026-11-06T07:10:53.674Z",
      "tool_name": "flag_clause",
      "latency_ms": 25,
      "tool_call_id": "toolu_01KFTVrJzJ7JVt2U1w1hyFJt",
      "parent_span_id": "l2",
      "schema_version": 1,
      "_hash": "36d4a3dd30cf74909b9ee3ef76cb8896c6a6b13ceec470f2d56769bc46549e42"
    },
    {
      "seq": 5,
      "type": "tool",
      "error": null,
      "input": {
        "clause": "12.3 Indemnity",
        "doc_id": "MSA-3610",
        "reason": "Liability cap of one month's fees is severely restrictive and inadequate for potential damages; template allows higher caps",
        "severity": "high"
      },
      "output": {
        "clause": "12.3 Indemnity",
        "flagged": true,
        "severity": "high"
      },
      "run_id": "sbx-contract-review-fbf59ba8ccbd",
      "ts_end": "2026-11-06T07:10:53.731Z",
      "span_id": "t3",
      "ts_start": "2026-11-06T07:10:53.699Z",
      "tool_name": "flag_clause",
      "latency_ms": 32,
      "tool_call_id": "toolu_01WYEpMseniSGa3Q8mJydnkM",
      "parent_span_id": "l2",
      "schema_version": 1,
      "_hash": "a9de2bb53c430c316932a774a6e600fac0b3b16aed68affd5f58a2fc2c8e7268"
    },
    {
      "seq": 6,
      "type": "tool",
      "error": null,
      "input": {
        "clause": "9.4 Data",
        "doc_id": "MSA-3610",
        "reason": "Supplier's unrestricted right to use customer data for service improvement violates data protection standards; template prohibits secondary use",
        "severity": "high"
      },
      "output": {
        "clause": "9.4 Data",
        "flagged": true,
        "severity": "high"
      },
      "run_id": "sbx-contract-review-fbf59ba8ccbd",
      "ts_end": "2026-11-06T07:10:53.756Z",
      "span_id": "t4",
      "ts_start": "2026-11-06T07:10:53.731Z",
      "tool_name": "flag_clause",
      "latency_ms": 25,
      "tool_call_id": "toolu_01KUZ5deNHraZ5YMmssSFZXB",
      "parent_span_id": "l2",
      "schema_version": 1,
      "_hash": "3ead1922ecb5c187841ae9358ed4459fdfff8d045dbddbe3c44488854892291b"
    },
    {
      "seq": 7,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "claude-haiku-4-5",
        "provider": "anthropic"
      },
      "usage": {
        "input_tokens": 1600,
        "total_tokens": 1659,
        "output_tokens": 59
      },
      "run_id": "sbx-contract-review-fbf59ba8ccbd",
      "ts_end": "2026-11-06T07:10:55.012Z",
      "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-3610) before signature."
          },
          {
            "role": "assistant",
            "content": [
              {
                "text": "I'll review the Bluegum Example Foods' supplier agreement by comparing it against Acme's template and flagging any risky deviations.",
                "type": "text"
              },
              {
                "type": "tool-call",
                "input": {
                  "doc_id": "MSA-3610"
                },
                "toolName": "diff_against_template",
                "toolCallId": "toolu_01SQU5jJoAti56T7vgWMZUoD"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "doc_id": "MSA-3610",
                    "deviations": [
                      {
                        "text": "The agreement auto-renews for 36 months unless cancelled 180 days prior.",
                        "clause": "8.1 Term"
                      },
                      {
                        "text": "Supplier's liability is capped at fees paid in the prior month.",
                        "clause": "12.3 Indemnity"
                      },
                      {
                        "text": "Supplier may use customer data to improve its services.",
                        "clause": "9.4 Data"
                      }
                    ]
                  }
                },
                "toolName": "diff_against_template",
                "toolCallId": "toolu_01SQU5jJoAti56T7vgWMZUoD"
              }
            ]
          },
          {
            "role": "assistant",
            "content": [
              {
                "text": "Now I'll flag each risky deviation:",
                "type": "text"
              },
              {
                "type": "tool-call",
                "input": {
                  "clause": "8.1 Term",
                  "doc_id": "MSA-3610",
                  "reason": "Auto-renewal with 180-day cancellation notice creates long lock-in period; template requires shorter notice or explicit renewal",
                  "severity": "medium"
                },
                "toolName": "flag_clause",
                "toolCallId": "toolu_01KFTVrJzJ7JVt2U1w1hyFJt"
              },
              {
                "type": "tool-call",
                "input": {
                  "clause": "12.3 Indemnity",
                  "doc_id": "MSA-3610",
                  "reason": "Liability cap of one month's fees is severely restrictive and inadequate for potential damages; template allows higher caps",
                  "severity": "high"
                },
                "toolName": "flag_clause",
                "toolCallId": "toolu_01WYEpMseniSGa3Q8mJydnkM"
              },
              {
                "type": "tool-call",
                "input": {
                  "clause": "9.4 Data",
                  "doc_id": "MSA-3610",
                  "reason": "Supplier's unrestricted right to use customer data for service improvement violates data protection standards; template prohibits secondary use",
                  "severity": "high"
                },
                "toolName": "flag_clause",
                "toolCallId": "toolu_01KUZ5deNHraZ5YMmssSFZXB"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "clause": "8.1 Term",
                    "flagged": true,
                    "severity": "medium"
                  }
                },
                "toolName": "flag_clause",
                "toolCallId": "toolu_01KFTVrJzJ7JVt2U1w1hyFJt"
              },
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "clause": "12.3 Indemnity",
                    "flagged": true,
                    "severity": "high"
                  }
                },
                "toolName": "flag_clause",
                "toolCallId": "toolu_01WYEpMseniSGa3Q8mJydnkM"
              },
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "clause": "9.4 Data",
                    "flagged": true,
                    "severity": "high"
                  }
                },
                "toolName": "flag_clause",
                "toolCallId": "toolu_01KUZ5deNHraZ5YMmssSFZXB"
              }
            ]
          }
        ]
      },
      "span_id": "l3",
      "response": {
        "text": "I've reviewed Bluegum Example Foods' MSA-3610 and flagged three risky deviations: a medium-severity auto-renewal term with excessive notice period, and two high-severity issues involving inadequate liability caps and unauthorized customer data usage.",
        "reasoning": null,
        "tool_calls": [],
        "finish_reason": "stop"
      },
      "ts_start": "2026-11-06T07:10:53.756Z",
      "latency_ms": 1256,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "ded5c57d40808aa73cd72d88357c0851f179b933a2d3fef1490056f8abd68bd6"
    },
    {
      "seq": 8,
      "name": "contract-review-agent",
      "type": "run",
      "error": null,
      "input": null,
      "phase": "end",
      "output": {
        "summary": "I've reviewed Bluegum Example Foods' MSA-3610 and flagged three risky deviations: a medium-severity auto-renewal term with excessive notice period, and two high-severity issues involving inadequate liability caps and unauthorized customer data usage."
      },
      "run_id": "sbx-contract-review-fbf59ba8ccbd",
      "status": "success",
      "ts_end": "2026-11-06T07:10:55.012Z",
      "span_id": "re",
      "metadata": {
        "demo_agent": true,
        "sandbox_tools": true
      },
      "ts_start": "2026-11-06T07:10:55.012Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "4f0383f56caf830ba1a6fef5c213713802d0a62838b81ea8a615e571bf0f2479"
    }
  ]
}