{
  "$schema": "runback.audit/v2",
  "manifest": {
    "run_id": "sbx-billing-174523b8b137",
    "generated_at": "2026-11-07T07:28:20.443Z",
    "event_count": 7,
    "algorithm": "sha256-chain",
    "content_digest": "1e665a295d5e1796f447fe2202933c6e12bd7b902f09397ca09182c313a3608a",
    "replay": {
      "cassette_digest": "fcc99d84760ef10f6172974bace3a226a92d141af68d5d18549bea9ac2f42e13",
      "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": "4825d93cf1747bef34cd475e437e653a5253210b5e06251a884765cc436c6517d9c38d765b968e34b501a10540673f192d7a98395f299c67a39a82be634f4402",
      "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-174523b8b137",
    "name": "billing-agent",
    "status": "success",
    "input": "Invoice INV-52859 for customer #4743 is 16 days overdue. Collect it.",
    "output": {
      "summary": "I successfully charged the customer's card for invoice INV-52859, collecting the overdue amount of AUD 492.24."
    },
    "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-07:25"
    },
    "step_count": 3,
    "total_tokens": 1257,
    "started_at": "2026-11-07T04:11:05.599+00:00",
    "ended_at": "2026-11-07T04:11:09.52+00:00",
    "actor_type": null,
    "actor_id": null
  },
  "events": [
    {
      "seq": 0,
      "name": "billing-agent",
      "type": "run",
      "error": null,
      "input": "Invoice INV-52859 for customer #4743 is 16 days overdue. Collect it.",
      "phase": "start",
      "output": null,
      "run_id": "sbx-billing-174523b8b137",
      "status": "running",
      "ts_end": "2026-11-07T04:11:09.520Z",
      "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-07:25"
      },
      "ts_start": "2026-11-07T04:11:05.599Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "2dc45a359761fb9e5f47645a593fab8e09d959840f9f5aea89f5869c3307054a"
    },
    {
      "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-174523b8b137",
      "ts_end": "2026-11-07T04:11:06.969Z",
      "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-52859 for customer #4743 is 16 days overdue. Collect it."
          }
        ]
      },
      "span_id": "l1",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "invoice_id": "INV-52859"
            },
            "tool_name": "get_invoice",
            "tool_call_id": "call_4STdJmJFZ6QYnpLyz9cwFfC8"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-11-07T04:11:05.599Z",
      "latency_ms": 1369,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "0f881b5a62683bf0ab333c140a46bb22afd6d63b7b479907983546048f47a6a2"
    },
    {
      "seq": 2,
      "type": "tool",
      "error": null,
      "input": {
        "invoice_id": "INV-52859"
      },
      "output": {
        "amount_aud": 492.24,
        "invoice_id": "INV-52859",
        "customer_id": 4743,
        "card_on_file": "valid",
        "days_overdue": 16
      },
      "run_id": "sbx-billing-174523b8b137",
      "ts_end": "2026-11-07T04:11:06.991Z",
      "span_id": "t1",
      "ts_start": "2026-11-07T04:11:06.969Z",
      "tool_name": "get_invoice",
      "latency_ms": 22,
      "tool_call_id": "call_4STdJmJFZ6QYnpLyz9cwFfC8",
      "parent_span_id": "l1",
      "schema_version": 1,
      "policy_evaluated": {
        "passed": true
      },
      "_hash": "511589171a80ebe571f0a96f693e70af212147f9d4690d6293472337a7b124bf"
    },
    {
      "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-174523b8b137",
      "ts_end": "2026-11-07T04:11:08.299Z",
      "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-52859 for customer #4743 is 16 days overdue. Collect it."
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "invoice_id": "INV-52859"
                },
                "toolName": "get_invoice",
                "toolCallId": "call_4STdJmJFZ6QYnpLyz9cwFfC8"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "amount_aud": 492.24,
                    "invoice_id": "INV-52859",
                    "customer_id": 4743,
                    "card_on_file": "valid",
                    "days_overdue": 16
                  }
                },
                "toolName": "get_invoice",
                "toolCallId": "call_4STdJmJFZ6QYnpLyz9cwFfC8"
              }
            ]
          }
        ]
      },
      "span_id": "l2",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "amount": 492.24,
              "invoice_id": "INV-52859",
              "customer_id": 4743
            },
            "tool_name": "charge_card",
            "tool_call_id": "call_cXSr01mKYNpmtS3qH3BPtbkq"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-11-07T04:11:06.991Z",
      "latency_ms": 1308,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "b31b6d95f8573aaee9b1c750f5c7036cd4b33af1dcea265c094b6ffc4b467c4f"
    },
    {
      "seq": 4,
      "type": "tool",
      "error": null,
      "input": {
        "amount": 492.24,
        "invoice_id": "INV-52859",
        "customer_id": 4743
      },
      "output": {
        "receipt": "RC-432859",
        "sandbox": true,
        "captured": true,
        "amount_aud": 492.24
      },
      "run_id": "sbx-billing-174523b8b137",
      "ts_end": "2026-11-07T04:11:08.319Z",
      "span_id": "t2",
      "ts_start": "2026-11-07T04:11:08.299Z",
      "tool_name": "charge_card",
      "latency_ms": 20,
      "tool_call_id": "call_cXSr01mKYNpmtS3qH3BPtbkq",
      "parent_span_id": "l2",
      "schema_version": 1,
      "policy_evaluated": {
        "passed": true
      },
      "_hash": "c52cacf467aeaf898b683eaa111898163f4a3a5e96c179740a933600eef75d38"
    },
    {
      "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-174523b8b137",
      "ts_end": "2026-11-07T04:11:09.520Z",
      "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-52859 for customer #4743 is 16 days overdue. Collect it."
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "invoice_id": "INV-52859"
                },
                "toolName": "get_invoice",
                "toolCallId": "call_4STdJmJFZ6QYnpLyz9cwFfC8"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "amount_aud": 492.24,
                    "invoice_id": "INV-52859",
                    "customer_id": 4743,
                    "card_on_file": "valid",
                    "days_overdue": 16
                  }
                },
                "toolName": "get_invoice",
                "toolCallId": "call_4STdJmJFZ6QYnpLyz9cwFfC8"
              }
            ]
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "amount": 492.24,
                  "invoice_id": "INV-52859",
                  "customer_id": 4743
                },
                "toolName": "charge_card",
                "toolCallId": "call_cXSr01mKYNpmtS3qH3BPtbkq"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "receipt": "RC-432859",
                    "sandbox": true,
                    "captured": true,
                    "amount_aud": 492.24
                  }
                },
                "toolName": "charge_card",
                "toolCallId": "call_cXSr01mKYNpmtS3qH3BPtbkq"
              }
            ]
          }
        ]
      },
      "span_id": "l3",
      "response": {
        "text": "I successfully charged the customer's card for invoice INV-52859, collecting the overdue amount of AUD 492.24.",
        "reasoning": null,
        "tool_calls": [],
        "finish_reason": "stop"
      },
      "ts_start": "2026-11-07T04:11:08.319Z",
      "latency_ms": 1201,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "c4173d22f82e61e2cd95389fc5216dbbf4de52256d0012613a46e1e57e0ee650"
    },
    {
      "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-52859, collecting the overdue amount of AUD 492.24."
      },
      "run_id": "sbx-billing-174523b8b137",
      "status": "success",
      "ts_end": "2026-11-07T04:11:09.520Z",
      "span_id": "re",
      "metadata": {
        "demo_agent": true,
        "sandbox_tools": true
      },
      "ts_start": "2026-11-07T04:11:09.520Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "1e665a295d5e1796f447fe2202933c6e12bd7b902f09397ca09182c313a3608a"
    }
  ]
}