{
  "$schema": "runback.audit/v2",
  "manifest": {
    "run_id": "sbx-billing-3c15ec245d50",
    "generated_at": "2026-11-07T07:36:01.901Z",
    "event_count": 7,
    "algorithm": "sha256-chain",
    "content_digest": "1514f74a24583bc0d980884aa71ed4282e39bb0bdbe4fc75ce18dc4b0944a1bb",
    "replay": {
      "cassette_digest": "95573e4699d549d0f5d4538d556078aefdf8efd0a239f2956b3cbf739dea9166",
      "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": "403e8734e55fcb9e1a4373f71ec373dc57d7d5136cfced585c5d530b43687c92bd5358abed8d7ccaf20dd9bde27b66b71f311c35223df3a7f34b8d90d3c9050b",
      "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-3c15ec245d50",
    "name": "billing-agent",
    "status": "success",
    "input": "Invoice INV-21231 for customer #2780 is 41 days overdue. Collect it.",
    "output": {
      "summary": "Charged $354.69 AUD to customer #2780 for overdue invoice INV-21231, receipt RC-801231."
    },
    "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.000058,
      "sandbox_tools": true,
      "scenario_seed": "billing-agent:2026-10-25:49"
    },
    "step_count": 3,
    "total_tokens": 1697,
    "started_at": "2026-10-25T09:10:55.607+00:00",
    "ended_at": "2026-10-25T09:10:56.888+00:00",
    "actor_type": null,
    "actor_id": null
  },
  "events": [
    {
      "seq": 0,
      "name": "billing-agent",
      "type": "run",
      "error": null,
      "input": "Invoice INV-21231 for customer #2780 is 41 days overdue. Collect it.",
      "phase": "start",
      "output": null,
      "run_id": "sbx-billing-3c15ec245d50",
      "status": "running",
      "ts_end": "2026-10-25T09:10:56.888Z",
      "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.000058,
        "sandbox_tools": true,
        "scenario_seed": "billing-agent:2026-10-25:49"
      },
      "ts_start": "2026-10-25T09:10:55.607Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "326aa6972858eacfc695a1a9f25673f2caebc7e7cbf1995762504c2871d7963b"
    },
    {
      "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-3c15ec245d50",
      "ts_end": "2026-10-25T09:10:56.015Z",
      "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-21231 for customer #2780 is 41 days overdue. Collect it."
          }
        ]
      },
      "span_id": "l1",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "invoice_id": "INV-21231"
            },
            "tool_name": "get_invoice",
            "tool_call_id": "fc_c284b676-a682-4a1c-b6d5-d63ed016aed1"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-10-25T09:10:55.607Z",
      "latency_ms": 408,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "bd2b1491c668995e61e3c2a6d0a118441aeae0f8c6e8cc6be2467af6f2d1c8aa"
    },
    {
      "seq": 2,
      "type": "tool",
      "error": null,
      "input": {
        "invoice_id": "INV-21231"
      },
      "output": {
        "amount_aud": 354.69,
        "invoice_id": "INV-21231",
        "customer_id": 2780,
        "card_on_file": "valid",
        "days_overdue": 41
      },
      "run_id": "sbx-billing-3c15ec245d50",
      "ts_end": "2026-10-25T09:10:56.038Z",
      "span_id": "t1",
      "ts_start": "2026-10-25T09:10:56.015Z",
      "tool_name": "get_invoice",
      "latency_ms": 23,
      "tool_call_id": "fc_c284b676-a682-4a1c-b6d5-d63ed016aed1",
      "parent_span_id": "l1",
      "schema_version": 1,
      "policy_evaluated": {
        "passed": true
      },
      "_hash": "35fece3bea1152699e3662d31ce524958a21544b1a6db0550a74862d36e172d6"
    },
    {
      "seq": 3,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "openai/gpt-oss-20b",
        "provider": "groq"
      },
      "usage": {
        "input_tokens": 500,
        "total_tokens": 578,
        "output_tokens": 78
      },
      "run_id": "sbx-billing-3c15ec245d50",
      "ts_end": "2026-10-25T09:10:56.497Z",
      "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-21231 for customer #2780 is 41 days overdue. Collect it."
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "invoice_id": "INV-21231"
                },
                "toolName": "get_invoice",
                "toolCallId": "fc_c284b676-a682-4a1c-b6d5-d63ed016aed1"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "amount_aud": 354.69,
                    "invoice_id": "INV-21231",
                    "customer_id": 2780,
                    "card_on_file": "valid",
                    "days_overdue": 41
                  }
                },
                "toolName": "get_invoice",
                "toolCallId": "fc_c284b676-a682-4a1c-b6d5-d63ed016aed1"
              }
            ]
          }
        ]
      },
      "span_id": "l2",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "amount": 354.69,
              "invoice_id": "INV-21231",
              "customer_id": 2780
            },
            "tool_name": "charge_card",
            "tool_call_id": "fc_6c56757b-730b-421e-9bcd-8d4fd51dd6dc"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-10-25T09:10:56.038Z",
      "latency_ms": 458,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "eb36dac770ba6f419c08b5f28b2ad3bd90822b4036a0a67961a53e5f6ee16821"
    },
    {
      "seq": 4,
      "type": "tool",
      "error": null,
      "input": {
        "amount": 354.69,
        "invoice_id": "INV-21231",
        "customer_id": 2780
      },
      "output": {
        "receipt": "RC-801231",
        "sandbox": true,
        "captured": true,
        "amount_aud": 354.69
      },
      "run_id": "sbx-billing-3c15ec245d50",
      "ts_end": "2026-10-25T09:10:56.522Z",
      "span_id": "t2",
      "ts_start": "2026-10-25T09:10:56.497Z",
      "tool_name": "charge_card",
      "latency_ms": 25,
      "tool_call_id": "fc_6c56757b-730b-421e-9bcd-8d4fd51dd6dc",
      "parent_span_id": "l2",
      "schema_version": 1,
      "policy_evaluated": {
        "passed": true
      },
      "_hash": "2e5ed072d5e01413dec1d773d72d91c20b4f347f7cca41597bffe7311c36d983"
    },
    {
      "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-3c15ec245d50",
      "ts_end": "2026-10-25T09:10:56.888Z",
      "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-21231 for customer #2780 is 41 days overdue. Collect it."
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "invoice_id": "INV-21231"
                },
                "toolName": "get_invoice",
                "toolCallId": "fc_c284b676-a682-4a1c-b6d5-d63ed016aed1"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "amount_aud": 354.69,
                    "invoice_id": "INV-21231",
                    "customer_id": 2780,
                    "card_on_file": "valid",
                    "days_overdue": 41
                  }
                },
                "toolName": "get_invoice",
                "toolCallId": "fc_c284b676-a682-4a1c-b6d5-d63ed016aed1"
              }
            ]
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "amount": 354.69,
                  "invoice_id": "INV-21231",
                  "customer_id": 2780
                },
                "toolName": "charge_card",
                "toolCallId": "fc_6c56757b-730b-421e-9bcd-8d4fd51dd6dc"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "receipt": "RC-801231",
                    "sandbox": true,
                    "captured": true,
                    "amount_aud": 354.69
                  }
                },
                "toolName": "charge_card",
                "toolCallId": "fc_6c56757b-730b-421e-9bcd-8d4fd51dd6dc"
              }
            ]
          }
        ]
      },
      "span_id": "l3",
      "response": {
        "text": "Charged $354.69 AUD to customer #2780 for overdue invoice INV-21231, receipt RC-801231.",
        "reasoning": null,
        "tool_calls": [],
        "finish_reason": "stop"
      },
      "ts_start": "2026-10-25T09:10:56.522Z",
      "latency_ms": 366,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "c0352452049dca85850f9c4765eb8c7e436dedf1d9bdf0fd83affcac955c3829"
    },
    {
      "seq": 6,
      "name": "billing-agent",
      "type": "run",
      "error": null,
      "input": null,
      "phase": "end",
      "output": {
        "summary": "Charged $354.69 AUD to customer #2780 for overdue invoice INV-21231, receipt RC-801231."
      },
      "run_id": "sbx-billing-3c15ec245d50",
      "status": "success",
      "ts_end": "2026-10-25T09:10:56.888Z",
      "span_id": "re",
      "metadata": {
        "demo_agent": true,
        "sandbox_tools": true
      },
      "ts_start": "2026-10-25T09:10:56.888Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "1514f74a24583bc0d980884aa71ed4282e39bb0bdbe4fc75ce18dc4b0944a1bb"
    }
  ]
}