{
  "$schema": "runback.audit/v2",
  "manifest": {
    "run_id": "sbx-billing-80a6228c4c89",
    "generated_at": "2026-11-07T07:36:12.590Z",
    "event_count": 7,
    "algorithm": "sha256-chain",
    "content_digest": "23586961eaa6a83f4c01d32ddfb6ced2278cd014898f4d071b922e00316e9c9b",
    "replay": {
      "cassette_digest": "3c4903d5ad22252f1973cf02dcb57f2b4ca5bf436d1e734e90425a763c75eb76",
      "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": "7df3346a6a6002671d23529ac8ef8c749db44b61dab2e6dcbbc4f5efe88e1e4146fc919bbf853b1ea3721045dfb97449c32b45f9e5541f86ccafdde377470003",
      "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-80a6228c4c89",
    "name": "billing-agent",
    "status": "success",
    "input": "Invoice INV-45641 for customer #4400 is 31 days overdue. Collect it.",
    "output": {
      "summary": "Charged $653.34 AUD to customer #4400 for overdue invoice INV-45641, receipt RC-005641."
    },
    "error": null,
    "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": "openai/gpt-oss-20b",
      "demo_agent": true,
      "est_cost_usd": 0.000058,
      "sandbox_tools": true,
      "scenario_seed": "billing-agent:2026-10-28:97"
    },
    "step_count": 3,
    "total_tokens": 1699,
    "started_at": "2026-10-28T17:11:01.926+00:00",
    "ended_at": "2026-10-28T17:11:03.36+00:00",
    "actor_type": null,
    "actor_id": null
  },
  "events": [
    {
      "seq": 0,
      "name": "billing-agent",
      "type": "run",
      "error": null,
      "input": "Invoice INV-45641 for customer #4400 is 31 days overdue. Collect it.",
      "phase": "start",
      "output": null,
      "run_id": "sbx-billing-80a6228c4c89",
      "status": "running",
      "ts_end": "2026-10-28T17:11:03.360Z",
      "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": "openai/gpt-oss-20b",
        "demo_agent": true,
        "est_cost_usd": 0.000058,
        "sandbox_tools": true,
        "scenario_seed": "billing-agent:2026-10-28:97"
      },
      "ts_start": "2026-10-28T17:11:01.926Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "79ea115d005f4e8b752dc8c21544e3c3827ba8351409ad1403bfdd15005521e4"
    },
    {
      "seq": 1,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "openai/gpt-oss-20b",
        "provider": "groq"
      },
      "usage": {
        "input_tokens": 437,
        "total_tokens": 501,
        "output_tokens": 64
      },
      "run_id": "sbx-billing-80a6228c4c89",
      "ts_end": "2026-10-28T17:11:02.575Z",
      "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-45641 for customer #4400 is 31 days overdue. Collect it."
          }
        ]
      },
      "span_id": "l1",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "invoice_id": "INV-45641"
            },
            "tool_name": "get_invoice",
            "tool_call_id": "fc_9bb0e5bb-0b10-4e00-bda4-9f75c6aa7ed4"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-10-28T17:11:01.926Z",
      "latency_ms": 649,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "c9f8fb22b393e9f4096a0d4f79eb0ce452a78931b3e0687ff145b51dc0d2e7e2"
    },
    {
      "seq": 2,
      "type": "tool",
      "error": null,
      "input": {
        "invoice_id": "INV-45641"
      },
      "output": {
        "amount_aud": 653.34,
        "invoice_id": "INV-45641",
        "customer_id": 4400,
        "card_on_file": "valid",
        "days_overdue": 31
      },
      "run_id": "sbx-billing-80a6228c4c89",
      "ts_end": "2026-10-28T17:11:02.600Z",
      "span_id": "t1",
      "ts_start": "2026-10-28T17:11:02.575Z",
      "tool_name": "get_invoice",
      "latency_ms": 25,
      "tool_call_id": "fc_9bb0e5bb-0b10-4e00-bda4-9f75c6aa7ed4",
      "parent_span_id": "l1",
      "schema_version": 1,
      "policy_evaluated": {
        "passed": true
      },
      "_hash": "5ef70a5c9810ada27beff557bf218b7aca918b10db973a556ef351d3704e493b"
    },
    {
      "seq": 3,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "openai/gpt-oss-20b",
        "provider": "groq"
      },
      "usage": {
        "input_tokens": 500,
        "total_tokens": 579,
        "output_tokens": 79
      },
      "run_id": "sbx-billing-80a6228c4c89",
      "ts_end": "2026-10-28T17:11:02.960Z",
      "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-45641 for customer #4400 is 31 days overdue. Collect it."
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "invoice_id": "INV-45641"
                },
                "toolName": "get_invoice",
                "toolCallId": "fc_9bb0e5bb-0b10-4e00-bda4-9f75c6aa7ed4"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "amount_aud": 653.34,
                    "invoice_id": "INV-45641",
                    "customer_id": 4400,
                    "card_on_file": "valid",
                    "days_overdue": 31
                  }
                },
                "toolName": "get_invoice",
                "toolCallId": "fc_9bb0e5bb-0b10-4e00-bda4-9f75c6aa7ed4"
              }
            ]
          }
        ]
      },
      "span_id": "l2",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "amount": 653.34,
              "invoice_id": "INV-45641",
              "customer_id": 4400
            },
            "tool_name": "charge_card",
            "tool_call_id": "fc_6f123596-0a54-4714-a60c-78ddabdc1290"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-10-28T17:11:02.600Z",
      "latency_ms": 360,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "bb44c0c70f5b698190b1a476b07df1b69b048705ab5f8d0c395789459fa3a24b"
    },
    {
      "seq": 4,
      "type": "tool",
      "error": null,
      "input": {
        "amount": 653.34,
        "invoice_id": "INV-45641",
        "customer_id": 4400
      },
      "output": {
        "receipt": "RC-005641",
        "sandbox": true,
        "captured": true,
        "amount_aud": 653.34
      },
      "run_id": "sbx-billing-80a6228c4c89",
      "ts_end": "2026-10-28T17:11:02.978Z",
      "span_id": "t2",
      "ts_start": "2026-10-28T17:11:02.960Z",
      "tool_name": "charge_card",
      "latency_ms": 18,
      "tool_call_id": "fc_6f123596-0a54-4714-a60c-78ddabdc1290",
      "parent_span_id": "l2",
      "schema_version": 1,
      "policy_evaluated": {
        "passed": true
      },
      "_hash": "eda09ea2d4b90425be8b152b4df5b4d99ea738f1bf8dba6ad1354d13000833a5"
    },
    {
      "seq": 5,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "openai/gpt-oss-20b",
        "provider": "groq"
      },
      "usage": {
        "input_tokens": 567,
        "total_tokens": 619,
        "output_tokens": 52
      },
      "run_id": "sbx-billing-80a6228c4c89",
      "ts_end": "2026-10-28T17:11:03.360Z",
      "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-45641 for customer #4400 is 31 days overdue. Collect it."
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "invoice_id": "INV-45641"
                },
                "toolName": "get_invoice",
                "toolCallId": "fc_9bb0e5bb-0b10-4e00-bda4-9f75c6aa7ed4"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "amount_aud": 653.34,
                    "invoice_id": "INV-45641",
                    "customer_id": 4400,
                    "card_on_file": "valid",
                    "days_overdue": 31
                  }
                },
                "toolName": "get_invoice",
                "toolCallId": "fc_9bb0e5bb-0b10-4e00-bda4-9f75c6aa7ed4"
              }
            ]
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "amount": 653.34,
                  "invoice_id": "INV-45641",
                  "customer_id": 4400
                },
                "toolName": "charge_card",
                "toolCallId": "fc_6f123596-0a54-4714-a60c-78ddabdc1290"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "receipt": "RC-005641",
                    "sandbox": true,
                    "captured": true,
                    "amount_aud": 653.34
                  }
                },
                "toolName": "charge_card",
                "toolCallId": "fc_6f123596-0a54-4714-a60c-78ddabdc1290"
              }
            ]
          }
        ]
      },
      "span_id": "l3",
      "response": {
        "text": "Charged $653.34 AUD to customer #4400 for overdue invoice INV-45641, receipt RC-005641.",
        "reasoning": null,
        "tool_calls": [],
        "finish_reason": "stop"
      },
      "ts_start": "2026-10-28T17:11:02.978Z",
      "latency_ms": 382,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "48abfa2424046f4362f77e53801870e975b565e05bf572104dc3a58557c5a04d"
    },
    {
      "seq": 6,
      "name": "billing-agent",
      "type": "run",
      "error": null,
      "input": null,
      "phase": "end",
      "output": {
        "summary": "Charged $653.34 AUD to customer #4400 for overdue invoice INV-45641, receipt RC-005641."
      },
      "run_id": "sbx-billing-80a6228c4c89",
      "status": "success",
      "ts_end": "2026-10-28T17:11:03.360Z",
      "span_id": "re",
      "metadata": {
        "demo_agent": true,
        "sandbox_tools": true
      },
      "ts_start": "2026-10-28T17:11:03.360Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "23586961eaa6a83f4c01d32ddfb6ced2278cd014898f4d071b922e00316e9c9b"
    }
  ]
}