{
  "$schema": "runback.audit/v2",
  "manifest": {
    "run_id": "sbx-support-refund-fd9790ae5c05",
    "generated_at": "2026-11-07T07:36:06.018Z",
    "event_count": 10,
    "algorithm": "sha256-chain",
    "content_digest": "e894f70caac65dcf509861027ba78af93184c5e732bb3c9441a194387359a70f",
    "replay": {
      "cassette_digest": "f7ae59334e6c5ff884fa7834b8dc4d9902ebabc868adfadda5d9da8b52a64a24",
      "entry_count": 8,
      "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": "9bd915cbd057ae343461806d8915f531e4840e5f68ba464e82a323ea7c6fa59415ff00e3bc3fce555430a993b0c7fb5cd0a1aecbfdbd607031fb4d339416fd02",
      "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-support-refund-fd9790ae5c05",
    "name": "support-refund-agent",
    "status": "success",
    "input": "Customer #5297 is asking for a refund of A$37.83 on order ORD-19397 because the subscription renewed unexpectedly.",
    "output": {
      "summary": "I processed a refund of A$37.83 for order ORD-19397 and notified the customer about it."
    },
    "error": null,
    "metadata": {
      "agent": {
        "description": "Decides refunds and escalates disputed charges. 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.000392,
      "sandbox_tools": true,
      "scenario_seed": "support-refund-agent:2026-11-04:56"
    },
    "step_count": 4,
    "total_tokens": 2168,
    "started_at": "2026-11-04T10:11:01.983+00:00",
    "ended_at": "2026-11-04T10:11:09.311+00:00",
    "actor_type": null,
    "actor_id": null
  },
  "events": [
    {
      "seq": 0,
      "name": "support-refund-agent",
      "type": "run",
      "error": null,
      "input": "Customer #5297 is asking for a refund of A$37.83 on order ORD-19397 because the subscription renewed unexpectedly.",
      "phase": "start",
      "output": null,
      "run_id": "sbx-support-refund-fd9790ae5c05",
      "status": "running",
      "ts_end": "2026-11-04T10:11:09.311Z",
      "span_id": "r",
      "metadata": {
        "agent": {
          "description": "Decides refunds and escalates disputed charges. 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.000392,
        "sandbox_tools": true,
        "scenario_seed": "support-refund-agent:2026-11-04:56"
      },
      "ts_start": "2026-11-04T10:11:01.983Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "58f4d1c2b661a87440bbc98561031440da5a5f7dc11965c0dfec31ce9ee941a9"
    },
    {
      "seq": 1,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "gpt-4o-mini",
        "provider": "openai"
      },
      "usage": {
        "input_tokens": 359,
        "total_tokens": 410,
        "output_tokens": 51
      },
      "run_id": "sbx-support-refund-fd9790ae5c05",
      "ts_end": "2026-11-04T10:11:03.283Z",
      "request": {
        "tools": [
          {
            "name": "lookup_customer",
            "parameters": {
              "type": "object",
              "required": [
                "customer_id"
              ],
              "properties": {
                "customer_id": {
                  "type": "number",
                  "description": "Customer id"
                }
              },
              "additionalProperties": false
            },
            "description": "Look up a customer by id."
          },
          {
            "name": "lookup_order",
            "parameters": {
              "type": "object",
              "required": [
                "order_id"
              ],
              "properties": {
                "order_id": {
                  "type": "string",
                  "description": "Order id, e.g. ORD-12345"
                }
              },
              "additionalProperties": false
            },
            "description": "Look up an order by id."
          },
          {
            "name": "issue_refund",
            "parameters": {
              "type": "object",
              "required": [
                "customer_id",
                "order_id",
                "amount"
              ],
              "properties": {
                "amount": {
                  "type": "number",
                  "description": "Amount in AUD"
                },
                "order_id": {
                  "type": "string",
                  "description": "Order id"
                },
                "customer_id": {
                  "type": "number",
                  "description": "Customer id"
                }
              },
              "additionalProperties": false
            },
            "description": "Refund an amount in AUD to the customer's original payment method."
          },
          {
            "name": "escalate_to_human",
            "parameters": {
              "type": "object",
              "required": [
                "customer_id",
                "reason"
              ],
              "properties": {
                "reason": {
                  "type": "string",
                  "description": "Why a person should decide"
                },
                "customer_id": {
                  "type": "number",
                  "description": "Customer id"
                }
              },
              "additionalProperties": false
            },
            "description": "Hand the case to a human support lead with a reason."
          },
          {
            "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 support refund 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. Resolve refund requests quickly and politely. Look the customer and order up before deciding. Gold-tier customers get the benefit of the doubt. A customer should hear about a refund once it is issued. Use the tools to act; when you are done, reply with a one-sentence summary of what you did.",
        "messages": [
          {
            "role": "user",
            "content": "Customer #5297 is asking for a refund of A$37.83 on order ORD-19397 because the subscription renewed unexpectedly."
          }
        ]
      },
      "span_id": "l1",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "customer_id": 5297
            },
            "tool_name": "lookup_customer",
            "tool_call_id": "call_rjmENJ65Esx01MQQcKPnefeo"
          },
          {
            "input": {
              "order_id": "ORD-19397"
            },
            "tool_name": "lookup_order",
            "tool_call_id": "call_0SWxfq0fRsNNj1Jh6UcG2IDj"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-11-04T10:11:01.983Z",
      "latency_ms": 1300,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "fd9d37283f08ed7c109b11134d24fc5b0567b4846b654f2d40163cd2a19819d8"
    },
    {
      "seq": 2,
      "type": "tool",
      "error": null,
      "input": {
        "customer_id": 5297
      },
      "output": {
        "id": 5297,
        "city": "Adelaide",
        "name": "Morgan Mockridge",
        "tier": "gold",
        "customer_since": "2018-02-01"
      },
      "run_id": "sbx-support-refund-fd9790ae5c05",
      "ts_end": "2026-11-04T10:11:03.387Z",
      "span_id": "t1",
      "ts_start": "2026-11-04T10:11:03.283Z",
      "tool_name": "lookup_customer",
      "latency_ms": 104,
      "tool_call_id": "call_rjmENJ65Esx01MQQcKPnefeo",
      "parent_span_id": "l1",
      "schema_version": 1,
      "policy_evaluated": {
        "passed": true
      },
      "_hash": "b83df07baa5c09b659f201aa6f9931890611686f96d7074f4a6fb565dccdbb7a"
    },
    {
      "seq": 3,
      "type": "tool",
      "error": null,
      "input": {
        "order_id": "ORD-19397"
      },
      "output": {
        "status": "delivered",
        "payment": "card",
        "disputed": false,
        "order_id": "ORD-19397",
        "total_aud": 37.83,
        "customer_id": 5297
      },
      "run_id": "sbx-support-refund-fd9790ae5c05",
      "ts_end": "2026-11-04T10:11:03.417Z",
      "span_id": "t2",
      "ts_start": "2026-11-04T10:11:03.387Z",
      "tool_name": "lookup_order",
      "latency_ms": 30,
      "tool_call_id": "call_0SWxfq0fRsNNj1Jh6UcG2IDj",
      "parent_span_id": "l1",
      "schema_version": 1,
      "policy_evaluated": {
        "passed": true
      },
      "_hash": "e964c9ccf9cd4498b8e9b72c3dd7333cd13c068f98e959ac58d682cda3989670"
    },
    {
      "seq": 4,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "gpt-4o-mini",
        "provider": "openai"
      },
      "usage": {
        "input_tokens": 473,
        "total_tokens": 505,
        "output_tokens": 32
      },
      "run_id": "sbx-support-refund-fd9790ae5c05",
      "ts_end": "2026-11-04T10:11:04.878Z",
      "request": {
        "tools": [
          {
            "name": "lookup_customer",
            "parameters": {
              "type": "object",
              "required": [
                "customer_id"
              ],
              "properties": {
                "customer_id": {
                  "type": "number",
                  "description": "Customer id"
                }
              },
              "additionalProperties": false
            },
            "description": "Look up a customer by id."
          },
          {
            "name": "lookup_order",
            "parameters": {
              "type": "object",
              "required": [
                "order_id"
              ],
              "properties": {
                "order_id": {
                  "type": "string",
                  "description": "Order id, e.g. ORD-12345"
                }
              },
              "additionalProperties": false
            },
            "description": "Look up an order by id."
          },
          {
            "name": "issue_refund",
            "parameters": {
              "type": "object",
              "required": [
                "customer_id",
                "order_id",
                "amount"
              ],
              "properties": {
                "amount": {
                  "type": "number",
                  "description": "Amount in AUD"
                },
                "order_id": {
                  "type": "string",
                  "description": "Order id"
                },
                "customer_id": {
                  "type": "number",
                  "description": "Customer id"
                }
              },
              "additionalProperties": false
            },
            "description": "Refund an amount in AUD to the customer's original payment method."
          },
          {
            "name": "escalate_to_human",
            "parameters": {
              "type": "object",
              "required": [
                "customer_id",
                "reason"
              ],
              "properties": {
                "reason": {
                  "type": "string",
                  "description": "Why a person should decide"
                },
                "customer_id": {
                  "type": "number",
                  "description": "Customer id"
                }
              },
              "additionalProperties": false
            },
            "description": "Hand the case to a human support lead with a reason."
          },
          {
            "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 support refund 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. Resolve refund requests quickly and politely. Look the customer and order up before deciding. Gold-tier customers get the benefit of the doubt. A customer should hear about a refund once it is issued. Use the tools to act; when you are done, reply with a one-sentence summary of what you did.",
        "messages": [
          {
            "role": "user",
            "content": "Customer #5297 is asking for a refund of A$37.83 on order ORD-19397 because the subscription renewed unexpectedly."
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "customer_id": 5297
                },
                "toolName": "lookup_customer",
                "toolCallId": "call_rjmENJ65Esx01MQQcKPnefeo"
              },
              {
                "type": "tool-call",
                "input": {
                  "order_id": "ORD-19397"
                },
                "toolName": "lookup_order",
                "toolCallId": "call_0SWxfq0fRsNNj1Jh6UcG2IDj"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "id": 5297,
                    "city": "Adelaide",
                    "name": "Morgan Mockridge",
                    "tier": "gold",
                    "customer_since": "2018-02-01"
                  }
                },
                "toolName": "lookup_customer",
                "toolCallId": "call_rjmENJ65Esx01MQQcKPnefeo"
              },
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "status": "delivered",
                    "payment": "card",
                    "disputed": false,
                    "order_id": "ORD-19397",
                    "total_aud": 37.83,
                    "customer_id": 5297
                  }
                },
                "toolName": "lookup_order",
                "toolCallId": "call_0SWxfq0fRsNNj1Jh6UcG2IDj"
              }
            ]
          }
        ]
      },
      "span_id": "l2",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "amount": 37.83,
              "order_id": "ORD-19397",
              "customer_id": 5297
            },
            "tool_name": "issue_refund",
            "tool_call_id": "call_SoG1q5TjcpjGbWMfBM1ffUu3"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-11-04T10:11:03.417Z",
      "latency_ms": 1461,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "ff0dcdc3053674118d999c6eef8b6bd1953258ed741ebec762a9d201b2d884d3"
    },
    {
      "seq": 5,
      "type": "tool",
      "error": null,
      "input": {
        "amount": 37.83,
        "order_id": "ORD-19397",
        "customer_id": 5297
      },
      "output": {
        "sandbox": true,
        "refunded": true,
        "refund_id": "RF-2973783",
        "amount_aud": 37.83
      },
      "run_id": "sbx-support-refund-fd9790ae5c05",
      "ts_end": "2026-11-04T10:11:04.914Z",
      "span_id": "t3",
      "ts_start": "2026-11-04T10:11:04.878Z",
      "tool_name": "issue_refund",
      "latency_ms": 36,
      "tool_call_id": "call_SoG1q5TjcpjGbWMfBM1ffUu3",
      "parent_span_id": "l2",
      "schema_version": 1,
      "policy_evaluated": {
        "passed": true
      },
      "_hash": "0063886ff525c43c19d985afa8818df4b79f9f7897f729591148d8bc5dfa0bb7"
    },
    {
      "seq": 6,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "gpt-4o-mini",
        "provider": "openai"
      },
      "usage": {
        "input_tokens": 538,
        "total_tokens": 579,
        "output_tokens": 41
      },
      "run_id": "sbx-support-refund-fd9790ae5c05",
      "ts_end": "2026-11-04T10:11:06.312Z",
      "request": {
        "tools": [
          {
            "name": "lookup_customer",
            "parameters": {
              "type": "object",
              "required": [
                "customer_id"
              ],
              "properties": {
                "customer_id": {
                  "type": "number",
                  "description": "Customer id"
                }
              },
              "additionalProperties": false
            },
            "description": "Look up a customer by id."
          },
          {
            "name": "lookup_order",
            "parameters": {
              "type": "object",
              "required": [
                "order_id"
              ],
              "properties": {
                "order_id": {
                  "type": "string",
                  "description": "Order id, e.g. ORD-12345"
                }
              },
              "additionalProperties": false
            },
            "description": "Look up an order by id."
          },
          {
            "name": "issue_refund",
            "parameters": {
              "type": "object",
              "required": [
                "customer_id",
                "order_id",
                "amount"
              ],
              "properties": {
                "amount": {
                  "type": "number",
                  "description": "Amount in AUD"
                },
                "order_id": {
                  "type": "string",
                  "description": "Order id"
                },
                "customer_id": {
                  "type": "number",
                  "description": "Customer id"
                }
              },
              "additionalProperties": false
            },
            "description": "Refund an amount in AUD to the customer's original payment method."
          },
          {
            "name": "escalate_to_human",
            "parameters": {
              "type": "object",
              "required": [
                "customer_id",
                "reason"
              ],
              "properties": {
                "reason": {
                  "type": "string",
                  "description": "Why a person should decide"
                },
                "customer_id": {
                  "type": "number",
                  "description": "Customer id"
                }
              },
              "additionalProperties": false
            },
            "description": "Hand the case to a human support lead with a reason."
          },
          {
            "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 support refund 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. Resolve refund requests quickly and politely. Look the customer and order up before deciding. Gold-tier customers get the benefit of the doubt. A customer should hear about a refund once it is issued. Use the tools to act; when you are done, reply with a one-sentence summary of what you did.",
        "messages": [
          {
            "role": "user",
            "content": "Customer #5297 is asking for a refund of A$37.83 on order ORD-19397 because the subscription renewed unexpectedly."
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "customer_id": 5297
                },
                "toolName": "lookup_customer",
                "toolCallId": "call_rjmENJ65Esx01MQQcKPnefeo"
              },
              {
                "type": "tool-call",
                "input": {
                  "order_id": "ORD-19397"
                },
                "toolName": "lookup_order",
                "toolCallId": "call_0SWxfq0fRsNNj1Jh6UcG2IDj"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "id": 5297,
                    "city": "Adelaide",
                    "name": "Morgan Mockridge",
                    "tier": "gold",
                    "customer_since": "2018-02-01"
                  }
                },
                "toolName": "lookup_customer",
                "toolCallId": "call_rjmENJ65Esx01MQQcKPnefeo"
              },
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "status": "delivered",
                    "payment": "card",
                    "disputed": false,
                    "order_id": "ORD-19397",
                    "total_aud": 37.83,
                    "customer_id": 5297
                  }
                },
                "toolName": "lookup_order",
                "toolCallId": "call_0SWxfq0fRsNNj1Jh6UcG2IDj"
              }
            ]
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "amount": 37.83,
                  "order_id": "ORD-19397",
                  "customer_id": 5297
                },
                "toolName": "issue_refund",
                "toolCallId": "call_SoG1q5TjcpjGbWMfBM1ffUu3"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "sandbox": true,
                    "refunded": true,
                    "refund_id": "RF-2973783",
                    "amount_aud": 37.83
                  }
                },
                "toolName": "issue_refund",
                "toolCallId": "call_SoG1q5TjcpjGbWMfBM1ffUu3"
              }
            ]
          }
        ]
      },
      "span_id": "l3",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "message": "Your refund of A$37.83 for order ORD-19397 has been successfully processed.",
              "customer_id": 5297
            },
            "tool_name": "handoff_notify_customer",
            "tool_call_id": "call_JueIMYyIPKHlhY2i6NmFF4Pl"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-11-04T10:11:04.914Z",
      "latency_ms": 1398,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "401ee48d2b67fe3f01913fefa1793c5443f3d2ba67f0b1b8ba3bd236a1db79d4"
    },
    {
      "seq": 7,
      "type": "tool",
      "error": null,
      "input": {
        "message": "Your refund of A$37.83 for order ORD-19397 has been successfully processed.",
        "customer_id": 5297
      },
      "output": {
        "agent": "notify-customer-agent",
        "run_id": "sbx-notify-customer-fc24e563eb64",
        "outcome": "completed",
        "summary": "Sent an SMS to customer 5297 confirming the refund of A$37.83 for order ORD-19397.",
        "delegated": true
      },
      "run_id": "sbx-support-refund-fd9790ae5c05",
      "ts_end": "2026-11-04T10:11:07.930Z",
      "span_id": "t4",
      "ts_start": "2026-11-04T10:11:06.312Z",
      "tool_name": "handoff_notify_customer",
      "latency_ms": 1618,
      "tool_call_id": "call_JueIMYyIPKHlhY2i6NmFF4Pl",
      "parent_span_id": "l3",
      "schema_version": 1,
      "policy_evaluated": {
        "passed": true
      },
      "_hash": "efd2e13da05232d4da22a3dfe18a7a854d35cae0c511b84123f2c447354e484f"
    },
    {
      "seq": 8,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "gpt-4o-mini",
        "provider": "openai"
      },
      "usage": {
        "input_tokens": 649,
        "total_tokens": 674,
        "output_tokens": 25
      },
      "run_id": "sbx-support-refund-fd9790ae5c05",
      "ts_end": "2026-11-04T10:11:09.311Z",
      "request": {
        "tools": [
          {
            "name": "lookup_customer",
            "parameters": {
              "type": "object",
              "required": [
                "customer_id"
              ],
              "properties": {
                "customer_id": {
                  "type": "number",
                  "description": "Customer id"
                }
              },
              "additionalProperties": false
            },
            "description": "Look up a customer by id."
          },
          {
            "name": "lookup_order",
            "parameters": {
              "type": "object",
              "required": [
                "order_id"
              ],
              "properties": {
                "order_id": {
                  "type": "string",
                  "description": "Order id, e.g. ORD-12345"
                }
              },
              "additionalProperties": false
            },
            "description": "Look up an order by id."
          },
          {
            "name": "issue_refund",
            "parameters": {
              "type": "object",
              "required": [
                "customer_id",
                "order_id",
                "amount"
              ],
              "properties": {
                "amount": {
                  "type": "number",
                  "description": "Amount in AUD"
                },
                "order_id": {
                  "type": "string",
                  "description": "Order id"
                },
                "customer_id": {
                  "type": "number",
                  "description": "Customer id"
                }
              },
              "additionalProperties": false
            },
            "description": "Refund an amount in AUD to the customer's original payment method."
          },
          {
            "name": "escalate_to_human",
            "parameters": {
              "type": "object",
              "required": [
                "customer_id",
                "reason"
              ],
              "properties": {
                "reason": {
                  "type": "string",
                  "description": "Why a person should decide"
                },
                "customer_id": {
                  "type": "number",
                  "description": "Customer id"
                }
              },
              "additionalProperties": false
            },
            "description": "Hand the case to a human support lead with a reason."
          },
          {
            "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 support refund 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. Resolve refund requests quickly and politely. Look the customer and order up before deciding. Gold-tier customers get the benefit of the doubt. A customer should hear about a refund once it is issued. Use the tools to act; when you are done, reply with a one-sentence summary of what you did.",
        "messages": [
          {
            "role": "user",
            "content": "Customer #5297 is asking for a refund of A$37.83 on order ORD-19397 because the subscription renewed unexpectedly."
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "customer_id": 5297
                },
                "toolName": "lookup_customer",
                "toolCallId": "call_rjmENJ65Esx01MQQcKPnefeo"
              },
              {
                "type": "tool-call",
                "input": {
                  "order_id": "ORD-19397"
                },
                "toolName": "lookup_order",
                "toolCallId": "call_0SWxfq0fRsNNj1Jh6UcG2IDj"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "id": 5297,
                    "city": "Adelaide",
                    "name": "Morgan Mockridge",
                    "tier": "gold",
                    "customer_since": "2018-02-01"
                  }
                },
                "toolName": "lookup_customer",
                "toolCallId": "call_rjmENJ65Esx01MQQcKPnefeo"
              },
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "status": "delivered",
                    "payment": "card",
                    "disputed": false,
                    "order_id": "ORD-19397",
                    "total_aud": 37.83,
                    "customer_id": 5297
                  }
                },
                "toolName": "lookup_order",
                "toolCallId": "call_0SWxfq0fRsNNj1Jh6UcG2IDj"
              }
            ]
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "amount": 37.83,
                  "order_id": "ORD-19397",
                  "customer_id": 5297
                },
                "toolName": "issue_refund",
                "toolCallId": "call_SoG1q5TjcpjGbWMfBM1ffUu3"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "sandbox": true,
                    "refunded": true,
                    "refund_id": "RF-2973783",
                    "amount_aud": 37.83
                  }
                },
                "toolName": "issue_refund",
                "toolCallId": "call_SoG1q5TjcpjGbWMfBM1ffUu3"
              }
            ]
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "message": "Your refund of A$37.83 for order ORD-19397 has been successfully processed.",
                  "customer_id": 5297
                },
                "toolName": "handoff_notify_customer",
                "toolCallId": "call_JueIMYyIPKHlhY2i6NmFF4Pl"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "agent": "notify-customer-agent",
                    "run_id": "sbx-notify-customer-fc24e563eb64",
                    "outcome": "completed",
                    "summary": "Sent an SMS to customer 5297 confirming the refund of A$37.83 for order ORD-19397.",
                    "delegated": true
                  }
                },
                "toolName": "handoff_notify_customer",
                "toolCallId": "call_JueIMYyIPKHlhY2i6NmFF4Pl"
              }
            ]
          }
        ]
      },
      "span_id": "l4",
      "response": {
        "text": "I processed a refund of A$37.83 for order ORD-19397 and notified the customer about it.",
        "reasoning": null,
        "tool_calls": [],
        "finish_reason": "stop"
      },
      "ts_start": "2026-11-04T10:11:07.930Z",
      "latency_ms": 1381,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "e56562ad9a7772279ccd6bd75928158f902e7e12bd9c79ff1c4df238aab458ec"
    },
    {
      "seq": 9,
      "name": "support-refund-agent",
      "type": "run",
      "error": null,
      "input": null,
      "phase": "end",
      "output": {
        "summary": "I processed a refund of A$37.83 for order ORD-19397 and notified the customer about it."
      },
      "run_id": "sbx-support-refund-fd9790ae5c05",
      "status": "success",
      "ts_end": "2026-11-04T10:11:09.311Z",
      "span_id": "re",
      "metadata": {
        "demo_agent": true,
        "sandbox_tools": true
      },
      "ts_start": "2026-11-04T10:11:09.311Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "e894f70caac65dcf509861027ba78af93184c5e732bb3c9441a194387359a70f"
    }
  ]
}