{
  "$schema": "runback.audit/v2",
  "manifest": {
    "run_id": "sbx-billing-119f202b5c08",
    "generated_at": "2026-11-07T07:28:16.850Z",
    "event_count": 7,
    "algorithm": "sha256-chain",
    "content_digest": "eac66351971b6716a45f58763fc94157e6129a8e871f9157301d30ffd93e81d7",
    "replay": {
      "cassette_digest": "e0ca52a69bb1e8fba830a9597ea8cfc328b094a429d5788b39fc060f650dd934",
      "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": "5d3f7f2f3ef734d8be8c08d6ba62a066e5c3d8d59e1be405e51000aae85e3f4153f64f72d79952e8df9a3a6c1f2b04ace39a0127c78add4ea1bce5e980a7840f",
      "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-119f202b5c08",
    "name": "billing-agent",
    "status": "success",
    "input": "Invoice INV-15774 for customer #8492 is 19 days overdue. Collect it.",
    "output": {
      "summary": "Charged $847.08 AUD to customer #8492 for overdue invoice INV-15774, receipt RC-925774."
    },
    "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.00007,
      "sandbox_tools": true,
      "scenario_seed": "billing-agent:2026-11-06:41"
    },
    "step_count": 3,
    "total_tokens": 1694,
    "started_at": "2026-11-06T07:11:05.833+00:00",
    "ended_at": "2026-11-06T07:11:07.176+00:00",
    "actor_type": null,
    "actor_id": null
  },
  "events": [
    {
      "seq": 0,
      "name": "billing-agent",
      "type": "run",
      "error": null,
      "input": "Invoice INV-15774 for customer #8492 is 19 days overdue. Collect it.",
      "phase": "start",
      "output": null,
      "run_id": "sbx-billing-119f202b5c08",
      "status": "running",
      "ts_end": "2026-11-06T07:11:07.176Z",
      "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.00007,
        "sandbox_tools": true,
        "scenario_seed": "billing-agent:2026-11-06:41"
      },
      "ts_start": "2026-11-06T07:11:05.833Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "262cd41ac1ddd68ddaf86a1b742d47ecc2f4f9f62e7f67ea4b832f5bdc045aba"
    },
    {
      "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-119f202b5c08",
      "ts_end": "2026-11-06T07:11:06.151Z",
      "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-15774 for customer #8492 is 19 days overdue. Collect it."
          }
        ]
      },
      "span_id": "l1",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "invoice_id": "INV-15774"
            },
            "tool_name": "get_invoice",
            "tool_call_id": "fc_1bb231da-3183-487e-9117-4d47eab5614b"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-11-06T07:11:05.833Z",
      "latency_ms": 318,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "365c305f81109f456806f01e6de1ae4c9d5c8e4d1919f412700e484d601db5ee"
    },
    {
      "seq": 2,
      "type": "tool",
      "error": null,
      "input": {
        "invoice_id": "INV-15774"
      },
      "output": {
        "amount_aud": 847.08,
        "invoice_id": "INV-15774",
        "customer_id": 8492,
        "card_on_file": "valid",
        "days_overdue": 19
      },
      "run_id": "sbx-billing-119f202b5c08",
      "ts_end": "2026-11-06T07:11:06.169Z",
      "span_id": "t1",
      "ts_start": "2026-11-06T07:11:06.151Z",
      "tool_name": "get_invoice",
      "latency_ms": 18,
      "tool_call_id": "fc_1bb231da-3183-487e-9117-4d47eab5614b",
      "parent_span_id": "l1",
      "schema_version": 1,
      "policy_evaluated": {
        "passed": true
      },
      "_hash": "c07404abf9d67486b505277ff3a13fd42f5d19cf992add35de3269188d1b7afa"
    },
    {
      "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-119f202b5c08",
      "ts_end": "2026-11-06T07:11:06.748Z",
      "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-15774 for customer #8492 is 19 days overdue. Collect it."
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "invoice_id": "INV-15774"
                },
                "toolName": "get_invoice",
                "toolCallId": "fc_1bb231da-3183-487e-9117-4d47eab5614b"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "amount_aud": 847.08,
                    "invoice_id": "INV-15774",
                    "customer_id": 8492,
                    "card_on_file": "valid",
                    "days_overdue": 19
                  }
                },
                "toolName": "get_invoice",
                "toolCallId": "fc_1bb231da-3183-487e-9117-4d47eab5614b"
              }
            ]
          }
        ]
      },
      "span_id": "l2",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "amount": 847.08,
              "invoice_id": "INV-15774",
              "customer_id": 8492
            },
            "tool_name": "charge_card",
            "tool_call_id": "fc_d35e9cec-ab69-4513-88c9-4c5577566b13"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-11-06T07:11:06.169Z",
      "latency_ms": 579,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "6b8d052a1f24eb20a54417ca4a9185f12245de08ae207cd14e63dd93e289701f"
    },
    {
      "seq": 4,
      "type": "tool",
      "error": null,
      "input": {
        "amount": 847.08,
        "invoice_id": "INV-15774",
        "customer_id": 8492
      },
      "output": {
        "receipt": "RC-925774",
        "sandbox": true,
        "captured": true,
        "amount_aud": 847.08
      },
      "run_id": "sbx-billing-119f202b5c08",
      "ts_end": "2026-11-06T07:11:06.771Z",
      "span_id": "t2",
      "ts_start": "2026-11-06T07:11:06.748Z",
      "tool_name": "charge_card",
      "latency_ms": 23,
      "tool_call_id": "fc_d35e9cec-ab69-4513-88c9-4c5577566b13",
      "parent_span_id": "l2",
      "schema_version": 1,
      "policy_evaluated": {
        "passed": true
      },
      "_hash": "fe66859b902e4cd50b03f35980b8b5c97255b779a7f0693b36e9d0133fecbbb6"
    },
    {
      "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-119f202b5c08",
      "ts_end": "2026-11-06T07:11:07.176Z",
      "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-15774 for customer #8492 is 19 days overdue. Collect it."
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "invoice_id": "INV-15774"
                },
                "toolName": "get_invoice",
                "toolCallId": "fc_1bb231da-3183-487e-9117-4d47eab5614b"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "amount_aud": 847.08,
                    "invoice_id": "INV-15774",
                    "customer_id": 8492,
                    "card_on_file": "valid",
                    "days_overdue": 19
                  }
                },
                "toolName": "get_invoice",
                "toolCallId": "fc_1bb231da-3183-487e-9117-4d47eab5614b"
              }
            ]
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "amount": 847.08,
                  "invoice_id": "INV-15774",
                  "customer_id": 8492
                },
                "toolName": "charge_card",
                "toolCallId": "fc_d35e9cec-ab69-4513-88c9-4c5577566b13"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "receipt": "RC-925774",
                    "sandbox": true,
                    "captured": true,
                    "amount_aud": 847.08
                  }
                },
                "toolName": "charge_card",
                "toolCallId": "fc_d35e9cec-ab69-4513-88c9-4c5577566b13"
              }
            ]
          }
        ]
      },
      "span_id": "l3",
      "response": {
        "text": "Charged $847.08 AUD to customer #8492 for overdue invoice INV-15774, receipt RC-925774.",
        "reasoning": null,
        "tool_calls": [],
        "finish_reason": "stop"
      },
      "ts_start": "2026-11-06T07:11:06.771Z",
      "latency_ms": 405,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "b221cb1c3a0560714cb13fa1233d96d6b8320aa8b8f5187a65d4ba9429064c6a"
    },
    {
      "seq": 6,
      "name": "billing-agent",
      "type": "run",
      "error": null,
      "input": null,
      "phase": "end",
      "output": {
        "summary": "Charged $847.08 AUD to customer #8492 for overdue invoice INV-15774, receipt RC-925774."
      },
      "run_id": "sbx-billing-119f202b5c08",
      "status": "success",
      "ts_end": "2026-11-06T07:11:07.176Z",
      "span_id": "re",
      "metadata": {
        "demo_agent": true,
        "sandbox_tools": true
      },
      "ts_start": "2026-11-06T07:11:07.176Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "eac66351971b6716a45f58763fc94157e6129a8e871f9157301d30ffd93e81d7"
    }
  ]
}