{
  "$schema": "runback.audit/v2",
  "manifest": {
    "run_id": "sbx-billing-c28ccb464e41",
    "generated_at": "2026-11-07T07:35:53.609Z",
    "event_count": 7,
    "algorithm": "sha256-chain",
    "content_digest": "55d791ac89b4c008d14bc790e891a4d7ca915053dcf17fad66dd26e215e63eb0",
    "replay": {
      "cassette_digest": "414558424ad6db235938d47a4ba240b3f3a6b64f505a79c0a42a5fe2aaa8e8c6",
      "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": "75756346c90567ad4757a39c16cf11b36c7f8df92e5b6a11ac154796cc5911c0e6e45971b5c56a89e61abb9c43169c310948ed82a543e500b74660f07f8c8c0a",
      "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-c28ccb464e41",
    "name": "billing-agent",
    "status": "success",
    "input": "Invoice INV-11387 for customer #4118 is 34 days overdue. Collect it.",
    "output": {
      "summary": "Charged $171.48 AUD to customer #4118 for overdue invoice INV-11387 and received receipt RC-181387."
    },
    "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.000057,
      "sandbox_tools": true,
      "scenario_seed": "billing-agent:2026-11-06:9"
    },
    "step_count": 3,
    "total_tokens": 1695,
    "started_at": "2026-11-06T01:11:08.11+00:00",
    "ended_at": "2026-11-06T01:11:10.651+00:00",
    "actor_type": null,
    "actor_id": null
  },
  "events": [
    {
      "seq": 0,
      "name": "billing-agent",
      "type": "run",
      "error": null,
      "input": "Invoice INV-11387 for customer #4118 is 34 days overdue. Collect it.",
      "phase": "start",
      "output": null,
      "run_id": "sbx-billing-c28ccb464e41",
      "status": "running",
      "ts_end": "2026-11-06T01:11:10.651Z",
      "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.000057,
        "sandbox_tools": true,
        "scenario_seed": "billing-agent:2026-11-06:9"
      },
      "ts_start": "2026-11-06T01:11:08.110Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "6dab26d30825f456f2ea637394d5d87459de324dcc0c38970b59693b633be195"
    },
    {
      "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-c28ccb464e41",
      "ts_end": "2026-11-06T01:11:09.730Z",
      "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-11387 for customer #4118 is 34 days overdue. Collect it."
          }
        ]
      },
      "span_id": "l1",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "invoice_id": "INV-11387"
            },
            "tool_name": "get_invoice",
            "tool_call_id": "fc_3ead25d9-81e9-4fa4-8842-070ab86dac47"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-11-06T01:11:08.110Z",
      "latency_ms": 1620,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "6ddfd7806f62b1bb17fb61896b9ca3b940ab09137111f5beefd9cedb849aad88"
    },
    {
      "seq": 2,
      "type": "tool",
      "error": null,
      "input": {
        "invoice_id": "INV-11387"
      },
      "output": {
        "amount_aud": 171.48,
        "invoice_id": "INV-11387",
        "customer_id": 4118,
        "card_on_file": "valid",
        "days_overdue": 34
      },
      "run_id": "sbx-billing-c28ccb464e41",
      "ts_end": "2026-11-06T01:11:09.754Z",
      "span_id": "t1",
      "ts_start": "2026-11-06T01:11:09.730Z",
      "tool_name": "get_invoice",
      "latency_ms": 24,
      "tool_call_id": "fc_3ead25d9-81e9-4fa4-8842-070ab86dac47",
      "parent_span_id": "l1",
      "schema_version": 1,
      "policy_evaluated": {
        "passed": true
      },
      "_hash": "96f237fd11fe230b075b8a03f3c7f293083ec418bd17c2a22fef3c6bd06adbed"
    },
    {
      "seq": 3,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "openai/gpt-oss-20b",
        "provider": "groq"
      },
      "usage": {
        "input_tokens": 500,
        "total_tokens": 575,
        "output_tokens": 75
      },
      "run_id": "sbx-billing-c28ccb464e41",
      "ts_end": "2026-11-06T01:11:10.150Z",
      "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-11387 for customer #4118 is 34 days overdue. Collect it."
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "invoice_id": "INV-11387"
                },
                "toolName": "get_invoice",
                "toolCallId": "fc_3ead25d9-81e9-4fa4-8842-070ab86dac47"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "amount_aud": 171.48,
                    "invoice_id": "INV-11387",
                    "customer_id": 4118,
                    "card_on_file": "valid",
                    "days_overdue": 34
                  }
                },
                "toolName": "get_invoice",
                "toolCallId": "fc_3ead25d9-81e9-4fa4-8842-070ab86dac47"
              }
            ]
          }
        ]
      },
      "span_id": "l2",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "amount": 171.48,
              "invoice_id": "INV-11387",
              "customer_id": 4118
            },
            "tool_name": "charge_card",
            "tool_call_id": "fc_9bdefd48-b5eb-4a23-b4a6-d49cafe8af45"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-11-06T01:11:09.754Z",
      "latency_ms": 396,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "f46ecd9ef11398a6f00a461590657df10bc70ed9330cb66fa577d86af41d69e9"
    },
    {
      "seq": 4,
      "type": "tool",
      "error": null,
      "input": {
        "amount": 171.48,
        "invoice_id": "INV-11387",
        "customer_id": 4118
      },
      "output": {
        "receipt": "RC-181387",
        "sandbox": true,
        "captured": true,
        "amount_aud": 171.48
      },
      "run_id": "sbx-billing-c28ccb464e41",
      "ts_end": "2026-11-06T01:11:10.259Z",
      "span_id": "t2",
      "ts_start": "2026-11-06T01:11:10.150Z",
      "tool_name": "charge_card",
      "latency_ms": 109,
      "tool_call_id": "fc_9bdefd48-b5eb-4a23-b4a6-d49cafe8af45",
      "parent_span_id": "l2",
      "schema_version": 1,
      "policy_evaluated": {
        "passed": true
      },
      "_hash": "7eb81db01e2282e650aef240db42ee47be3aa34e12429382dc7abd55acb2d94b"
    },
    {
      "seq": 5,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "openai/gpt-oss-20b",
        "provider": "groq"
      },
      "usage": {
        "input_tokens": 567,
        "total_tokens": 619,
        "output_tokens": 52
      },
      "run_id": "sbx-billing-c28ccb464e41",
      "ts_end": "2026-11-06T01:11:10.651Z",
      "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-11387 for customer #4118 is 34 days overdue. Collect it."
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "invoice_id": "INV-11387"
                },
                "toolName": "get_invoice",
                "toolCallId": "fc_3ead25d9-81e9-4fa4-8842-070ab86dac47"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "amount_aud": 171.48,
                    "invoice_id": "INV-11387",
                    "customer_id": 4118,
                    "card_on_file": "valid",
                    "days_overdue": 34
                  }
                },
                "toolName": "get_invoice",
                "toolCallId": "fc_3ead25d9-81e9-4fa4-8842-070ab86dac47"
              }
            ]
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "amount": 171.48,
                  "invoice_id": "INV-11387",
                  "customer_id": 4118
                },
                "toolName": "charge_card",
                "toolCallId": "fc_9bdefd48-b5eb-4a23-b4a6-d49cafe8af45"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "receipt": "RC-181387",
                    "sandbox": true,
                    "captured": true,
                    "amount_aud": 171.48
                  }
                },
                "toolName": "charge_card",
                "toolCallId": "fc_9bdefd48-b5eb-4a23-b4a6-d49cafe8af45"
              }
            ]
          }
        ]
      },
      "span_id": "l3",
      "response": {
        "text": "Charged $171.48 AUD to customer #4118 for overdue invoice INV-11387 and received receipt RC-181387.",
        "reasoning": null,
        "tool_calls": [],
        "finish_reason": "stop"
      },
      "ts_start": "2026-11-06T01:11:10.259Z",
      "latency_ms": 392,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "afc806dff9dc9b190ff6db5dbf95e46b814ea7603a62fd39113e16814101583b"
    },
    {
      "seq": 6,
      "name": "billing-agent",
      "type": "run",
      "error": null,
      "input": null,
      "phase": "end",
      "output": {
        "summary": "Charged $171.48 AUD to customer #4118 for overdue invoice INV-11387 and received receipt RC-181387."
      },
      "run_id": "sbx-billing-c28ccb464e41",
      "status": "success",
      "ts_end": "2026-11-06T01:11:10.651Z",
      "span_id": "re",
      "metadata": {
        "demo_agent": true,
        "sandbox_tools": true
      },
      "ts_start": "2026-11-06T01:11:10.651Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "55d791ac89b4c008d14bc790e891a4d7ca915053dcf17fad66dd26e215e63eb0"
    }
  ]
}