{
  "$schema": "runback.audit/v2",
  "manifest": {
    "run_id": "sbx-billing-c0cb664fe413",
    "generated_at": "2026-11-07T07:35:53.800Z",
    "event_count": 7,
    "algorithm": "sha256-chain",
    "content_digest": "a9504965192ed19f4db428e43d334e03fb7cc0bf0ac9db8c05f7f69138eeb589",
    "replay": {
      "cassette_digest": "254350d5a73440d5091e412abc9603e65f1a7b23951055aad8125654c80deec2",
      "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": "6d4d9c4269b22d778e4d978457e724a51fb2764677bde21abaae6abd8b2a98236db66ac397f752069734985b3a8ca9dbf48570d47f46f16406dcd2e8bcebab01",
      "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-c0cb664fe413",
    "name": "billing-agent",
    "status": "success",
    "input": "Invoice INV-36004 for customer #4246 is 17 days overdue. Collect it.",
    "output": {
      "summary": "I successfully charged the overdue invoice INV-36004 for customer #4246, capturing the amount of AUD 175.33."
    },
    "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-11-02:73"
    },
    "step_count": 3,
    "total_tokens": 1259,
    "started_at": "2026-11-02T14:10:49.555+00:00",
    "ended_at": "2026-11-02T14:10:57.104+00:00",
    "actor_type": null,
    "actor_id": null
  },
  "events": [
    {
      "seq": 0,
      "name": "billing-agent",
      "type": "run",
      "error": null,
      "input": "Invoice INV-36004 for customer #4246 is 17 days overdue. Collect it.",
      "phase": "start",
      "output": null,
      "run_id": "sbx-billing-c0cb664fe413",
      "status": "running",
      "ts_end": "2026-11-02T14:10:57.104Z",
      "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-11-02:73"
      },
      "ts_start": "2026-11-02T14:10:49.555Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "2abd55a8e61eb590f8a665356c034cd2332aec205499cd1fc2fdd0f3691f02cb"
    },
    {
      "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-c0cb664fe413",
      "ts_end": "2026-11-02T14:10:52.061Z",
      "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-36004 for customer #4246 is 17 days overdue. Collect it."
          }
        ]
      },
      "span_id": "l1",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "invoice_id": "INV-36004"
            },
            "tool_name": "get_invoice",
            "tool_call_id": "call_5cyJ0dPm5ENRBtFIUuwlPWv9"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-11-02T14:10:49.555Z",
      "latency_ms": 2505,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "00199a2b8a4b0b77df891fd3d2c5dbc77fed7581ddce5f2a02bd02df5cf632ef"
    },
    {
      "seq": 2,
      "type": "tool",
      "error": null,
      "input": {
        "invoice_id": "INV-36004"
      },
      "output": {
        "amount_aud": 175.33,
        "invoice_id": "INV-36004",
        "customer_id": 4246,
        "card_on_file": "valid",
        "days_overdue": 17
      },
      "run_id": "sbx-billing-c0cb664fe413",
      "ts_end": "2026-11-02T14:10:52.265Z",
      "span_id": "t1",
      "ts_start": "2026-11-02T14:10:52.062Z",
      "tool_name": "get_invoice",
      "latency_ms": 203,
      "tool_call_id": "call_5cyJ0dPm5ENRBtFIUuwlPWv9",
      "parent_span_id": "l1",
      "schema_version": 1,
      "policy_evaluated": {
        "passed": true
      },
      "_hash": "be3d7045efb833833a8a70b5a2121f575abfa5879a07c5fc16074028566c1b8f"
    },
    {
      "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-c0cb664fe413",
      "ts_end": "2026-11-02T14:10:55.565Z",
      "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-36004 for customer #4246 is 17 days overdue. Collect it."
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "invoice_id": "INV-36004"
                },
                "toolName": "get_invoice",
                "toolCallId": "call_5cyJ0dPm5ENRBtFIUuwlPWv9"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "amount_aud": 175.33,
                    "invoice_id": "INV-36004",
                    "customer_id": 4246,
                    "card_on_file": "valid",
                    "days_overdue": 17
                  }
                },
                "toolName": "get_invoice",
                "toolCallId": "call_5cyJ0dPm5ENRBtFIUuwlPWv9"
              }
            ]
          }
        ]
      },
      "span_id": "l2",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "amount": 175.33,
              "invoice_id": "INV-36004",
              "customer_id": 4246
            },
            "tool_name": "charge_card",
            "tool_call_id": "call_ePq7jcMwFJjX2nAP84V1fjgj"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-11-02T14:10:52.265Z",
      "latency_ms": 3300,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "9657640edc5cf2589f6fa5d6d00577b95a0402c473e99a5b8aa60940bb27d9e7"
    },
    {
      "seq": 4,
      "type": "tool",
      "error": null,
      "input": {
        "amount": 175.33,
        "invoice_id": "INV-36004",
        "customer_id": 4246
      },
      "output": {
        "receipt": "RC-466004",
        "sandbox": true,
        "captured": true,
        "amount_aud": 175.33
      },
      "run_id": "sbx-billing-c0cb664fe413",
      "ts_end": "2026-11-02T14:10:55.594Z",
      "span_id": "t2",
      "ts_start": "2026-11-02T14:10:55.565Z",
      "tool_name": "charge_card",
      "latency_ms": 29,
      "tool_call_id": "call_ePq7jcMwFJjX2nAP84V1fjgj",
      "parent_span_id": "l2",
      "schema_version": 1,
      "policy_evaluated": {
        "passed": true
      },
      "_hash": "1703f1f3b43d240b9a0876e0e936a04ad260d7d96c0d9d7f970a895a41fa72b8"
    },
    {
      "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-c0cb664fe413",
      "ts_end": "2026-11-02T14:10:57.104Z",
      "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-36004 for customer #4246 is 17 days overdue. Collect it."
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "invoice_id": "INV-36004"
                },
                "toolName": "get_invoice",
                "toolCallId": "call_5cyJ0dPm5ENRBtFIUuwlPWv9"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "amount_aud": 175.33,
                    "invoice_id": "INV-36004",
                    "customer_id": 4246,
                    "card_on_file": "valid",
                    "days_overdue": 17
                  }
                },
                "toolName": "get_invoice",
                "toolCallId": "call_5cyJ0dPm5ENRBtFIUuwlPWv9"
              }
            ]
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "amount": 175.33,
                  "invoice_id": "INV-36004",
                  "customer_id": 4246
                },
                "toolName": "charge_card",
                "toolCallId": "call_ePq7jcMwFJjX2nAP84V1fjgj"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "receipt": "RC-466004",
                    "sandbox": true,
                    "captured": true,
                    "amount_aud": 175.33
                  }
                },
                "toolName": "charge_card",
                "toolCallId": "call_ePq7jcMwFJjX2nAP84V1fjgj"
              }
            ]
          }
        ]
      },
      "span_id": "l3",
      "response": {
        "text": "I successfully charged the overdue invoice INV-36004 for customer #4246, capturing the amount of AUD 175.33.",
        "reasoning": null,
        "tool_calls": [],
        "finish_reason": "stop"
      },
      "ts_start": "2026-11-02T14:10:55.594Z",
      "latency_ms": 1510,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "d92ecaafe23f3f3b525de17e51ab297da876396d8f845a9280499b880bff0a9f"
    },
    {
      "seq": 6,
      "name": "billing-agent",
      "type": "run",
      "error": null,
      "input": null,
      "phase": "end",
      "output": {
        "summary": "I successfully charged the overdue invoice INV-36004 for customer #4246, capturing the amount of AUD 175.33."
      },
      "run_id": "sbx-billing-c0cb664fe413",
      "status": "success",
      "ts_end": "2026-11-02T14:10:57.104Z",
      "span_id": "re",
      "metadata": {
        "demo_agent": true,
        "sandbox_tools": true
      },
      "ts_start": "2026-11-02T14:10:57.104Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "a9504965192ed19f4db428e43d334e03fb7cc0bf0ac9db8c05f7f69138eeb589"
    }
  ]
}