{
  "$schema": "runback.audit/v2",
  "manifest": {
    "run_id": "sbx-billing-0bc68e17b76b",
    "generated_at": "2026-11-07T07:36:01.083Z",
    "event_count": 7,
    "algorithm": "sha256-chain",
    "content_digest": "8ecc90d58b1d2c594282babf6658ca84ce235295f22dc9ec15b2d386197756c8",
    "replay": {
      "cassette_digest": "415184060d8c2e99d7310d83adbefbfdfe9a4a926b686808f2756fadc6b7e00b",
      "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": "ad78a011845477fd534a82bcfcc1dcf01eefc16a7c43bf9bd0bb3cfa5b72db6a9111ffa95f189453a027508047b1eb1b324f7b9b9a6279022192945f8ec80b06",
      "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-0bc68e17b76b",
    "name": "billing-agent",
    "status": "success",
    "input": "Invoice INV-12384 for customer #3179 is 4 days overdue. Collect it.",
    "output": {
      "summary": "I successfully charged the overdue invoice INV-12384 for customer #3179, capturing the amount of AUD 767.80."
    },
    "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": "gpt-4o-mini",
      "demo_agent": true,
      "est_cost_usd": 0.000224,
      "sandbox_tools": true,
      "scenario_seed": "billing-agent:2026-10-25:1"
    },
    "step_count": 3,
    "total_tokens": 1259,
    "started_at": "2026-10-25T00:10:55.187+00:00",
    "ended_at": "2026-10-25T00:11:03.217+00:00",
    "actor_type": null,
    "actor_id": null
  },
  "events": [
    {
      "seq": 0,
      "name": "billing-agent",
      "type": "run",
      "error": null,
      "input": "Invoice INV-12384 for customer #3179 is 4 days overdue. Collect it.",
      "phase": "start",
      "output": null,
      "run_id": "sbx-billing-0bc68e17b76b",
      "status": "running",
      "ts_end": "2026-10-25T00:11:03.217Z",
      "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.000224,
        "sandbox_tools": true,
        "scenario_seed": "billing-agent:2026-10-25:1"
      },
      "ts_start": "2026-10-25T00:10:55.187Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "4fc91646cf67f2d99df77993445c0faee5db6199840a63cdbf425dc55afe24db"
    },
    {
      "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-0bc68e17b76b",
      "ts_end": "2026-10-25T00:10:56.672Z",
      "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-12384 for customer #3179 is 4 days overdue. Collect it."
          }
        ]
      },
      "span_id": "l1",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "invoice_id": "INV-12384"
            },
            "tool_name": "get_invoice",
            "tool_call_id": "call_3uRx8HPwtxk6gbksJB8MgK4W"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-10-25T00:10:55.187Z",
      "latency_ms": 1484,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "90ee361b734c8df241d699c002ded24be1d439a9df33fba754f330eac369ebd8"
    },
    {
      "seq": 2,
      "type": "tool",
      "error": null,
      "input": {
        "invoice_id": "INV-12384"
      },
      "output": {
        "amount_aud": 767.8,
        "invoice_id": "INV-12384",
        "customer_id": 3179,
        "card_on_file": "valid",
        "days_overdue": 4
      },
      "run_id": "sbx-billing-0bc68e17b76b",
      "ts_end": "2026-10-25T00:10:56.769Z",
      "span_id": "t1",
      "ts_start": "2026-10-25T00:10:56.672Z",
      "tool_name": "get_invoice",
      "latency_ms": 97,
      "tool_call_id": "call_3uRx8HPwtxk6gbksJB8MgK4W",
      "parent_span_id": "l1",
      "schema_version": 1,
      "policy_evaluated": {
        "passed": true
      },
      "_hash": "037b85e196c6fade921a99bbb295b4d59fc1a8e51c402ed3074386f61aa4d880"
    },
    {
      "seq": 3,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "gpt-4o-mini",
        "provider": "openai"
      },
      "usage": {
        "input_tokens": 392,
        "total_tokens": 424,
        "output_tokens": 32
      },
      "run_id": "sbx-billing-0bc68e17b76b",
      "ts_end": "2026-10-25T00:11:01.783Z",
      "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-12384 for customer #3179 is 4 days overdue. Collect it."
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "invoice_id": "INV-12384"
                },
                "toolName": "get_invoice",
                "toolCallId": "call_3uRx8HPwtxk6gbksJB8MgK4W"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "amount_aud": 767.8,
                    "invoice_id": "INV-12384",
                    "customer_id": 3179,
                    "card_on_file": "valid",
                    "days_overdue": 4
                  }
                },
                "toolName": "get_invoice",
                "toolCallId": "call_3uRx8HPwtxk6gbksJB8MgK4W"
              }
            ]
          }
        ]
      },
      "span_id": "l2",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "amount": 767.8,
              "invoice_id": "INV-12384",
              "customer_id": 3179
            },
            "tool_name": "charge_card",
            "tool_call_id": "call_O8xT3YFq9xtTSv00C9oUWlFW"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-10-25T00:10:56.769Z",
      "latency_ms": 5014,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "89d12414204a3494bdcd0bb141631cbe2582e8cd6b8937868265e57f767d078d"
    },
    {
      "seq": 4,
      "type": "tool",
      "error": null,
      "input": {
        "amount": 767.8,
        "invoice_id": "INV-12384",
        "customer_id": 3179
      },
      "output": {
        "receipt": "RC-792384",
        "sandbox": true,
        "captured": true,
        "amount_aud": 767.8
      },
      "run_id": "sbx-billing-0bc68e17b76b",
      "ts_end": "2026-10-25T00:11:01.903Z",
      "span_id": "t2",
      "ts_start": "2026-10-25T00:11:01.783Z",
      "tool_name": "charge_card",
      "latency_ms": 120,
      "tool_call_id": "call_O8xT3YFq9xtTSv00C9oUWlFW",
      "parent_span_id": "l2",
      "schema_version": 1,
      "policy_evaluated": {
        "passed": true
      },
      "_hash": "6a64ce7bb442bbbcffa1d7d411e59d4fa14ef9c969fcf06c0571d5983d616697"
    },
    {
      "seq": 5,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "gpt-4o-mini",
        "provider": "openai"
      },
      "usage": {
        "input_tokens": 455,
        "total_tokens": 483,
        "output_tokens": 28
      },
      "run_id": "sbx-billing-0bc68e17b76b",
      "ts_end": "2026-10-25T00:11:03.217Z",
      "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-12384 for customer #3179 is 4 days overdue. Collect it."
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "invoice_id": "INV-12384"
                },
                "toolName": "get_invoice",
                "toolCallId": "call_3uRx8HPwtxk6gbksJB8MgK4W"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "amount_aud": 767.8,
                    "invoice_id": "INV-12384",
                    "customer_id": 3179,
                    "card_on_file": "valid",
                    "days_overdue": 4
                  }
                },
                "toolName": "get_invoice",
                "toolCallId": "call_3uRx8HPwtxk6gbksJB8MgK4W"
              }
            ]
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "amount": 767.8,
                  "invoice_id": "INV-12384",
                  "customer_id": 3179
                },
                "toolName": "charge_card",
                "toolCallId": "call_O8xT3YFq9xtTSv00C9oUWlFW"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "receipt": "RC-792384",
                    "sandbox": true,
                    "captured": true,
                    "amount_aud": 767.8
                  }
                },
                "toolName": "charge_card",
                "toolCallId": "call_O8xT3YFq9xtTSv00C9oUWlFW"
              }
            ]
          }
        ]
      },
      "span_id": "l3",
      "response": {
        "text": "I successfully charged the overdue invoice INV-12384 for customer #3179, capturing the amount of AUD 767.80.",
        "reasoning": null,
        "tool_calls": [],
        "finish_reason": "stop"
      },
      "ts_start": "2026-10-25T00:11:01.903Z",
      "latency_ms": 1314,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "8f59f80d36fed78df7ff0c25ca5492e4ba96ecec30c35e64a6bf3db1fce20583"
    },
    {
      "seq": 6,
      "name": "billing-agent",
      "type": "run",
      "error": null,
      "input": null,
      "phase": "end",
      "output": {
        "summary": "I successfully charged the overdue invoice INV-12384 for customer #3179, capturing the amount of AUD 767.80."
      },
      "run_id": "sbx-billing-0bc68e17b76b",
      "status": "success",
      "ts_end": "2026-10-25T00:11:03.217Z",
      "span_id": "re",
      "metadata": {
        "demo_agent": true,
        "sandbox_tools": true
      },
      "ts_start": "2026-10-25T00:11:03.217Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "8ecc90d58b1d2c594282babf6658ca84ce235295f22dc9ec15b2d386197756c8"
    }
  ]
}