{
  "$schema": "runback.audit/v2",
  "manifest": {
    "run_id": "sbx-billing-c46e73a5368a",
    "generated_at": "2026-11-07T07:36:01.716Z",
    "event_count": 7,
    "algorithm": "sha256-chain",
    "content_digest": "8760c24f3e44c81cf61d5445965f3552cea6aafbe13e8e8006e5789c3f1f7f05",
    "replay": {
      "cassette_digest": "5e7fbc6225a604a534f14a4bc056c5ce7cbf587c65d7511667b3edee3e817afd",
      "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": "298c26fb414d0d8c601977392cbbd4ff1455a4fdd3f8711f0aab80c1ffa39ebe6cbce02e614889825a59da23074cab69ff09c0e4b95dcdd8add43ba94c5aff0d",
      "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-c46e73a5368a",
    "name": "billing-agent",
    "status": "success",
    "input": "Invoice INV-39603 for customer #1977 is 12 days overdue. Collect it.",
    "output": {
      "summary": "I successfully charged the overdue invoice INV-39603 for customer #1977, capturing an amount of AUD 539.94."
    },
    "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": "gpt-4o-mini",
      "demo_agent": true,
      "est_cost_usd": 0.000188,
      "sandbox_tools": true,
      "scenario_seed": "billing-agent:2026-10-24:9"
    },
    "step_count": 3,
    "total_tokens": 1019,
    "started_at": "2026-10-24T14:11:08.474+00:00",
    "ended_at": "2026-10-24T14:11:12.568+00:00",
    "actor_type": null,
    "actor_id": null
  },
  "events": [
    {
      "seq": 0,
      "name": "billing-agent",
      "type": "run",
      "error": null,
      "input": "Invoice INV-39603 for customer #1977 is 12 days overdue. Collect it.",
      "phase": "start",
      "output": null,
      "run_id": "sbx-billing-c46e73a5368a",
      "status": "running",
      "ts_end": "2026-10-24T14:11:12.568Z",
      "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": "gpt-4o-mini",
        "demo_agent": true,
        "est_cost_usd": 0.000188,
        "sandbox_tools": true,
        "scenario_seed": "billing-agent:2026-10-24:9"
      },
      "ts_start": "2026-10-24T14:11:08.474Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "5e187cd0fcdda0af8c4fe793c2ba974b3e901fc8f7dc0977a1a48e8376546e6c"
    },
    {
      "seq": 1,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "gpt-4o-mini",
        "provider": "openai"
      },
      "usage": {
        "input_tokens": 253,
        "total_tokens": 272,
        "output_tokens": 19
      },
      "run_id": "sbx-billing-c46e73a5368a",
      "ts_end": "2026-10-24T14:11:09.388Z",
      "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."
          }
        ],
        "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 send a payment reminder when it is not. 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-39603 for customer #1977 is 12 days overdue. Collect it."
          }
        ]
      },
      "span_id": "l1",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "invoice_id": "INV-39603"
            },
            "tool_name": "get_invoice",
            "tool_call_id": "call_ALekDovMebuPRdRwZwRqcOxs"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-10-24T14:11:08.474Z",
      "latency_ms": 914,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "e8f6a13a4e5d38ae243acb5b4413a766bd0dc34cb9c895680f14629a3674f4fc"
    },
    {
      "seq": 2,
      "type": "tool",
      "error": null,
      "input": {
        "invoice_id": "INV-39603"
      },
      "output": {
        "amount_aud": 539.94,
        "invoice_id": "INV-39603",
        "customer_id": 1977,
        "card_on_file": "valid",
        "days_overdue": 12
      },
      "run_id": "sbx-billing-c46e73a5368a",
      "ts_end": "2026-10-24T14:11:09.405Z",
      "span_id": "t1",
      "ts_start": "2026-10-24T14:11:09.388Z",
      "tool_name": "get_invoice",
      "latency_ms": 17,
      "tool_call_id": "call_ALekDovMebuPRdRwZwRqcOxs",
      "parent_span_id": "l1",
      "schema_version": 1,
      "policy_evaluated": {
        "passed": true
      },
      "_hash": "f80c99c3b68712cc4d6657bc34016cecb4e5fb55346fe9f74ed865a26cfa29a4"
    },
    {
      "seq": 3,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "gpt-4o-mini",
        "provider": "openai"
      },
      "usage": {
        "input_tokens": 312,
        "total_tokens": 344,
        "output_tokens": 32
      },
      "run_id": "sbx-billing-c46e73a5368a",
      "ts_end": "2026-10-24T14:11:10.992Z",
      "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."
          }
        ],
        "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 send a payment reminder when it is not. 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-39603 for customer #1977 is 12 days overdue. Collect it."
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "invoice_id": "INV-39603"
                },
                "toolName": "get_invoice",
                "toolCallId": "call_ALekDovMebuPRdRwZwRqcOxs"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "amount_aud": 539.94,
                    "invoice_id": "INV-39603",
                    "customer_id": 1977,
                    "card_on_file": "valid",
                    "days_overdue": 12
                  }
                },
                "toolName": "get_invoice",
                "toolCallId": "call_ALekDovMebuPRdRwZwRqcOxs"
              }
            ]
          }
        ]
      },
      "span_id": "l2",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "amount": 539.94,
              "invoice_id": "INV-39603",
              "customer_id": 1977
            },
            "tool_name": "charge_card",
            "tool_call_id": "call_fcVfKJYlndqCVjYXhNWKLSXq"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-10-24T14:11:09.405Z",
      "latency_ms": 1587,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "4526ce480f51b16f95e08c9fab2acf946b252c2ad75854641f8738ddfddff458"
    },
    {
      "seq": 4,
      "type": "tool",
      "error": null,
      "input": {
        "amount": 539.94,
        "invoice_id": "INV-39603",
        "customer_id": 1977
      },
      "output": {
        "receipt": "RC-779603",
        "sandbox": true,
        "captured": true,
        "amount_aud": 539.94
      },
      "run_id": "sbx-billing-c46e73a5368a",
      "ts_end": "2026-10-24T14:11:11.078Z",
      "span_id": "t2",
      "ts_start": "2026-10-24T14:11:10.992Z",
      "tool_name": "charge_card",
      "latency_ms": 86,
      "tool_call_id": "call_fcVfKJYlndqCVjYXhNWKLSXq",
      "parent_span_id": "l2",
      "schema_version": 1,
      "policy_evaluated": {
        "passed": true
      },
      "_hash": "44718f753ed8b857f401d0732fd45fe35b43b4adf0180413b8e23531a68ad8d1"
    },
    {
      "seq": 5,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "gpt-4o-mini",
        "provider": "openai"
      },
      "usage": {
        "input_tokens": 375,
        "total_tokens": 403,
        "output_tokens": 28
      },
      "run_id": "sbx-billing-c46e73a5368a",
      "ts_end": "2026-10-24T14:11:12.568Z",
      "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."
          }
        ],
        "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 send a payment reminder when it is not. 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-39603 for customer #1977 is 12 days overdue. Collect it."
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "invoice_id": "INV-39603"
                },
                "toolName": "get_invoice",
                "toolCallId": "call_ALekDovMebuPRdRwZwRqcOxs"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "amount_aud": 539.94,
                    "invoice_id": "INV-39603",
                    "customer_id": 1977,
                    "card_on_file": "valid",
                    "days_overdue": 12
                  }
                },
                "toolName": "get_invoice",
                "toolCallId": "call_ALekDovMebuPRdRwZwRqcOxs"
              }
            ]
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "amount": 539.94,
                  "invoice_id": "INV-39603",
                  "customer_id": 1977
                },
                "toolName": "charge_card",
                "toolCallId": "call_fcVfKJYlndqCVjYXhNWKLSXq"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "receipt": "RC-779603",
                    "sandbox": true,
                    "captured": true,
                    "amount_aud": 539.94
                  }
                },
                "toolName": "charge_card",
                "toolCallId": "call_fcVfKJYlndqCVjYXhNWKLSXq"
              }
            ]
          }
        ]
      },
      "span_id": "l3",
      "response": {
        "text": "I successfully charged the overdue invoice INV-39603 for customer #1977, capturing an amount of AUD 539.94.",
        "reasoning": null,
        "tool_calls": [],
        "finish_reason": "stop"
      },
      "ts_start": "2026-10-24T14:11:11.078Z",
      "latency_ms": 1490,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "7180118f435dfb5fe215dedbba24de94fd2d86f8e99c40eb3c25a4c607c88b9d"
    },
    {
      "seq": 6,
      "name": "billing-agent",
      "type": "run",
      "error": null,
      "input": null,
      "phase": "end",
      "output": {
        "summary": "I successfully charged the overdue invoice INV-39603 for customer #1977, capturing an amount of AUD 539.94."
      },
      "run_id": "sbx-billing-c46e73a5368a",
      "status": "success",
      "ts_end": "2026-10-24T14:11:12.568Z",
      "span_id": "re",
      "metadata": {
        "demo_agent": true,
        "sandbox_tools": true
      },
      "ts_start": "2026-10-24T14:11:12.568Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "8760c24f3e44c81cf61d5445965f3552cea6aafbe13e8e8006e5789c3f1f7f05"
    }
  ]
}