{
  "$schema": "runback.audit/v2",
  "manifest": {
    "run_id": "sbx-billing-db816b00feab",
    "generated_at": "2026-11-07T07:35:55.582Z",
    "event_count": 7,
    "algorithm": "sha256-chain",
    "content_digest": "2de84ca576443be44f62f6b89ebcbb4487ddac8fff1047ab69dff8d6f57aeacc",
    "replay": {
      "cassette_digest": "b6acd51c41a3b127022a4d0f75a7c21aba5e6dde63d36897d80621040c4a3cb3",
      "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": "ea6b8f6a84ffe831d005a63e3c688822a05f71ef693fae559f6eb6cd971e005f96d6f3130980b3ed06ad887438af7846750ca507a52292357df11510c5a1b20e",
      "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-db816b00feab",
    "name": "billing-agent",
    "status": "success",
    "input": "Invoice INV-90831 for customer #9700 is 8 days overdue. Collect it.",
    "output": {
      "summary": "I successfully charged the customer's card for invoice INV-90831, collecting the overdue amount of AUD 579.83."
    },
    "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.000223,
      "sandbox_tools": true,
      "scenario_seed": "billing-agent:2026-11-03:81"
    },
    "step_count": 3,
    "total_tokens": 1257,
    "started_at": "2026-11-03T15:11:08.067+00:00",
    "ended_at": "2026-11-03T15:11:12.349+00:00",
    "actor_type": null,
    "actor_id": null
  },
  "events": [
    {
      "seq": 0,
      "name": "billing-agent",
      "type": "run",
      "error": null,
      "input": "Invoice INV-90831 for customer #9700 is 8 days overdue. Collect it.",
      "phase": "start",
      "output": null,
      "run_id": "sbx-billing-db816b00feab",
      "status": "running",
      "ts_end": "2026-11-03T15:11:12.349Z",
      "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.000223,
        "sandbox_tools": true,
        "scenario_seed": "billing-agent:2026-11-03:81"
      },
      "ts_start": "2026-11-03T15:11:08.067Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "298da82d66adce368a849f96c560d4d3dc4863e4707996dbc92fba27cac025f6"
    },
    {
      "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-db816b00feab",
      "ts_end": "2026-11-03T15:11:09.442Z",
      "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-90831 for customer #9700 is 8 days overdue. Collect it."
          }
        ]
      },
      "span_id": "l1",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "invoice_id": "INV-90831"
            },
            "tool_name": "get_invoice",
            "tool_call_id": "call_ALHB0qf4YhJeT1jUEU8qxZUM"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-11-03T15:11:08.067Z",
      "latency_ms": 1375,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "8624292708edb4c7c7eab401eaf5d5ed8ad034bfbb61c733a16fd3fb3aac9aab"
    },
    {
      "seq": 2,
      "type": "tool",
      "error": null,
      "input": {
        "invoice_id": "INV-90831"
      },
      "output": {
        "amount_aud": 579.83,
        "invoice_id": "INV-90831",
        "customer_id": 9700,
        "card_on_file": "valid",
        "days_overdue": 8
      },
      "run_id": "sbx-billing-db816b00feab",
      "ts_end": "2026-11-03T15:11:09.463Z",
      "span_id": "t1",
      "ts_start": "2026-11-03T15:11:09.442Z",
      "tool_name": "get_invoice",
      "latency_ms": 21,
      "tool_call_id": "call_ALHB0qf4YhJeT1jUEU8qxZUM",
      "parent_span_id": "l1",
      "schema_version": 1,
      "policy_evaluated": {
        "passed": true
      },
      "_hash": "f1fe75ddaf1de7a39b3d0703a7f43ba47b100591d31339858649315cd9572706"
    },
    {
      "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-db816b00feab",
      "ts_end": "2026-11-03T15:11:10.935Z",
      "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-90831 for customer #9700 is 8 days overdue. Collect it."
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "invoice_id": "INV-90831"
                },
                "toolName": "get_invoice",
                "toolCallId": "call_ALHB0qf4YhJeT1jUEU8qxZUM"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "amount_aud": 579.83,
                    "invoice_id": "INV-90831",
                    "customer_id": 9700,
                    "card_on_file": "valid",
                    "days_overdue": 8
                  }
                },
                "toolName": "get_invoice",
                "toolCallId": "call_ALHB0qf4YhJeT1jUEU8qxZUM"
              }
            ]
          }
        ]
      },
      "span_id": "l2",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "amount": 579.83,
              "invoice_id": "INV-90831",
              "customer_id": 9700
            },
            "tool_name": "charge_card",
            "tool_call_id": "call_yG3hlT72ObGk2CTQ4h6dbTQP"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-11-03T15:11:09.463Z",
      "latency_ms": 1472,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "7703017ce258ff0f7d85e70b863f7996efdf8b30a33147492a4a322e431c5481"
    },
    {
      "seq": 4,
      "type": "tool",
      "error": null,
      "input": {
        "amount": 579.83,
        "invoice_id": "INV-90831",
        "customer_id": 9700
      },
      "output": {
        "receipt": "RC-000831",
        "sandbox": true,
        "captured": true,
        "amount_aud": 579.83
      },
      "run_id": "sbx-billing-db816b00feab",
      "ts_end": "2026-11-03T15:11:11.014Z",
      "span_id": "t2",
      "ts_start": "2026-11-03T15:11:10.936Z",
      "tool_name": "charge_card",
      "latency_ms": 78,
      "tool_call_id": "call_yG3hlT72ObGk2CTQ4h6dbTQP",
      "parent_span_id": "l2",
      "schema_version": 1,
      "policy_evaluated": {
        "passed": true
      },
      "_hash": "af0c3f1b8aea9f0d1b07584ca26a79adabdb881402dadf1d0e0e4807fe5bc18a"
    },
    {
      "seq": 5,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "gpt-4o-mini",
        "provider": "openai"
      },
      "usage": {
        "input_tokens": 455,
        "total_tokens": 481,
        "output_tokens": 26
      },
      "run_id": "sbx-billing-db816b00feab",
      "ts_end": "2026-11-03T15:11:12.349Z",
      "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-90831 for customer #9700 is 8 days overdue. Collect it."
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "invoice_id": "INV-90831"
                },
                "toolName": "get_invoice",
                "toolCallId": "call_ALHB0qf4YhJeT1jUEU8qxZUM"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "amount_aud": 579.83,
                    "invoice_id": "INV-90831",
                    "customer_id": 9700,
                    "card_on_file": "valid",
                    "days_overdue": 8
                  }
                },
                "toolName": "get_invoice",
                "toolCallId": "call_ALHB0qf4YhJeT1jUEU8qxZUM"
              }
            ]
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "amount": 579.83,
                  "invoice_id": "INV-90831",
                  "customer_id": 9700
                },
                "toolName": "charge_card",
                "toolCallId": "call_yG3hlT72ObGk2CTQ4h6dbTQP"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "receipt": "RC-000831",
                    "sandbox": true,
                    "captured": true,
                    "amount_aud": 579.83
                  }
                },
                "toolName": "charge_card",
                "toolCallId": "call_yG3hlT72ObGk2CTQ4h6dbTQP"
              }
            ]
          }
        ]
      },
      "span_id": "l3",
      "response": {
        "text": "I successfully charged the customer's card for invoice INV-90831, collecting the overdue amount of AUD 579.83.",
        "reasoning": null,
        "tool_calls": [],
        "finish_reason": "stop"
      },
      "ts_start": "2026-11-03T15:11:11.014Z",
      "latency_ms": 1335,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "a8bed8d32e6afee54989baf8a60725eb7a95287cb973c0634d4eef982c6b34f8"
    },
    {
      "seq": 6,
      "name": "billing-agent",
      "type": "run",
      "error": null,
      "input": null,
      "phase": "end",
      "output": {
        "summary": "I successfully charged the customer's card for invoice INV-90831, collecting the overdue amount of AUD 579.83."
      },
      "run_id": "sbx-billing-db816b00feab",
      "status": "success",
      "ts_end": "2026-11-03T15:11:12.349Z",
      "span_id": "re",
      "metadata": {
        "demo_agent": true,
        "sandbox_tools": true
      },
      "ts_start": "2026-11-03T15:11:12.349Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "2de84ca576443be44f62f6b89ebcbb4487ddac8fff1047ab69dff8d6f57aeacc"
    }
  ]
}