{
  "$schema": "runback.audit/v2",
  "manifest": {
    "run_id": "sbx-contract-review-6e7fdd68cbf1",
    "generated_at": "2026-11-07T07:28:24.763Z",
    "event_count": 9,
    "algorithm": "sha256-chain",
    "content_digest": "9c266b2b0ac266dd042b75a6e6545274be72ab2f05b42b6ec1071e9a08bbf6fa",
    "replay": {
      "cassette_digest": "3b41d903bf10396b6cabc861613643aec3a3de3a629101fe1dbbae15ff4d7310",
      "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": "136336f92831a90769ab87417599ad04ec01868b3636f0a10082570c057bfc15bbada2fa1f9e028ddf2faf10b1da328c72552ae89524355bda3caea453c14207",
      "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-6e7fdd68cbf1",
    "name": "contract-review-agent",
    "status": "success",
    "input": "Review Bluegum Example Foods' supplier agreement (MSA-1461) before signature.",
    "output": {
      "summary": "I reviewed Bluegum Example Foods' supplier agreement and flagged three deviations: a medium risk for the governing law clause, a low risk for the payment terms, and a high risk for the indemnity clause."
    },
    "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.000307,
      "sandbox_tools": true,
      "scenario_seed": "contract-review-agent:2026-11-07:6"
    },
    "step_count": 3,
    "total_tokens": 1372,
    "started_at": "2026-11-07T01:10:52.836+00:00",
    "ended_at": "2026-11-07T01:10:59.924+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-1461) before signature.",
      "phase": "start",
      "output": null,
      "run_id": "sbx-contract-review-6e7fdd68cbf1",
      "status": "running",
      "ts_end": "2026-11-07T01:10:59.924Z",
      "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.000307,
        "sandbox_tools": true,
        "scenario_seed": "contract-review-agent:2026-11-07:6"
      },
      "ts_start": "2026-11-07T01:10:52.836Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "bc2b41602e188e4b0a3d44a8c8021ff0b4e6706670decfe672325c3756189f60"
    },
    {
      "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-6e7fdd68cbf1",
      "ts_end": "2026-11-07T01:10:54.234Z",
      "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-1461) before signature."
          }
        ]
      },
      "span_id": "l1",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "doc_id": "MSA-1461"
            },
            "tool_name": "diff_against_template",
            "tool_call_id": "call_35UBmHlXdC4DOXrWDKS8Dkyr"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-11-07T01:10:52.836Z",
      "latency_ms": 1398,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "ff65279758c89edff5f5f5b539dca4e62e179f472d233cf4f3cf7e60d47f5ce7"
    },
    {
      "seq": 2,
      "type": "tool",
      "error": null,
      "input": {
        "doc_id": "MSA-1461"
      },
      "output": {
        "doc_id": "MSA-1461",
        "deviations": [
          {
            "text": "This agreement is governed by the laws of the State of Delaware.",
            "clause": "15.2 Governing law"
          },
          {
            "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-6e7fdd68cbf1",
      "ts_end": "2026-11-07T01:10:54.265Z",
      "span_id": "t1",
      "ts_start": "2026-11-07T01:10:54.234Z",
      "tool_name": "diff_against_template",
      "latency_ms": 31,
      "tool_call_id": "call_35UBmHlXdC4DOXrWDKS8Dkyr",
      "parent_span_id": "l1",
      "schema_version": 1,
      "_hash": "6d160003ed2ee9647de5ce1f87961f8e73efd3ef609466acae2745943e6462c9"
    },
    {
      "seq": 3,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "gpt-4o-mini",
        "provider": "openai"
      },
      "usage": {
        "input_tokens": 348,
        "total_tokens": 508,
        "output_tokens": 160
      },
      "run_id": "sbx-contract-review-6e7fdd68cbf1",
      "ts_end": "2026-11-07T01:10:57.928Z",
      "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-1461) before signature."
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "doc_id": "MSA-1461"
                },
                "toolName": "diff_against_template",
                "toolCallId": "call_35UBmHlXdC4DOXrWDKS8Dkyr"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "doc_id": "MSA-1461",
                    "deviations": [
                      {
                        "text": "This agreement is governed by the laws of the State of Delaware.",
                        "clause": "15.2 Governing law"
                      },
                      {
                        "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_35UBmHlXdC4DOXrWDKS8Dkyr"
              }
            ]
          }
        ]
      },
      "span_id": "l2",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "clause": "15.2 Governing law",
              "doc_id": "MSA-1461",
              "reason": "Governing law may not align with Acme's preferred jurisdiction.",
              "severity": "medium"
            },
            "tool_name": "flag_clause",
            "tool_call_id": "call_wXnzgBJEPJzhuCPKR9R4RCrU"
          },
          {
            "input": {
              "clause": "6.1 Payment",
              "doc_id": "MSA-1461",
              "reason": "30-day payment terms may affect cash flow.",
              "severity": "low"
            },
            "tool_name": "flag_clause",
            "tool_call_id": "call_Hz2c6oWIwKRpW0s0CBewbHs2"
          },
          {
            "input": {
              "clause": "12.3 Indemnity",
              "doc_id": "MSA-1461",
              "reason": "Capping liability at fees paid in the prior month poses significant risk.",
              "severity": "high"
            },
            "tool_name": "flag_clause",
            "tool_call_id": "call_xoH4iEUdP8ioS5B51PBhI4LF"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-11-07T01:10:54.265Z",
      "latency_ms": 3663,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "950bca456fef75e1c4e4a6ef214106412b8df37b394a34a8353687b833227053"
    },
    {
      "seq": 4,
      "type": "tool",
      "error": null,
      "input": {
        "clause": "15.2 Governing law",
        "doc_id": "MSA-1461",
        "reason": "Governing law may not align with Acme's preferred jurisdiction.",
        "severity": "medium"
      },
      "output": {
        "clause": "15.2 Governing law",
        "flagged": true,
        "severity": "medium"
      },
      "run_id": "sbx-contract-review-6e7fdd68cbf1",
      "ts_end": "2026-11-07T01:10:58.010Z",
      "span_id": "t2",
      "ts_start": "2026-11-07T01:10:57.928Z",
      "tool_name": "flag_clause",
      "latency_ms": 82,
      "tool_call_id": "call_wXnzgBJEPJzhuCPKR9R4RCrU",
      "parent_span_id": "l2",
      "schema_version": 1,
      "_hash": "e07548043d4958249feee0537d25f223d4b08670805fd11ca1132d25a44e790b"
    },
    {
      "seq": 5,
      "type": "tool",
      "error": null,
      "input": {
        "clause": "6.1 Payment",
        "doc_id": "MSA-1461",
        "reason": "30-day payment terms may affect cash flow.",
        "severity": "low"
      },
      "output": {
        "clause": "6.1 Payment",
        "flagged": true,
        "severity": "low"
      },
      "run_id": "sbx-contract-review-6e7fdd68cbf1",
      "ts_end": "2026-11-07T01:10:58.042Z",
      "span_id": "t3",
      "ts_start": "2026-11-07T01:10:58.010Z",
      "tool_name": "flag_clause",
      "latency_ms": 32,
      "tool_call_id": "call_Hz2c6oWIwKRpW0s0CBewbHs2",
      "parent_span_id": "l2",
      "schema_version": 1,
      "_hash": "2c20c6024ae198f654e2d485e6c3e51dd23207f7b96027c5af05b4cd9ba820be"
    },
    {
      "seq": 6,
      "type": "tool",
      "error": null,
      "input": {
        "clause": "12.3 Indemnity",
        "doc_id": "MSA-1461",
        "reason": "Capping liability at fees paid in the prior month poses significant risk.",
        "severity": "high"
      },
      "output": {
        "clause": "12.3 Indemnity",
        "flagged": true,
        "severity": "high"
      },
      "run_id": "sbx-contract-review-6e7fdd68cbf1",
      "ts_end": "2026-11-07T01:10:58.063Z",
      "span_id": "t4",
      "ts_start": "2026-11-07T01:10:58.042Z",
      "tool_name": "flag_clause",
      "latency_ms": 21,
      "tool_call_id": "call_xoH4iEUdP8ioS5B51PBhI4LF",
      "parent_span_id": "l2",
      "schema_version": 1,
      "_hash": "59f91e5110ec3ac826f4617d57e1c7b285ee4df13ab2b455e31209623574bdaa"
    },
    {
      "seq": 7,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "gpt-4o-mini",
        "provider": "openai"
      },
      "usage": {
        "input_tokens": 567,
        "total_tokens": 610,
        "output_tokens": 43
      },
      "run_id": "sbx-contract-review-6e7fdd68cbf1",
      "ts_end": "2026-11-07T01:10:59.924Z",
      "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-1461) before signature."
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "doc_id": "MSA-1461"
                },
                "toolName": "diff_against_template",
                "toolCallId": "call_35UBmHlXdC4DOXrWDKS8Dkyr"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "doc_id": "MSA-1461",
                    "deviations": [
                      {
                        "text": "This agreement is governed by the laws of the State of Delaware.",
                        "clause": "15.2 Governing law"
                      },
                      {
                        "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_35UBmHlXdC4DOXrWDKS8Dkyr"
              }
            ]
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "clause": "15.2 Governing law",
                  "doc_id": "MSA-1461",
                  "reason": "Governing law may not align with Acme's preferred jurisdiction.",
                  "severity": "medium"
                },
                "toolName": "flag_clause",
                "toolCallId": "call_wXnzgBJEPJzhuCPKR9R4RCrU"
              },
              {
                "type": "tool-call",
                "input": {
                  "clause": "6.1 Payment",
                  "doc_id": "MSA-1461",
                  "reason": "30-day payment terms may affect cash flow.",
                  "severity": "low"
                },
                "toolName": "flag_clause",
                "toolCallId": "call_Hz2c6oWIwKRpW0s0CBewbHs2"
              },
              {
                "type": "tool-call",
                "input": {
                  "clause": "12.3 Indemnity",
                  "doc_id": "MSA-1461",
                  "reason": "Capping liability at fees paid in the prior month poses significant risk.",
                  "severity": "high"
                },
                "toolName": "flag_clause",
                "toolCallId": "call_xoH4iEUdP8ioS5B51PBhI4LF"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "clause": "15.2 Governing law",
                    "flagged": true,
                    "severity": "medium"
                  }
                },
                "toolName": "flag_clause",
                "toolCallId": "call_wXnzgBJEPJzhuCPKR9R4RCrU"
              },
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "clause": "6.1 Payment",
                    "flagged": true,
                    "severity": "low"
                  }
                },
                "toolName": "flag_clause",
                "toolCallId": "call_Hz2c6oWIwKRpW0s0CBewbHs2"
              },
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "clause": "12.3 Indemnity",
                    "flagged": true,
                    "severity": "high"
                  }
                },
                "toolName": "flag_clause",
                "toolCallId": "call_xoH4iEUdP8ioS5B51PBhI4LF"
              }
            ]
          }
        ]
      },
      "span_id": "l3",
      "response": {
        "text": "I reviewed Bluegum Example Foods' supplier agreement and flagged three deviations: a medium risk for the governing law clause, a low risk for the payment terms, and a high risk for the indemnity clause.",
        "reasoning": null,
        "tool_calls": [],
        "finish_reason": "stop"
      },
      "ts_start": "2026-11-07T01:10:58.063Z",
      "latency_ms": 1861,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "e698666755809c6a160df64508ee8343d7d605d44fc46aabb5dae90f9103f064"
    },
    {
      "seq": 8,
      "name": "contract-review-agent",
      "type": "run",
      "error": null,
      "input": null,
      "phase": "end",
      "output": {
        "summary": "I reviewed Bluegum Example Foods' supplier agreement and flagged three deviations: a medium risk for the governing law clause, a low risk for the payment terms, and a high risk for the indemnity clause."
      },
      "run_id": "sbx-contract-review-6e7fdd68cbf1",
      "status": "success",
      "ts_end": "2026-11-07T01:10:59.924Z",
      "span_id": "re",
      "metadata": {
        "demo_agent": true,
        "sandbox_tools": true
      },
      "ts_start": "2026-11-07T01:10:59.924Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "9c266b2b0ac266dd042b75a6e6545274be72ab2f05b42b6ec1071e9a08bbf6fa"
    }
  ]
}