{
  "$schema": "runback.audit/v2",
  "manifest": {
    "run_id": "sbx-billing-14e4572f3786",
    "generated_at": "2026-11-07T07:35:59.541Z",
    "event_count": 7,
    "algorithm": "sha256-chain",
    "content_digest": "5b8b51ef1f1df0a70ced3d197cbc8886d67cd542fe1730b7cd7457135f3ec096",
    "replay": {
      "cassette_digest": "72f2c0dbd650a5ce0d0c99ec2bb25e7a263377636dd091b0179205fc76ebe456",
      "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": "893be869feaf07341784864e8c740881e731dedec5e26a5012a1334894ceeee18e553e50294eb7d41765d98ea580eb87a38a51fbdb418ce5e314f66bb1000e08",
      "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-14e4572f3786",
    "name": "billing-agent",
    "status": "success",
    "input": "Invoice INV-79157 for customer #9596 is 8 days overdue. Collect it.",
    "output": {
      "summary": "Charged $589.15 AUD to customer #9596 for overdue invoice INV-79157, receipt RC-969157."
    },
    "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.000057,
      "sandbox_tools": true,
      "scenario_seed": "billing-agent:2026-11-05:81"
    },
    "step_count": 3,
    "total_tokens": 1694,
    "started_at": "2026-11-05T15:11:02.285+00:00",
    "ended_at": "2026-11-05T15:11:06.286+00:00",
    "actor_type": null,
    "actor_id": null
  },
  "events": [
    {
      "seq": 0,
      "name": "billing-agent",
      "type": "run",
      "error": null,
      "input": "Invoice INV-79157 for customer #9596 is 8 days overdue. Collect it.",
      "phase": "start",
      "output": null,
      "run_id": "sbx-billing-14e4572f3786",
      "status": "running",
      "ts_end": "2026-11-05T15:11:06.286Z",
      "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.000057,
        "sandbox_tools": true,
        "scenario_seed": "billing-agent:2026-11-05:81"
      },
      "ts_start": "2026-11-05T15:11:02.285Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "5f2de0b38eb1cf826053f9af4fd34dcaaeddc2c40bec273539223d7cd1ce5420"
    },
    {
      "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-14e4572f3786",
      "ts_end": "2026-11-05T15:11:03.775Z",
      "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-79157 for customer #9596 is 8 days overdue. Collect it."
          }
        ]
      },
      "span_id": "l1",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "invoice_id": "INV-79157"
            },
            "tool_name": "get_invoice",
            "tool_call_id": "fc_8776fc6b-d84e-44c3-9ee6-ff38181b8eed"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-11-05T15:11:02.285Z",
      "latency_ms": 1490,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "2a0689f841c1bd8ca1187233a11442f46bed01f70d606aa3a6567003f2757296"
    },
    {
      "seq": 2,
      "type": "tool",
      "error": null,
      "input": {
        "invoice_id": "INV-79157"
      },
      "output": {
        "amount_aud": 589.15,
        "invoice_id": "INV-79157",
        "customer_id": 9596,
        "card_on_file": "valid",
        "days_overdue": 8
      },
      "run_id": "sbx-billing-14e4572f3786",
      "ts_end": "2026-11-05T15:11:03.794Z",
      "span_id": "t1",
      "ts_start": "2026-11-05T15:11:03.776Z",
      "tool_name": "get_invoice",
      "latency_ms": 18,
      "tool_call_id": "fc_8776fc6b-d84e-44c3-9ee6-ff38181b8eed",
      "parent_span_id": "l1",
      "schema_version": 1,
      "policy_evaluated": {
        "passed": true
      },
      "_hash": "84803573c4bd02bb96eb89889e456efac35c8b511a5af1cfe1c7e9443c9e38de"
    },
    {
      "seq": 3,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "openai/gpt-oss-20b",
        "provider": "groq"
      },
      "usage": {
        "input_tokens": 500,
        "total_tokens": 575,
        "output_tokens": 75
      },
      "run_id": "sbx-billing-14e4572f3786",
      "ts_end": "2026-11-05T15:11:04.223Z",
      "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-79157 for customer #9596 is 8 days overdue. Collect it."
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "invoice_id": "INV-79157"
                },
                "toolName": "get_invoice",
                "toolCallId": "fc_8776fc6b-d84e-44c3-9ee6-ff38181b8eed"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "amount_aud": 589.15,
                    "invoice_id": "INV-79157",
                    "customer_id": 9596,
                    "card_on_file": "valid",
                    "days_overdue": 8
                  }
                },
                "toolName": "get_invoice",
                "toolCallId": "fc_8776fc6b-d84e-44c3-9ee6-ff38181b8eed"
              }
            ]
          }
        ]
      },
      "span_id": "l2",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "amount": 589.15,
              "invoice_id": "INV-79157",
              "customer_id": 9596
            },
            "tool_name": "charge_card",
            "tool_call_id": "fc_64866018-5d7a-4441-9c70-32f77a03aef6"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-11-05T15:11:03.794Z",
      "latency_ms": 429,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "7fe15204a438773c0b9eb87337e584e2b60f0c561218260c88115da59920da0a"
    },
    {
      "seq": 4,
      "type": "tool",
      "error": null,
      "input": {
        "amount": 589.15,
        "invoice_id": "INV-79157",
        "customer_id": 9596
      },
      "output": {
        "receipt": "RC-969157",
        "sandbox": true,
        "captured": true,
        "amount_aud": 589.15
      },
      "run_id": "sbx-billing-14e4572f3786",
      "ts_end": "2026-11-05T15:11:04.250Z",
      "span_id": "t2",
      "ts_start": "2026-11-05T15:11:04.223Z",
      "tool_name": "charge_card",
      "latency_ms": 27,
      "tool_call_id": "fc_64866018-5d7a-4441-9c70-32f77a03aef6",
      "parent_span_id": "l2",
      "schema_version": 1,
      "policy_evaluated": {
        "passed": true
      },
      "_hash": "a0ffae8ed36f1f3867b7a14568dbac5f2e2da5ec5933fefb458da16d9d0c96bc"
    },
    {
      "seq": 5,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "openai/gpt-oss-20b",
        "provider": "groq"
      },
      "usage": {
        "input_tokens": 567,
        "total_tokens": 618,
        "output_tokens": 51
      },
      "run_id": "sbx-billing-14e4572f3786",
      "ts_end": "2026-11-05T15:11:06.286Z",
      "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-79157 for customer #9596 is 8 days overdue. Collect it."
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "invoice_id": "INV-79157"
                },
                "toolName": "get_invoice",
                "toolCallId": "fc_8776fc6b-d84e-44c3-9ee6-ff38181b8eed"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "amount_aud": 589.15,
                    "invoice_id": "INV-79157",
                    "customer_id": 9596,
                    "card_on_file": "valid",
                    "days_overdue": 8
                  }
                },
                "toolName": "get_invoice",
                "toolCallId": "fc_8776fc6b-d84e-44c3-9ee6-ff38181b8eed"
              }
            ]
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "amount": 589.15,
                  "invoice_id": "INV-79157",
                  "customer_id": 9596
                },
                "toolName": "charge_card",
                "toolCallId": "fc_64866018-5d7a-4441-9c70-32f77a03aef6"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "receipt": "RC-969157",
                    "sandbox": true,
                    "captured": true,
                    "amount_aud": 589.15
                  }
                },
                "toolName": "charge_card",
                "toolCallId": "fc_64866018-5d7a-4441-9c70-32f77a03aef6"
              }
            ]
          }
        ]
      },
      "span_id": "l3",
      "response": {
        "text": "Charged $589.15 AUD to customer #9596 for overdue invoice INV-79157, receipt RC-969157.",
        "reasoning": null,
        "tool_calls": [],
        "finish_reason": "stop"
      },
      "ts_start": "2026-11-05T15:11:04.250Z",
      "latency_ms": 2036,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "79237ca4c8270e8f78cd259dfd8620021e640354fe5e34f9a87e6a616930145e"
    },
    {
      "seq": 6,
      "name": "billing-agent",
      "type": "run",
      "error": null,
      "input": null,
      "phase": "end",
      "output": {
        "summary": "Charged $589.15 AUD to customer #9596 for overdue invoice INV-79157, receipt RC-969157."
      },
      "run_id": "sbx-billing-14e4572f3786",
      "status": "success",
      "ts_end": "2026-11-05T15:11:06.286Z",
      "span_id": "re",
      "metadata": {
        "demo_agent": true,
        "sandbox_tools": true
      },
      "ts_start": "2026-11-05T15:11:06.286Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "5b8b51ef1f1df0a70ced3d197cbc8886d67cd542fe1730b7cd7457135f3ec096"
    }
  ]
}