{
  "$schema": "runback.audit/v2",
  "manifest": {
    "run_id": "sbx-billing-e13eb5211a71",
    "generated_at": "2026-11-07T07:35:50.027Z",
    "event_count": 6,
    "algorithm": "sha256-chain",
    "content_digest": "428cea52be5eb93d94bba1da50508a51ad151225cbb5063fdf11693e88d01ff3",
    "replay": {
      "cassette_digest": "299a92905f924c5231a9a2ad9302f1eda98e913b2d8de637c2fd104bdac0b52f",
      "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": "9fb6b0e085658f742007d85e100994d5afc35e4bf75a52e9fb89fdc8fcb61df59812e2f10242027ad9f730569768ab71c15351d155a1f36dc78952d41b67090f",
      "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-e13eb5211a71",
    "name": "billing-agent",
    "status": "error",
    "input": "Invoice INV-38608 for customer #5192 is 10 days overdue. Collect it.",
    "output": {
      "awaiting_approval": "f82fc5cc-f8d2-40ce-be29-25323e4bd44e"
    },
    "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-03:33"
    },
    "step_count": 2,
    "total_tokens": 778,
    "started_at": "2026-11-03T06:11:04.228+00:00",
    "ended_at": "2026-11-03T06:11:06.781+00:00",
    "actor_type": null,
    "actor_id": null
  },
  "events": [
    {
      "seq": 0,
      "name": "billing-agent",
      "type": "run",
      "error": null,
      "input": "Invoice INV-38608 for customer #5192 is 10 days overdue. Collect it.",
      "phase": "start",
      "output": null,
      "run_id": "sbx-billing-e13eb5211a71",
      "status": "running",
      "ts_end": "2026-11-03T06:11:06.781Z",
      "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-03:33"
      },
      "ts_start": "2026-11-03T06:11:04.228Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "a8dda4d2a109588017f5779e2de9b0d1d4b0fd24e69934d749e717c10299bc3c"
    },
    {
      "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-e13eb5211a71",
      "ts_end": "2026-11-03T06:11:05.215Z",
      "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-38608 for customer #5192 is 10 days overdue. Collect it."
          }
        ]
      },
      "span_id": "l1",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "invoice_id": "INV-38608"
            },
            "tool_name": "get_invoice",
            "tool_call_id": "call_Rt0WK3RGNXRG5S8jLIsMYlez"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-11-03T06:11:04.228Z",
      "latency_ms": 987,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "1255381e9c7aa6753e832c88908e27ee5f2749ce25dc952bb45d1851f8e65e0d"
    },
    {
      "seq": 2,
      "type": "tool",
      "error": null,
      "input": {
        "invoice_id": "INV-38608"
      },
      "output": {
        "amount_aud": 2444.02,
        "invoice_id": "INV-38608",
        "customer_id": 5192,
        "card_on_file": "valid",
        "days_overdue": 10
      },
      "run_id": "sbx-billing-e13eb5211a71",
      "ts_end": "2026-11-03T06:11:05.248Z",
      "span_id": "t1",
      "ts_start": "2026-11-03T06:11:05.215Z",
      "tool_name": "get_invoice",
      "latency_ms": 33,
      "tool_call_id": "call_Rt0WK3RGNXRG5S8jLIsMYlez",
      "parent_span_id": "l1",
      "schema_version": 1,
      "policy_evaluated": {
        "passed": true
      },
      "_hash": "94a413e8a67073d8f614d035a923c1ba01dc8e3db8a7fc7d8dc931c35258af50"
    },
    {
      "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-e13eb5211a71",
      "ts_end": "2026-11-03T06:11:06.618Z",
      "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-38608 for customer #5192 is 10 days overdue. Collect it."
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "invoice_id": "INV-38608"
                },
                "toolName": "get_invoice",
                "toolCallId": "call_Rt0WK3RGNXRG5S8jLIsMYlez"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "amount_aud": 2444.02,
                    "invoice_id": "INV-38608",
                    "customer_id": 5192,
                    "card_on_file": "valid",
                    "days_overdue": 10
                  }
                },
                "toolName": "get_invoice",
                "toolCallId": "call_Rt0WK3RGNXRG5S8jLIsMYlez"
              }
            ]
          }
        ]
      },
      "span_id": "l2",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "amount": 2444.02,
              "invoice_id": "INV-38608",
              "customer_id": 5192
            },
            "tool_name": "charge_card",
            "tool_call_id": "call_7wfSWa9fIXr2Yvps3I5hRell"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-11-03T06:11:05.248Z",
      "latency_ms": 1370,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "a2ecf8ac1fabb851d487c592df73dc315da1af57bc0b0b5c61a4af6cc333213a"
    },
    {
      "seq": 4,
      "type": "tool",
      "error": {
        "name": "ApprovalRequired",
        "message": "must not (charge_card.amount gt 2000) — violated — held for approval f82fc5cc-f8d2-40ce-be29-25323e4bd44e"
      },
      "input": {
        "amount": 2444.02,
        "invoice_id": "INV-38608",
        "customer_id": 5192
      },
      "output": null,
      "run_id": "sbx-billing-e13eb5211a71",
      "ts_end": "2026-11-03T06:11:06.781Z",
      "span_id": "t2",
      "metadata": {
        "approval_id": "f82fc5cc-f8d2-40ce-be29-25323e4bd44e"
      },
      "ts_start": "2026-11-03T06:11:06.618Z",
      "tool_name": "charge_card",
      "latency_ms": 163,
      "policy_block": {
        "rule": "charge-over-a2000-needs-approval",
        "detail": "must not (charge_card.amount gt 2000) — violated — held for approval f82fc5cc-f8d2-40ce-be29-25323e4bd44e"
      },
      "tool_call_id": "call_7wfSWa9fIXr2Yvps3I5hRell",
      "parent_span_id": "l2",
      "schema_version": 1,
      "policy_evaluated": {
        "passed": false
      },
      "_hash": "e41531089dae0445fd84e56873ec130614a909d654b94d98b5ef615a520153f7"
    },
    {
      "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": "f82fc5cc-f8d2-40ce-be29-25323e4bd44e"
      },
      "run_id": "sbx-billing-e13eb5211a71",
      "status": "error",
      "ts_end": "2026-11-03T06:11:06.781Z",
      "span_id": "re",
      "metadata": {
        "demo_agent": true,
        "sandbox_tools": true
      },
      "ts_start": "2026-11-03T06:11:06.781Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "428cea52be5eb93d94bba1da50508a51ad151225cbb5063fdf11693e88d01ff3"
    }
  ]
}