{
  "$schema": "runback.audit/v2",
  "manifest": {
    "run_id": "sbx-billing-ffed625cfb0a",
    "generated_at": "2026-11-07T07:35:52.742Z",
    "event_count": 6,
    "algorithm": "sha256-chain",
    "content_digest": "315b1b8d819076042462c6d83a665f11458fa0f1cf5e444e20554f803f4ad4ed",
    "replay": {
      "cassette_digest": "8cd2cadb0513e274cf22927aea5d9d1511717518c9ce8ebe9ac9612e9f24efd5",
      "entry_count": 4,
      "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": "0b6b10bcdc5db7601559d9741a31d7fb2dbaf4caf64a490a6cc91326e4be068b37dbb03fe48e16ca6a325d0b9f2e072f1f494237d0b012e90834cd4d418c5607",
      "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-billing-ffed625cfb0a",
    "name": "billing-agent",
    "status": "error",
    "input": "Invoice INV-63671 for customer #6000 is 20 days overdue. Collect it.",
    "output": {
      "awaiting_approval": "52a5b777-1dd9-4fe3-8f1b-a7d7c05b8a4b"
    },
    "error": {
      "name": "ApprovalRequired",
      "message": "charge_card is waiting for a person to approve it; the sandbox agent stopped here."
    },
    "metadata": {
      "agent": {
        "description": "Charges overdue invoices. 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.00014,
      "sandbox_tools": true,
      "scenario_seed": "billing-agent:2026-11-04:81"
    },
    "step_count": 2,
    "total_tokens": 778,
    "started_at": "2026-11-04T15:11:00.701+00:00",
    "ended_at": "2026-11-04T15:11:04.447+00:00",
    "actor_type": null,
    "actor_id": null
  },
  "events": [
    {
      "seq": 0,
      "name": "billing-agent",
      "type": "run",
      "error": null,
      "input": "Invoice INV-63671 for customer #6000 is 20 days overdue. Collect it.",
      "phase": "start",
      "output": null,
      "run_id": "sbx-billing-ffed625cfb0a",
      "status": "running",
      "ts_end": "2026-11-04T15:11:04.447Z",
      "span_id": "r",
      "metadata": {
        "agent": {
          "description": "Charges overdue invoices. 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.00014,
        "sandbox_tools": true,
        "scenario_seed": "billing-agent:2026-11-04:81"
      },
      "ts_start": "2026-11-04T15:11:00.701Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "80ed59b1856d9d5b73a5c28a9f2893875197a24cb96fbc81944da78285ecd87d"
    },
    {
      "seq": 1,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "gpt-4o-mini",
        "provider": "openai"
      },
      "usage": {
        "input_tokens": 333,
        "total_tokens": 352,
        "output_tokens": 19
      },
      "run_id": "sbx-billing-ffed625cfb0a",
      "ts_end": "2026-11-04T15:11:02.692Z",
      "request": {
        "tools": [
          {
            "name": "get_invoice",
            "parameters": {
              "type": "object",
              "required": [
                "invoice_id"
              ],
              "properties": {
                "invoice_id": {
                  "type": "string",
                  "description": "Invoice id, e.g. INV-12345"
                }
              },
              "additionalProperties": false
            },
            "description": "Fetch an invoice and the customer's card status."
          },
          {
            "name": "charge_card",
            "parameters": {
              "type": "object",
              "required": [
                "customer_id",
                "invoice_id",
                "amount"
              ],
              "properties": {
                "amount": {
                  "type": "number",
                  "description": "Amount in AUD"
                },
                "invoice_id": {
                  "type": "string",
                  "description": "Invoice id"
                },
                "customer_id": {
                  "type": "number",
                  "description": "Customer id"
                }
              },
              "additionalProperties": false
            },
            "description": "Charge the card on file for an invoice, in AUD."
          },
          {
            "name": "send_payment_reminder",
            "parameters": {
              "type": "object",
              "required": [
                "customer_id",
                "invoice_id"
              ],
              "properties": {
                "invoice_id": {
                  "type": "string",
                  "description": "Invoice id"
                },
                "customer_id": {
                  "type": "number",
                  "description": "Customer id"
                }
              },
              "additionalProperties": false
            },
            "description": "Email the customer a reminder to update their payment details."
          },
          {
            "name": "handoff_notify_customer",
            "parameters": {
              "type": "object",
              "required": [
                "customer_id",
                "message"
              ],
              "properties": {
                "message": {
                  "type": "string",
                  "description": "What the customer needs to be told"
                },
                "customer_id": {
                  "type": "number",
                  "description": "Customer id"
                }
              },
              "additionalProperties": false
            },
            "description": "Hand the customer message to the notification agent, which runs as its own agent and picks SMS or email from the customer's contact preferences."
          }
        ],
        "params": {
          "temperature": 0,
          "max_output_tokens": 500
        },
        "system": "You are Acme's billing 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. Collect overdue invoices: check the invoice, charge the card on file when it is valid, and when it is not, make sure the customer is told — a payment reminder email, or the notification agent, which knows their SMS and email preferences. Use the tools to act; when you are done, reply with a one-sentence summary of what you did.",
        "messages": [
          {
            "role": "user",
            "content": "Invoice INV-63671 for customer #6000 is 20 days overdue. Collect it."
          }
        ]
      },
      "span_id": "l1",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "invoice_id": "INV-63671"
            },
            "tool_name": "get_invoice",
            "tool_call_id": "call_o8VHR8O4n7UhMNpxPZYevjU7"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-11-04T15:11:00.701Z",
      "latency_ms": 1990,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "3f5ae2534343240424636899e69a3c9deed114d4d656151e42d05ff21bc4a5cb"
    },
    {
      "seq": 2,
      "type": "tool",
      "error": null,
      "input": {
        "invoice_id": "INV-63671"
      },
      "output": {
        "amount_aud": 3412.22,
        "invoice_id": "INV-63671",
        "customer_id": 6000,
        "card_on_file": "valid",
        "days_overdue": 20
      },
      "run_id": "sbx-billing-ffed625cfb0a",
      "ts_end": "2026-11-04T15:11:02.802Z",
      "span_id": "t1",
      "ts_start": "2026-11-04T15:11:02.692Z",
      "tool_name": "get_invoice",
      "latency_ms": 110,
      "tool_call_id": "call_o8VHR8O4n7UhMNpxPZYevjU7",
      "parent_span_id": "l1",
      "schema_version": 1,
      "policy_evaluated": {
        "passed": true
      },
      "_hash": "68dbacce6534e46f2864d7c8cad206212b7385c1a81ac1219b3ff4e85923c9df"
    },
    {
      "seq": 3,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "gpt-4o-mini",
        "provider": "openai"
      },
      "usage": {
        "input_tokens": 393,
        "total_tokens": 426,
        "output_tokens": 33
      },
      "run_id": "sbx-billing-ffed625cfb0a",
      "ts_end": "2026-11-04T15:11:04.347Z",
      "request": {
        "tools": [
          {
            "name": "get_invoice",
            "parameters": {
              "type": "object",
              "required": [
                "invoice_id"
              ],
              "properties": {
                "invoice_id": {
                  "type": "string",
                  "description": "Invoice id, e.g. INV-12345"
                }
              },
              "additionalProperties": false
            },
            "description": "Fetch an invoice and the customer's card status."
          },
          {
            "name": "charge_card",
            "parameters": {
              "type": "object",
              "required": [
                "customer_id",
                "invoice_id",
                "amount"
              ],
              "properties": {
                "amount": {
                  "type": "number",
                  "description": "Amount in AUD"
                },
                "invoice_id": {
                  "type": "string",
                  "description": "Invoice id"
                },
                "customer_id": {
                  "type": "number",
                  "description": "Customer id"
                }
              },
              "additionalProperties": false
            },
            "description": "Charge the card on file for an invoice, in AUD."
          },
          {
            "name": "send_payment_reminder",
            "parameters": {
              "type": "object",
              "required": [
                "customer_id",
                "invoice_id"
              ],
              "properties": {
                "invoice_id": {
                  "type": "string",
                  "description": "Invoice id"
                },
                "customer_id": {
                  "type": "number",
                  "description": "Customer id"
                }
              },
              "additionalProperties": false
            },
            "description": "Email the customer a reminder to update their payment details."
          },
          {
            "name": "handoff_notify_customer",
            "parameters": {
              "type": "object",
              "required": [
                "customer_id",
                "message"
              ],
              "properties": {
                "message": {
                  "type": "string",
                  "description": "What the customer needs to be told"
                },
                "customer_id": {
                  "type": "number",
                  "description": "Customer id"
                }
              },
              "additionalProperties": false
            },
            "description": "Hand the customer message to the notification agent, which runs as its own agent and picks SMS or email from the customer's contact preferences."
          }
        ],
        "params": {
          "temperature": 0,
          "max_output_tokens": 500
        },
        "system": "You are Acme's billing 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. Collect overdue invoices: check the invoice, charge the card on file when it is valid, and when it is not, make sure the customer is told — a payment reminder email, or the notification agent, which knows their SMS and email preferences. Use the tools to act; when you are done, reply with a one-sentence summary of what you did.",
        "messages": [
          {
            "role": "user",
            "content": "Invoice INV-63671 for customer #6000 is 20 days overdue. Collect it."
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "invoice_id": "INV-63671"
                },
                "toolName": "get_invoice",
                "toolCallId": "call_o8VHR8O4n7UhMNpxPZYevjU7"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "amount_aud": 3412.22,
                    "invoice_id": "INV-63671",
                    "customer_id": 6000,
                    "card_on_file": "valid",
                    "days_overdue": 20
                  }
                },
                "toolName": "get_invoice",
                "toolCallId": "call_o8VHR8O4n7UhMNpxPZYevjU7"
              }
            ]
          }
        ]
      },
      "span_id": "l2",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "amount": 3412.22,
              "invoice_id": "INV-63671",
              "customer_id": 6000
            },
            "tool_name": "charge_card",
            "tool_call_id": "call_vBMyqPXmMEBwTSCePEj4lavi"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-11-04T15:11:02.802Z",
      "latency_ms": 1545,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "f0d526097059adc9809e5d5fcf7e315e44331e46a32594a0cb507e2abdc8ce4e"
    },
    {
      "seq": 4,
      "type": "tool",
      "error": {
        "name": "ApprovalRequired",
        "message": "must not (charge_card.amount gt 2000) — violated — held for approval 52a5b777-1dd9-4fe3-8f1b-a7d7c05b8a4b"
      },
      "input": {
        "amount": 3412.22,
        "invoice_id": "INV-63671",
        "customer_id": 6000
      },
      "output": null,
      "run_id": "sbx-billing-ffed625cfb0a",
      "ts_end": "2026-11-04T15:11:04.447Z",
      "span_id": "t2",
      "metadata": {
        "approval_id": "52a5b777-1dd9-4fe3-8f1b-a7d7c05b8a4b"
      },
      "ts_start": "2026-11-04T15:11:04.347Z",
      "tool_name": "charge_card",
      "latency_ms": 100,
      "policy_block": {
        "rule": "charge-over-a2000-needs-approval",
        "detail": "must not (charge_card.amount gt 2000) — violated — held for approval 52a5b777-1dd9-4fe3-8f1b-a7d7c05b8a4b"
      },
      "tool_call_id": "call_vBMyqPXmMEBwTSCePEj4lavi",
      "parent_span_id": "l2",
      "schema_version": 1,
      "policy_evaluated": {
        "passed": false
      },
      "_hash": "a358ae6f9d024bf48713699fb715bddd7f1d0459c94d725a1cce3eac0545af91"
    },
    {
      "seq": 5,
      "name": "billing-agent",
      "type": "run",
      "error": {
        "name": "ApprovalRequired",
        "message": "charge_card is waiting for a person to approve it; the sandbox agent stopped here."
      },
      "input": null,
      "phase": "end",
      "output": {
        "awaiting_approval": "52a5b777-1dd9-4fe3-8f1b-a7d7c05b8a4b"
      },
      "run_id": "sbx-billing-ffed625cfb0a",
      "status": "error",
      "ts_end": "2026-11-04T15:11:04.447Z",
      "span_id": "re",
      "metadata": {
        "demo_agent": true,
        "sandbox_tools": true
      },
      "ts_start": "2026-11-04T15:11:04.447Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "315b1b8d819076042462c6d83a665f11458fa0f1cf5e444e20554f803f4ad4ed"
    }
  ]
}