{
  "$schema": "runback.audit/v2",
  "manifest": {
    "run_id": "sbx-billing-912a4e9b000e",
    "generated_at": "2026-11-07T07:36:00.456Z",
    "event_count": 7,
    "algorithm": "sha256-chain",
    "content_digest": "87ce4390e9d8b838caa8df10eb0cd50a066ecb8bdeafe5b5bde4046c84818750",
    "replay": {
      "cassette_digest": "96239d1ea8632e9350fd30e86329f3513cb684a18499fae0e08feb07c735a8f0",
      "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": "0670dbaaa56b043c181417b027ab34f41b600315c92cae1f29360863ce76d92559d20fbef78b4b67da575ce3029941df83e2000ef64b63604bcef2de1d999808",
      "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-912a4e9b000e",
    "name": "billing-agent",
    "status": "success",
    "input": "Invoice INV-31763 for customer #8245 is 35 days overdue. Collect it.",
    "output": {
      "summary": "Collected invoice INV-31763 for customer #8245, charging $55.96 AUD to the valid card on file."
    },
    "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.000051,
      "sandbox_tools": true,
      "scenario_seed": "billing-agent:2026-10-24:17"
    },
    "step_count": 3,
    "total_tokens": 1438,
    "started_at": "2026-10-24T16:10:55.173+00:00",
    "ended_at": "2026-10-24T16:10:56.841+00:00",
    "actor_type": null,
    "actor_id": null
  },
  "events": [
    {
      "seq": 0,
      "name": "billing-agent",
      "type": "run",
      "error": null,
      "input": "Invoice INV-31763 for customer #8245 is 35 days overdue. Collect it.",
      "phase": "start",
      "output": null,
      "run_id": "sbx-billing-912a4e9b000e",
      "status": "running",
      "ts_end": "2026-10-24T16:10:56.841Z",
      "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.000051,
        "sandbox_tools": true,
        "scenario_seed": "billing-agent:2026-10-24:17"
      },
      "ts_start": "2026-10-24T16:10:55.173Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "eefe5758b8ced2d8a835df5ca647c162690dce44ddffa973856158d52ad28f7b"
    },
    {
      "seq": 1,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "openai/gpt-oss-20b",
        "provider": "groq"
      },
      "usage": {
        "input_tokens": 351,
        "total_tokens": 411,
        "output_tokens": 60
      },
      "run_id": "sbx-billing-912a4e9b000e",
      "ts_end": "2026-10-24T16:10:55.563Z",
      "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."
          }
        ],
        "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 send a payment reminder when it is not. 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-31763 for customer #8245 is 35 days overdue. Collect it."
          }
        ]
      },
      "span_id": "l1",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "invoice_id": "INV-31763"
            },
            "tool_name": "get_invoice",
            "tool_call_id": "fc_651fb2e0-514f-490e-b843-20ebf1be8578"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-10-24T16:10:55.173Z",
      "latency_ms": 390,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "d47014b94e562cc3bd80d506dc0b8ea9d404824d2a07977cbc2be8ae6715b021"
    },
    {
      "seq": 2,
      "type": "tool",
      "error": null,
      "input": {
        "invoice_id": "INV-31763"
      },
      "output": {
        "amount_aud": 55.96,
        "invoice_id": "INV-31763",
        "customer_id": 8245,
        "card_on_file": "valid",
        "days_overdue": 35
      },
      "run_id": "sbx-billing-912a4e9b000e",
      "ts_end": "2026-10-24T16:10:55.676Z",
      "span_id": "t1",
      "ts_start": "2026-10-24T16:10:55.563Z",
      "tool_name": "get_invoice",
      "latency_ms": 113,
      "tool_call_id": "fc_651fb2e0-514f-490e-b843-20ebf1be8578",
      "parent_span_id": "l1",
      "schema_version": 1,
      "policy_evaluated": {
        "passed": true
      },
      "_hash": "77634f27e59a6bcd0d23a522deff58a81adc584fab52e1679279d1137327fb14"
    },
    {
      "seq": 3,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "openai/gpt-oss-20b",
        "provider": "groq"
      },
      "usage": {
        "input_tokens": 414,
        "total_tokens": 496,
        "output_tokens": 82
      },
      "run_id": "sbx-billing-912a4e9b000e",
      "ts_end": "2026-10-24T16:10:56.069Z",
      "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."
          }
        ],
        "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 send a payment reminder when it is not. 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-31763 for customer #8245 is 35 days overdue. Collect it."
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "invoice_id": "INV-31763"
                },
                "toolName": "get_invoice",
                "toolCallId": "fc_651fb2e0-514f-490e-b843-20ebf1be8578"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "amount_aud": 55.96,
                    "invoice_id": "INV-31763",
                    "customer_id": 8245,
                    "card_on_file": "valid",
                    "days_overdue": 35
                  }
                },
                "toolName": "get_invoice",
                "toolCallId": "fc_651fb2e0-514f-490e-b843-20ebf1be8578"
              }
            ]
          }
        ]
      },
      "span_id": "l2",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "amount": 55.96,
              "invoice_id": "INV-31763",
              "customer_id": 8245
            },
            "tool_name": "charge_card",
            "tool_call_id": "fc_3fc604bb-7629-4fcd-9482-1e01cd0fe2c5"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-10-24T16:10:55.676Z",
      "latency_ms": 393,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "0b4e32fda7bd109b196e12ed1ac504a4f78aa4ed0d2a275b2368435286832077"
    },
    {
      "seq": 4,
      "type": "tool",
      "error": null,
      "input": {
        "amount": 55.96,
        "invoice_id": "INV-31763",
        "customer_id": 8245
      },
      "output": {
        "receipt": "RC-451763",
        "sandbox": true,
        "captured": true,
        "amount_aud": 55.96
      },
      "run_id": "sbx-billing-912a4e9b000e",
      "ts_end": "2026-10-24T16:10:56.118Z",
      "span_id": "t2",
      "ts_start": "2026-10-24T16:10:56.069Z",
      "tool_name": "charge_card",
      "latency_ms": 49,
      "tool_call_id": "fc_3fc604bb-7629-4fcd-9482-1e01cd0fe2c5",
      "parent_span_id": "l2",
      "schema_version": 1,
      "policy_evaluated": {
        "passed": true
      },
      "_hash": "85758dbc2b19bf17c01f3d62caceca4ac0a844bbca1cc94f082aabd2af89355e"
    },
    {
      "seq": 5,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "openai/gpt-oss-20b",
        "provider": "groq"
      },
      "usage": {
        "input_tokens": 481,
        "total_tokens": 531,
        "output_tokens": 50
      },
      "run_id": "sbx-billing-912a4e9b000e",
      "ts_end": "2026-10-24T16:10:56.841Z",
      "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."
          }
        ],
        "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 send a payment reminder when it is not. 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-31763 for customer #8245 is 35 days overdue. Collect it."
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "invoice_id": "INV-31763"
                },
                "toolName": "get_invoice",
                "toolCallId": "fc_651fb2e0-514f-490e-b843-20ebf1be8578"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "amount_aud": 55.96,
                    "invoice_id": "INV-31763",
                    "customer_id": 8245,
                    "card_on_file": "valid",
                    "days_overdue": 35
                  }
                },
                "toolName": "get_invoice",
                "toolCallId": "fc_651fb2e0-514f-490e-b843-20ebf1be8578"
              }
            ]
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "amount": 55.96,
                  "invoice_id": "INV-31763",
                  "customer_id": 8245
                },
                "toolName": "charge_card",
                "toolCallId": "fc_3fc604bb-7629-4fcd-9482-1e01cd0fe2c5"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "receipt": "RC-451763",
                    "sandbox": true,
                    "captured": true,
                    "amount_aud": 55.96
                  }
                },
                "toolName": "charge_card",
                "toolCallId": "fc_3fc604bb-7629-4fcd-9482-1e01cd0fe2c5"
              }
            ]
          }
        ]
      },
      "span_id": "l3",
      "response": {
        "text": "Collected invoice INV-31763 for customer #8245, charging $55.96 AUD to the valid card on file.",
        "reasoning": null,
        "tool_calls": [],
        "finish_reason": "stop"
      },
      "ts_start": "2026-10-24T16:10:56.118Z",
      "latency_ms": 723,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "97e29a9a3325114a88f96aead785b874046cbe7a648da5eda56979af96bce3c6"
    },
    {
      "seq": 6,
      "name": "billing-agent",
      "type": "run",
      "error": null,
      "input": null,
      "phase": "end",
      "output": {
        "summary": "Collected invoice INV-31763 for customer #8245, charging $55.96 AUD to the valid card on file."
      },
      "run_id": "sbx-billing-912a4e9b000e",
      "status": "success",
      "ts_end": "2026-10-24T16:10:56.841Z",
      "span_id": "re",
      "metadata": {
        "demo_agent": true,
        "sandbox_tools": true
      },
      "ts_start": "2026-10-24T16:10:56.841Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "87ce4390e9d8b838caa8df10eb0cd50a066ecb8bdeafe5b5bde4046c84818750"
    }
  ]
}