{
  "$schema": "runback.audit/v2",
  "manifest": {
    "run_id": "sbx-billing-4bfe24cee74b",
    "generated_at": "2026-11-07T07:36:08.856Z",
    "event_count": 7,
    "algorithm": "sha256-chain",
    "content_digest": "2a288aa1986df4afba7e07de4dbfed107b383ab7a81d0c7299c7a55c57314c2d",
    "replay": {
      "cassette_digest": "333078cde9ed3fed3d1b5577690c15186ea1ff7519bc6625c3e10d133c7622d5",
      "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": "cadd1fa9e82c6b81c85536ed1254ba7ceeef55158229f4f0470198a9fcf6f1d33f4479cba87d341267aa5db3282d50d2d188459cdb7eccd495093e474e53e40a",
      "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-4bfe24cee74b",
    "name": "billing-agent",
    "status": "success",
    "input": "Invoice INV-39616 for customer #2856 is 42 days overdue. Collect it.",
    "output": {
      "summary": "Charged $245.09 AUD to customer #2856 for overdue invoice INV-39616, receipt RC-569616."
    },
    "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-10-26:1"
    },
    "step_count": 3,
    "total_tokens": 1694,
    "started_at": "2026-10-26T00:10:55.191+00:00",
    "ended_at": "2026-10-26T00:10:56.526+00:00",
    "actor_type": null,
    "actor_id": null
  },
  "events": [
    {
      "seq": 0,
      "name": "billing-agent",
      "type": "run",
      "error": null,
      "input": "Invoice INV-39616 for customer #2856 is 42 days overdue. Collect it.",
      "phase": "start",
      "output": null,
      "run_id": "sbx-billing-4bfe24cee74b",
      "status": "running",
      "ts_end": "2026-10-26T00:10:56.526Z",
      "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-10-26:1"
      },
      "ts_start": "2026-10-26T00:10:55.191Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "c8db0208102f4e0fe69422c7f3b29462d3933795b119217941e154118e50e49b"
    },
    {
      "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-4bfe24cee74b",
      "ts_end": "2026-10-26T00:10:55.724Z",
      "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-39616 for customer #2856 is 42 days overdue. Collect it."
          }
        ]
      },
      "span_id": "l1",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "invoice_id": "INV-39616"
            },
            "tool_name": "get_invoice",
            "tool_call_id": "fc_dbf05db0-50ae-4cee-8a07-19508fe7396d"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-10-26T00:10:55.191Z",
      "latency_ms": 533,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "2c68720c958dbac24368e10d87da0a2662240f04c3925f04b52c2d6d4bb8539d"
    },
    {
      "seq": 2,
      "type": "tool",
      "error": null,
      "input": {
        "invoice_id": "INV-39616"
      },
      "output": {
        "amount_aud": 245.09,
        "invoice_id": "INV-39616",
        "customer_id": 2856,
        "card_on_file": "valid",
        "days_overdue": 42
      },
      "run_id": "sbx-billing-4bfe24cee74b",
      "ts_end": "2026-10-26T00:10:55.752Z",
      "span_id": "t1",
      "ts_start": "2026-10-26T00:10:55.724Z",
      "tool_name": "get_invoice",
      "latency_ms": 28,
      "tool_call_id": "fc_dbf05db0-50ae-4cee-8a07-19508fe7396d",
      "parent_span_id": "l1",
      "schema_version": 1,
      "policy_evaluated": {
        "passed": true
      },
      "_hash": "a9658ad728f084d2f7ddb32d1e7f5ea53131e2a1b800d091886ee2018380e860"
    },
    {
      "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-4bfe24cee74b",
      "ts_end": "2026-10-26T00:10:56.140Z",
      "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-39616 for customer #2856 is 42 days overdue. Collect it."
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "invoice_id": "INV-39616"
                },
                "toolName": "get_invoice",
                "toolCallId": "fc_dbf05db0-50ae-4cee-8a07-19508fe7396d"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "amount_aud": 245.09,
                    "invoice_id": "INV-39616",
                    "customer_id": 2856,
                    "card_on_file": "valid",
                    "days_overdue": 42
                  }
                },
                "toolName": "get_invoice",
                "toolCallId": "fc_dbf05db0-50ae-4cee-8a07-19508fe7396d"
              }
            ]
          }
        ]
      },
      "span_id": "l2",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "amount": 245.09,
              "invoice_id": "INV-39616",
              "customer_id": 2856
            },
            "tool_name": "charge_card",
            "tool_call_id": "fc_d284ce5c-a5cc-4fcd-afe1-04beb2896517"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-10-26T00:10:55.752Z",
      "latency_ms": 388,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "123b1cb5c12b98afd8576b7fa1884e1c097bd33a8a30252346c2c77611f15462"
    },
    {
      "seq": 4,
      "type": "tool",
      "error": null,
      "input": {
        "amount": 245.09,
        "invoice_id": "INV-39616",
        "customer_id": 2856
      },
      "output": {
        "receipt": "RC-569616",
        "sandbox": true,
        "captured": true,
        "amount_aud": 245.09
      },
      "run_id": "sbx-billing-4bfe24cee74b",
      "ts_end": "2026-10-26T00:10:56.161Z",
      "span_id": "t2",
      "ts_start": "2026-10-26T00:10:56.140Z",
      "tool_name": "charge_card",
      "latency_ms": 21,
      "tool_call_id": "fc_d284ce5c-a5cc-4fcd-afe1-04beb2896517",
      "parent_span_id": "l2",
      "schema_version": 1,
      "policy_evaluated": {
        "passed": true
      },
      "_hash": "2a43c525b0dbebb406610522db4989af5c35e941662339eb857a3fd5aeee596b"
    },
    {
      "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-4bfe24cee74b",
      "ts_end": "2026-10-26T00:10:56.526Z",
      "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-39616 for customer #2856 is 42 days overdue. Collect it."
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "invoice_id": "INV-39616"
                },
                "toolName": "get_invoice",
                "toolCallId": "fc_dbf05db0-50ae-4cee-8a07-19508fe7396d"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "amount_aud": 245.09,
                    "invoice_id": "INV-39616",
                    "customer_id": 2856,
                    "card_on_file": "valid",
                    "days_overdue": 42
                  }
                },
                "toolName": "get_invoice",
                "toolCallId": "fc_dbf05db0-50ae-4cee-8a07-19508fe7396d"
              }
            ]
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "amount": 245.09,
                  "invoice_id": "INV-39616",
                  "customer_id": 2856
                },
                "toolName": "charge_card",
                "toolCallId": "fc_d284ce5c-a5cc-4fcd-afe1-04beb2896517"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "receipt": "RC-569616",
                    "sandbox": true,
                    "captured": true,
                    "amount_aud": 245.09
                  }
                },
                "toolName": "charge_card",
                "toolCallId": "fc_d284ce5c-a5cc-4fcd-afe1-04beb2896517"
              }
            ]
          }
        ]
      },
      "span_id": "l3",
      "response": {
        "text": "Charged $245.09 AUD to customer #2856 for overdue invoice INV-39616, receipt RC-569616.",
        "reasoning": null,
        "tool_calls": [],
        "finish_reason": "stop"
      },
      "ts_start": "2026-10-26T00:10:56.161Z",
      "latency_ms": 364,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "ee7f10a4a0a86ef3b0972090ab63ad70f421176f8909941c24553c4422f53dc2"
    },
    {
      "seq": 6,
      "name": "billing-agent",
      "type": "run",
      "error": null,
      "input": null,
      "phase": "end",
      "output": {
        "summary": "Charged $245.09 AUD to customer #2856 for overdue invoice INV-39616, receipt RC-569616."
      },
      "run_id": "sbx-billing-4bfe24cee74b",
      "status": "success",
      "ts_end": "2026-10-26T00:10:56.526Z",
      "span_id": "re",
      "metadata": {
        "demo_agent": true,
        "sandbox_tools": true
      },
      "ts_start": "2026-10-26T00:10:56.526Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "2a288aa1986df4afba7e07de4dbfed107b383ab7a81d0c7299c7a55c57314c2d"
    }
  ]
}