{
  "$schema": "runback.audit/v2",
  "manifest": {
    "run_id": "sbx-billing-a2ebf53326ea",
    "generated_at": "2026-11-07T07:35:50.844Z",
    "event_count": 6,
    "algorithm": "sha256-chain",
    "content_digest": "2bf9c3d3274a7abb5408bb2c5cd1c9ced67d329e464418f3261326fc0ae8afc2",
    "replay": {
      "cassette_digest": "d4c70992f40c977c5b662a4503cb91799cff0c17a1acb88896ebf2104f518a8a",
      "entry_count": 4,
      "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": "7db8c2d598c64b35534cbc1fe5cf5eb5b32c0301c65cb407e820a86d1396963cad7dc961e8adcde24f94d68f77ab93c8c5e139f556b35001e651767199f5240a",
      "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-a2ebf53326ea",
    "name": "billing-agent",
    "status": "error",
    "input": "Invoice INV-61626 for customer #5821 is 14 days overdue. Collect it.",
    "output": {
      "awaiting_approval": "b9d5ac59-a4af-4743-8038-a8f6511faf65"
    },
    "error": {
      "name": "ApprovalRequired",
      "message": "charge_card is waiting for a person to approve it; the sandbox agent stopped here."
    },
    "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.000038,
      "sandbox_tools": true,
      "scenario_seed": "billing-agent:2026-10-30:25"
    },
    "step_count": 2,
    "total_tokens": 1079,
    "started_at": "2026-10-30T04:11:05.477+00:00",
    "ended_at": "2026-10-30T04:11:06.414+00:00",
    "actor_type": null,
    "actor_id": null
  },
  "events": [
    {
      "seq": 0,
      "name": "billing-agent",
      "type": "run",
      "error": null,
      "input": "Invoice INV-61626 for customer #5821 is 14 days overdue. Collect it.",
      "phase": "start",
      "output": null,
      "run_id": "sbx-billing-a2ebf53326ea",
      "status": "running",
      "ts_end": "2026-10-30T04:11:06.414Z",
      "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.000038,
        "sandbox_tools": true,
        "scenario_seed": "billing-agent:2026-10-30:25"
      },
      "ts_start": "2026-10-30T04:11:05.477Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "ec10335222f306019f7d1bca51af4011b2b2bc640ac2d3b49d06afdde8ea72cd"
    },
    {
      "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-a2ebf53326ea",
      "ts_end": "2026-10-30T04:11:05.877Z",
      "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-61626 for customer #5821 is 14 days overdue. Collect it."
          }
        ]
      },
      "span_id": "l1",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "invoice_id": "INV-61626"
            },
            "tool_name": "get_invoice",
            "tool_call_id": "fc_b7ee7b18-c9bb-42c1-b892-c4dfc9046228"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-10-30T04:11:05.477Z",
      "latency_ms": 400,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "cbefc0ab42cacf9cdd5f7fc9d2a00f4b680fc1fa1206be7df0485a39f25cce11"
    },
    {
      "seq": 2,
      "type": "tool",
      "error": null,
      "input": {
        "invoice_id": "INV-61626"
      },
      "output": {
        "amount_aud": 2055.85,
        "invoice_id": "INV-61626",
        "customer_id": 5821,
        "card_on_file": "valid",
        "days_overdue": 14
      },
      "run_id": "sbx-billing-a2ebf53326ea",
      "ts_end": "2026-10-30T04:11:05.909Z",
      "span_id": "t1",
      "ts_start": "2026-10-30T04:11:05.877Z",
      "tool_name": "get_invoice",
      "latency_ms": 32,
      "tool_call_id": "fc_b7ee7b18-c9bb-42c1-b892-c4dfc9046228",
      "parent_span_id": "l1",
      "schema_version": 1,
      "policy_evaluated": {
        "passed": true
      },
      "_hash": "cf05809519e2321204dff10d37848be3d121d218bba71d4598b2836f1019195a"
    },
    {
      "seq": 3,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "openai/gpt-oss-20b",
        "provider": "groq"
      },
      "usage": {
        "input_tokens": 501,
        "total_tokens": 578,
        "output_tokens": 77
      },
      "run_id": "sbx-billing-a2ebf53326ea",
      "ts_end": "2026-10-30T04:11:06.295Z",
      "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-61626 for customer #5821 is 14 days overdue. Collect it."
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "invoice_id": "INV-61626"
                },
                "toolName": "get_invoice",
                "toolCallId": "fc_b7ee7b18-c9bb-42c1-b892-c4dfc9046228"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "amount_aud": 2055.85,
                    "invoice_id": "INV-61626",
                    "customer_id": 5821,
                    "card_on_file": "valid",
                    "days_overdue": 14
                  }
                },
                "toolName": "get_invoice",
                "toolCallId": "fc_b7ee7b18-c9bb-42c1-b892-c4dfc9046228"
              }
            ]
          }
        ]
      },
      "span_id": "l2",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "amount": 2055.85,
              "invoice_id": "INV-61626",
              "customer_id": 5821
            },
            "tool_name": "charge_card",
            "tool_call_id": "fc_a46db308-9a1b-4210-ab88-c971afb9acd6"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-10-30T04:11:05.909Z",
      "latency_ms": 386,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "f0cb0f77916bb22cb084d697673fb5795ed7dae0a4bb68d3f5865fb1be10ec3d"
    },
    {
      "seq": 4,
      "type": "tool",
      "error": {
        "name": "ApprovalRequired",
        "message": "must not (charge_card.amount gt 2000) — violated — held for approval b9d5ac59-a4af-4743-8038-a8f6511faf65"
      },
      "input": {
        "amount": 2055.85,
        "invoice_id": "INV-61626",
        "customer_id": 5821
      },
      "output": null,
      "run_id": "sbx-billing-a2ebf53326ea",
      "ts_end": "2026-10-30T04:11:06.414Z",
      "span_id": "t2",
      "metadata": {
        "approval_id": "b9d5ac59-a4af-4743-8038-a8f6511faf65"
      },
      "ts_start": "2026-10-30T04:11:06.295Z",
      "tool_name": "charge_card",
      "latency_ms": 119,
      "policy_block": {
        "rule": "charge-over-a2000-needs-approval",
        "detail": "must not (charge_card.amount gt 2000) — violated — held for approval b9d5ac59-a4af-4743-8038-a8f6511faf65"
      },
      "tool_call_id": "fc_a46db308-9a1b-4210-ab88-c971afb9acd6",
      "parent_span_id": "l2",
      "schema_version": 1,
      "policy_evaluated": {
        "passed": false
      },
      "_hash": "f9902e8f8fa813eba67ea8bcb8f6ca1f925085f2e7260e627575ed4d195415d1"
    },
    {
      "seq": 5,
      "name": "billing-agent",
      "type": "run",
      "error": {
        "name": "ApprovalRequired",
        "message": "charge_card is waiting for a person to approve it; the sandbox agent stopped here."
      },
      "input": null,
      "phase": "end",
      "output": {
        "awaiting_approval": "b9d5ac59-a4af-4743-8038-a8f6511faf65"
      },
      "run_id": "sbx-billing-a2ebf53326ea",
      "status": "error",
      "ts_end": "2026-10-30T04:11:06.414Z",
      "span_id": "re",
      "metadata": {
        "demo_agent": true,
        "sandbox_tools": true
      },
      "ts_start": "2026-10-30T04:11:06.414Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "2bf9c3d3274a7abb5408bb2c5cd1c9ced67d329e464418f3261326fc0ae8afc2"
    }
  ]
}