{
  "$schema": "runback.audit/v2",
  "manifest": {
    "run_id": "sbx-billing-3680e4b9baee",
    "generated_at": "2026-11-07T07:35:56.791Z",
    "event_count": 6,
    "algorithm": "sha256-chain",
    "content_digest": "453de3d8c7847d52a392ff12e3dd07657a2a0a2961fbe09de339bcad64c1a5d0",
    "replay": {
      "cassette_digest": "fc5ae2cdaccdeacf1dea435ef7dcbe6a19267c07c9de83481972295d18b50ad0",
      "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": "3a526def74b903f88468715dceab83bd472b29f1cb2926d8e0ca351ddc7eecd35052465e6079eef02f0bedd14fc3688689e780e2c286061976a2d953b8413801",
      "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-3680e4b9baee",
    "name": "billing-agent",
    "status": "error",
    "input": "Invoice INV-81151 for customer #5689 is 3 days overdue. Collect it.",
    "output": {
      "awaiting_approval": "3e75a4a8-0d63-4e4f-82dd-c3f7bdb97c19"
    },
    "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-11-02:17"
    },
    "step_count": 2,
    "total_tokens": 1079,
    "started_at": "2026-11-02T03:10:58.927+00:00",
    "ended_at": "2026-11-02T03:10:59.969+00:00",
    "actor_type": null,
    "actor_id": null
  },
  "events": [
    {
      "seq": 0,
      "name": "billing-agent",
      "type": "run",
      "error": null,
      "input": "Invoice INV-81151 for customer #5689 is 3 days overdue. Collect it.",
      "phase": "start",
      "output": null,
      "run_id": "sbx-billing-3680e4b9baee",
      "status": "running",
      "ts_end": "2026-11-02T03:10:59.969Z",
      "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-11-02:17"
      },
      "ts_start": "2026-11-02T03:10:58.927Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "ad41c97e89fc87345ebfd72736719f8c790cc9fb721c6072fb04e8c8ade3ca23"
    },
    {
      "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-3680e4b9baee",
      "ts_end": "2026-11-02T03:10:59.327Z",
      "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-81151 for customer #5689 is 3 days overdue. Collect it."
          }
        ]
      },
      "span_id": "l1",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "invoice_id": "INV-81151"
            },
            "tool_name": "get_invoice",
            "tool_call_id": "fc_d894056e-8d99-49eb-80ce-205c4c207d66"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-11-02T03:10:58.927Z",
      "latency_ms": 400,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "9e78d2b2948dda00dd196f64c7ecf21800943894ab2c26a46e4cf57a661316ca"
    },
    {
      "seq": 2,
      "type": "tool",
      "error": null,
      "input": {
        "invoice_id": "INV-81151"
      },
      "output": {
        "amount_aud": 3849.83,
        "invoice_id": "INV-81151",
        "customer_id": 5689,
        "card_on_file": "valid",
        "days_overdue": 3
      },
      "run_id": "sbx-billing-3680e4b9baee",
      "ts_end": "2026-11-02T03:10:59.377Z",
      "span_id": "t1",
      "ts_start": "2026-11-02T03:10:59.327Z",
      "tool_name": "get_invoice",
      "latency_ms": 50,
      "tool_call_id": "fc_d894056e-8d99-49eb-80ce-205c4c207d66",
      "parent_span_id": "l1",
      "schema_version": 1,
      "policy_evaluated": {
        "passed": true
      },
      "_hash": "3db0fd5a4380d1840468909a05c19c88721d1a12a974c35c1b53b27254ab352a"
    },
    {
      "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-3680e4b9baee",
      "ts_end": "2026-11-02T03:10:59.833Z",
      "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-81151 for customer #5689 is 3 days overdue. Collect it."
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "invoice_id": "INV-81151"
                },
                "toolName": "get_invoice",
                "toolCallId": "fc_d894056e-8d99-49eb-80ce-205c4c207d66"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "amount_aud": 3849.83,
                    "invoice_id": "INV-81151",
                    "customer_id": 5689,
                    "card_on_file": "valid",
                    "days_overdue": 3
                  }
                },
                "toolName": "get_invoice",
                "toolCallId": "fc_d894056e-8d99-49eb-80ce-205c4c207d66"
              }
            ]
          }
        ]
      },
      "span_id": "l2",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "amount": 3849.83,
              "invoice_id": "INV-81151",
              "customer_id": 5689
            },
            "tool_name": "charge_card",
            "tool_call_id": "fc_4bfff554-09a5-4386-89c1-ab350b612e70"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-11-02T03:10:59.377Z",
      "latency_ms": 456,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "d7ef9206f108c86dee32c44d757e6745bef87d8d8c2ba807b4b793f8060812dc"
    },
    {
      "seq": 4,
      "type": "tool",
      "error": {
        "name": "ApprovalRequired",
        "message": "must not (charge_card.amount gt 2000) — violated — held for approval 3e75a4a8-0d63-4e4f-82dd-c3f7bdb97c19"
      },
      "input": {
        "amount": 3849.83,
        "invoice_id": "INV-81151",
        "customer_id": 5689
      },
      "output": null,
      "run_id": "sbx-billing-3680e4b9baee",
      "ts_end": "2026-11-02T03:10:59.968Z",
      "span_id": "t2",
      "metadata": {
        "approval_id": "3e75a4a8-0d63-4e4f-82dd-c3f7bdb97c19"
      },
      "ts_start": "2026-11-02T03:10:59.833Z",
      "tool_name": "charge_card",
      "latency_ms": 135,
      "policy_block": {
        "rule": "charge-over-a2000-needs-approval",
        "detail": "must not (charge_card.amount gt 2000) — violated — held for approval 3e75a4a8-0d63-4e4f-82dd-c3f7bdb97c19"
      },
      "tool_call_id": "fc_4bfff554-09a5-4386-89c1-ab350b612e70",
      "parent_span_id": "l2",
      "schema_version": 1,
      "policy_evaluated": {
        "passed": false
      },
      "_hash": "ca6b9fed478a8078d493eab99c21e7a6ccc9092c1a4a2eb4715dbc4aa5f81905"
    },
    {
      "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": "3e75a4a8-0d63-4e4f-82dd-c3f7bdb97c19"
      },
      "run_id": "sbx-billing-3680e4b9baee",
      "status": "error",
      "ts_end": "2026-11-02T03:10:59.969Z",
      "span_id": "re",
      "metadata": {
        "demo_agent": true,
        "sandbox_tools": true
      },
      "ts_start": "2026-11-02T03:10:59.969Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "453de3d8c7847d52a392ff12e3dd07657a2a0a2961fbe09de339bcad64c1a5d0"
    }
  ]
}