{
  "$schema": "runback.audit/v2",
  "manifest": {
    "run_id": "sbx-billing-b4c190447463",
    "generated_at": "2026-11-07T07:36:00.899Z",
    "event_count": 7,
    "algorithm": "sha256-chain",
    "content_digest": "c71628887a5eac942b97eb5f6cf805a8cc8b6f6a0b4a82ad6c12c0c53d56c52b",
    "replay": {
      "cassette_digest": "31222b1c9a27e1044dcf81ee2537a9699bd530335c2426d16ce80591325e1f7d",
      "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": "26f72bcd0ebeafee75eefcf8a65d39286c86823868cbc749d4af7219527cc77e54a9d5555986509ba26e1f73724cbb3ba2cfab9785d3d2d7303c0b7ff15b180d",
      "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-b4c190447463",
    "name": "billing-agent",
    "status": "success",
    "input": "Invoice INV-97580 for customer #6919 is 28 days overdue. Collect it.",
    "output": {
      "summary": "I successfully charged the overdue invoice INV-97580 for customer #6919, capturing the amount of AUD 836.81."
    },
    "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-10-30:73"
    },
    "step_count": 3,
    "total_tokens": 1259,
    "started_at": "2026-10-30T14:10:48.704+00:00",
    "ended_at": "2026-10-30T14:10:54.404+00:00",
    "actor_type": null,
    "actor_id": null
  },
  "events": [
    {
      "seq": 0,
      "name": "billing-agent",
      "type": "run",
      "error": null,
      "input": "Invoice INV-97580 for customer #6919 is 28 days overdue. Collect it.",
      "phase": "start",
      "output": null,
      "run_id": "sbx-billing-b4c190447463",
      "status": "running",
      "ts_end": "2026-10-30T14:10:54.404Z",
      "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-10-30:73"
      },
      "ts_start": "2026-10-30T14:10:48.704Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "b74e6a4b5933ef4efdf5be7171391db617f76f3bd119229708dbd002d02881e2"
    },
    {
      "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-b4c190447463",
      "ts_end": "2026-10-30T14:10:50.904Z",
      "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-97580 for customer #6919 is 28 days overdue. Collect it."
          }
        ]
      },
      "span_id": "l1",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "invoice_id": "INV-97580"
            },
            "tool_name": "get_invoice",
            "tool_call_id": "call_hGedEFQcgzcSYmOPRL3VETDj"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-10-30T14:10:48.704Z",
      "latency_ms": 2200,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "185dc7ac0cb1813258fd0a430580407619a812e070d5c1e16aba7d824d533442"
    },
    {
      "seq": 2,
      "type": "tool",
      "error": null,
      "input": {
        "invoice_id": "INV-97580"
      },
      "output": {
        "amount_aud": 836.81,
        "invoice_id": "INV-97580",
        "customer_id": 6919,
        "card_on_file": "valid",
        "days_overdue": 28
      },
      "run_id": "sbx-billing-b4c190447463",
      "ts_end": "2026-10-30T14:10:51.051Z",
      "span_id": "t1",
      "ts_start": "2026-10-30T14:10:50.904Z",
      "tool_name": "get_invoice",
      "latency_ms": 147,
      "tool_call_id": "call_hGedEFQcgzcSYmOPRL3VETDj",
      "parent_span_id": "l1",
      "schema_version": 1,
      "policy_evaluated": {
        "passed": true
      },
      "_hash": "1c232bdc375a69caece6390906f9120ff7edca0f0196156db58eec900963f056"
    },
    {
      "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-b4c190447463",
      "ts_end": "2026-10-30T14:10:52.736Z",
      "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-97580 for customer #6919 is 28 days overdue. Collect it."
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "invoice_id": "INV-97580"
                },
                "toolName": "get_invoice",
                "toolCallId": "call_hGedEFQcgzcSYmOPRL3VETDj"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "amount_aud": 836.81,
                    "invoice_id": "INV-97580",
                    "customer_id": 6919,
                    "card_on_file": "valid",
                    "days_overdue": 28
                  }
                },
                "toolName": "get_invoice",
                "toolCallId": "call_hGedEFQcgzcSYmOPRL3VETDj"
              }
            ]
          }
        ]
      },
      "span_id": "l2",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "amount": 836.81,
              "invoice_id": "INV-97580",
              "customer_id": 6919
            },
            "tool_name": "charge_card",
            "tool_call_id": "call_Z81RErI6OwtdXV2MiWjHFyat"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-10-30T14:10:51.051Z",
      "latency_ms": 1684,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "c9c77b2ef27cb943924bbb1f0277f6ffd16499ae8fd541b7046045e68e9eeb9e"
    },
    {
      "seq": 4,
      "type": "tool",
      "error": null,
      "input": {
        "amount": 836.81,
        "invoice_id": "INV-97580",
        "customer_id": 6919
      },
      "output": {
        "receipt": "RC-197580",
        "sandbox": true,
        "captured": true,
        "amount_aud": 836.81
      },
      "run_id": "sbx-billing-b4c190447463",
      "ts_end": "2026-10-30T14:10:52.780Z",
      "span_id": "t2",
      "ts_start": "2026-10-30T14:10:52.736Z",
      "tool_name": "charge_card",
      "latency_ms": 44,
      "tool_call_id": "call_Z81RErI6OwtdXV2MiWjHFyat",
      "parent_span_id": "l2",
      "schema_version": 1,
      "policy_evaluated": {
        "passed": true
      },
      "_hash": "0d5f9e275ce1f3f58ae93026d0c0e1fd3ed77ae08092e3f62597481692dcc844"
    },
    {
      "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-b4c190447463",
      "ts_end": "2026-10-30T14:10:54.404Z",
      "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-97580 for customer #6919 is 28 days overdue. Collect it."
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "invoice_id": "INV-97580"
                },
                "toolName": "get_invoice",
                "toolCallId": "call_hGedEFQcgzcSYmOPRL3VETDj"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "amount_aud": 836.81,
                    "invoice_id": "INV-97580",
                    "customer_id": 6919,
                    "card_on_file": "valid",
                    "days_overdue": 28
                  }
                },
                "toolName": "get_invoice",
                "toolCallId": "call_hGedEFQcgzcSYmOPRL3VETDj"
              }
            ]
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "amount": 836.81,
                  "invoice_id": "INV-97580",
                  "customer_id": 6919
                },
                "toolName": "charge_card",
                "toolCallId": "call_Z81RErI6OwtdXV2MiWjHFyat"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "receipt": "RC-197580",
                    "sandbox": true,
                    "captured": true,
                    "amount_aud": 836.81
                  }
                },
                "toolName": "charge_card",
                "toolCallId": "call_Z81RErI6OwtdXV2MiWjHFyat"
              }
            ]
          }
        ]
      },
      "span_id": "l3",
      "response": {
        "text": "I successfully charged the overdue invoice INV-97580 for customer #6919, capturing the amount of AUD 836.81.",
        "reasoning": null,
        "tool_calls": [],
        "finish_reason": "stop"
      },
      "ts_start": "2026-10-30T14:10:52.780Z",
      "latency_ms": 1624,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "13088a21f6dd13c0e6254f6d3e68ec41f75c43a3c93ed5d4067811672f78da8e"
    },
    {
      "seq": 6,
      "name": "billing-agent",
      "type": "run",
      "error": null,
      "input": null,
      "phase": "end",
      "output": {
        "summary": "I successfully charged the overdue invoice INV-97580 for customer #6919, capturing the amount of AUD 836.81."
      },
      "run_id": "sbx-billing-b4c190447463",
      "status": "success",
      "ts_end": "2026-10-30T14:10:54.404Z",
      "span_id": "re",
      "metadata": {
        "demo_agent": true,
        "sandbox_tools": true
      },
      "ts_start": "2026-10-30T14:10:54.404Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "c71628887a5eac942b97eb5f6cf805a8cc8b6f6a0b4a82ad6c12c0c53d56c52b"
    }
  ]
}