{
  "$schema": "runback.audit/v2",
  "manifest": {
    "run_id": "sbx-support-refund-7a53d0f0aa97",
    "generated_at": "2026-11-07T07:36:04.175Z",
    "event_count": 10,
    "algorithm": "sha256-chain",
    "content_digest": "e23b6b281c50d18523e6d6239ce10605bc3ba0c0db50cc3017a8fd3b4ebb6c3a",
    "replay": {
      "cassette_digest": "c3e16822cd9d09c09e0e8bf178979ed62c5c2aed21156b6aa455e1dde43dcc74",
      "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": "90a6fcd9dd883428864f452075ca3c4fb3d451a0bd270bbc3127eed7b7d8747da1ffbd8e392069b407fe5a4ddcc0cd7e6a8879b40ed02cfb9fcb483da4e08f0e",
      "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-7a53d0f0aa97",
    "name": "support-refund-agent",
    "status": "success",
    "input": "Customer #7058 is asking for a refund of A$28.61 on order ORD-79061 because the item arrived damaged.",
    "output": {
      "summary": "I processed a refund of A$28.61 for order ORD-79061 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.000396,
      "sandbox_tools": true,
      "scenario_seed": "support-refund-agent:2026-11-01:40"
    },
    "step_count": 4,
    "total_tokens": 2180,
    "started_at": "2026-11-01T07:11:02.087+00:00",
    "ended_at": "2026-11-01T07:11:09.391+00:00",
    "actor_type": null,
    "actor_id": null
  },
  "events": [
    {
      "seq": 0,
      "name": "support-refund-agent",
      "type": "run",
      "error": null,
      "input": "Customer #7058 is asking for a refund of A$28.61 on order ORD-79061 because the item arrived damaged.",
      "phase": "start",
      "output": null,
      "run_id": "sbx-support-refund-7a53d0f0aa97",
      "status": "running",
      "ts_end": "2026-11-01T07:11:09.391Z",
      "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.000396,
        "sandbox_tools": true,
        "scenario_seed": "support-refund-agent:2026-11-01:40"
      },
      "ts_start": "2026-11-01T07:11:02.087Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "47ed807380d993faed4281c4ee957a5122a811020595ef9acf4cda64da17d528"
    },
    {
      "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-7a53d0f0aa97",
      "ts_end": "2026-11-01T07:11:03.741Z",
      "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 #7058 is asking for a refund of A$28.61 on order ORD-79061 because the item arrived damaged."
          }
        ]
      },
      "span_id": "l1",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "customer_id": 7058
            },
            "tool_name": "lookup_customer",
            "tool_call_id": "call_BibAdqWdD9Riuw6ub72d4ZEI"
          },
          {
            "input": {
              "order_id": "ORD-79061"
            },
            "tool_name": "lookup_order",
            "tool_call_id": "call_vXX2U1V8r13DH7npw5Tk6awf"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-11-01T07:11:02.087Z",
      "latency_ms": 1654,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "1cba99798296583dc164da89b9d5340735e5477c6ba7894766d828fe889d5c8d"
    },
    {
      "seq": 2,
      "type": "tool",
      "error": null,
      "input": {
        "customer_id": 7058
      },
      "output": {
        "id": 7058,
        "city": "Adelaide",
        "name": "Avery Sandbox",
        "tier": "gold",
        "customer_since": "2019-11-01"
      },
      "run_id": "sbx-support-refund-7a53d0f0aa97",
      "ts_end": "2026-11-01T07:11:03.866Z",
      "span_id": "t1",
      "ts_start": "2026-11-01T07:11:03.741Z",
      "tool_name": "lookup_customer",
      "latency_ms": 125,
      "tool_call_id": "call_BibAdqWdD9Riuw6ub72d4ZEI",
      "parent_span_id": "l1",
      "schema_version": 1,
      "policy_evaluated": {
        "passed": true
      },
      "_hash": "73e221c6a62ff2aaa81da71d672b3866aa6a115dd35ac824b77abf9cf641e743"
    },
    {
      "seq": 3,
      "type": "tool",
      "error": null,
      "input": {
        "order_id": "ORD-79061"
      },
      "output": {
        "status": "delivered",
        "payment": "card",
        "disputed": false,
        "order_id": "ORD-79061",
        "total_aud": 28.61,
        "customer_id": 7058
      },
      "run_id": "sbx-support-refund-7a53d0f0aa97",
      "ts_end": "2026-11-01T07:11:03.889Z",
      "span_id": "t2",
      "ts_start": "2026-11-01T07:11:03.866Z",
      "tool_name": "lookup_order",
      "latency_ms": 23,
      "tool_call_id": "call_vXX2U1V8r13DH7npw5Tk6awf",
      "parent_span_id": "l1",
      "schema_version": 1,
      "policy_evaluated": {
        "passed": true
      },
      "_hash": "ae341b06aace19d001f7d75a764e1468f9167aa93794fec6c785ae283c356523"
    },
    {
      "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-7a53d0f0aa97",
      "ts_end": "2026-11-01T07:11:05.590Z",
      "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 #7058 is asking for a refund of A$28.61 on order ORD-79061 because the item arrived damaged."
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "customer_id": 7058
                },
                "toolName": "lookup_customer",
                "toolCallId": "call_BibAdqWdD9Riuw6ub72d4ZEI"
              },
              {
                "type": "tool-call",
                "input": {
                  "order_id": "ORD-79061"
                },
                "toolName": "lookup_order",
                "toolCallId": "call_vXX2U1V8r13DH7npw5Tk6awf"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "id": 7058,
                    "city": "Adelaide",
                    "name": "Avery Sandbox",
                    "tier": "gold",
                    "customer_since": "2019-11-01"
                  }
                },
                "toolName": "lookup_customer",
                "toolCallId": "call_BibAdqWdD9Riuw6ub72d4ZEI"
              },
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "status": "delivered",
                    "payment": "card",
                    "disputed": false,
                    "order_id": "ORD-79061",
                    "total_aud": 28.61,
                    "customer_id": 7058
                  }
                },
                "toolName": "lookup_order",
                "toolCallId": "call_vXX2U1V8r13DH7npw5Tk6awf"
              }
            ]
          }
        ]
      },
      "span_id": "l2",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "amount": 28.61,
              "order_id": "ORD-79061",
              "customer_id": 7058
            },
            "tool_name": "issue_refund",
            "tool_call_id": "call_LWaNRzeA8het9gmrCsprWbGU"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-11-01T07:11:03.889Z",
      "latency_ms": 1701,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "398177652409134b42b462473513d16da7585fce231ee9b1e33ef8c3b814df06"
    },
    {
      "seq": 5,
      "type": "tool",
      "error": null,
      "input": {
        "amount": 28.61,
        "order_id": "ORD-79061",
        "customer_id": 7058
      },
      "output": {
        "sandbox": true,
        "refunded": true,
        "refund_id": "RF-0582861",
        "amount_aud": 28.61
      },
      "run_id": "sbx-support-refund-7a53d0f0aa97",
      "ts_end": "2026-11-01T07:11:05.618Z",
      "span_id": "t3",
      "ts_start": "2026-11-01T07:11:05.590Z",
      "tool_name": "issue_refund",
      "latency_ms": 28,
      "tool_call_id": "call_LWaNRzeA8het9gmrCsprWbGU",
      "parent_span_id": "l2",
      "schema_version": 1,
      "policy_evaluated": {
        "passed": true
      },
      "_hash": "e61be408c5d90f90b7a371d0346ba227dcbc2648f034d617184db112fbb8ca42"
    },
    {
      "seq": 6,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "gpt-4o-mini",
        "provider": "openai"
      },
      "usage": {
        "input_tokens": 538,
        "total_tokens": 583,
        "output_tokens": 45
      },
      "run_id": "sbx-support-refund-7a53d0f0aa97",
      "ts_end": "2026-11-01T07:11:06.979Z",
      "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 #7058 is asking for a refund of A$28.61 on order ORD-79061 because the item arrived damaged."
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "customer_id": 7058
                },
                "toolName": "lookup_customer",
                "toolCallId": "call_BibAdqWdD9Riuw6ub72d4ZEI"
              },
              {
                "type": "tool-call",
                "input": {
                  "order_id": "ORD-79061"
                },
                "toolName": "lookup_order",
                "toolCallId": "call_vXX2U1V8r13DH7npw5Tk6awf"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "id": 7058,
                    "city": "Adelaide",
                    "name": "Avery Sandbox",
                    "tier": "gold",
                    "customer_since": "2019-11-01"
                  }
                },
                "toolName": "lookup_customer",
                "toolCallId": "call_BibAdqWdD9Riuw6ub72d4ZEI"
              },
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "status": "delivered",
                    "payment": "card",
                    "disputed": false,
                    "order_id": "ORD-79061",
                    "total_aud": 28.61,
                    "customer_id": 7058
                  }
                },
                "toolName": "lookup_order",
                "toolCallId": "call_vXX2U1V8r13DH7npw5Tk6awf"
              }
            ]
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "amount": 28.61,
                  "order_id": "ORD-79061",
                  "customer_id": 7058
                },
                "toolName": "issue_refund",
                "toolCallId": "call_LWaNRzeA8het9gmrCsprWbGU"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "sandbox": true,
                    "refunded": true,
                    "refund_id": "RF-0582861",
                    "amount_aud": 28.61
                  }
                },
                "toolName": "issue_refund",
                "toolCallId": "call_LWaNRzeA8het9gmrCsprWbGU"
              }
            ]
          }
        ]
      },
      "span_id": "l3",
      "response": {
        "text": null,
        "reasoning": null,
        "tool_calls": [
          {
            "input": {
              "message": "Your refund of A$28.61 for order ORD-79061 has been processed due to the damaged item.",
              "customer_id": 7058
            },
            "tool_name": "handoff_notify_customer",
            "tool_call_id": "call_uqGDHOoqvzJR0AsXk46Sjfzs"
          }
        ],
        "finish_reason": "tool-calls"
      },
      "ts_start": "2026-11-01T07:11:05.618Z",
      "latency_ms": 1361,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "cb721216b4086ff34c5c9be1c8881644ead3b13d07afa9f7e39a617d0553743c"
    },
    {
      "seq": 7,
      "type": "tool",
      "error": null,
      "input": {
        "message": "Your refund of A$28.61 for order ORD-79061 has been processed due to the damaged item.",
        "customer_id": 7058
      },
      "output": {
        "agent": "notify-customer-agent",
        "run_id": "sbx-notify-customer-ce13e813e7ac",
        "outcome": "completed",
        "summary": "Sent an email to customer #7058 notifying them that their refund of A$28.61 for order ORD-79061 has been processed.",
        "delegated": true
      },
      "run_id": "sbx-support-refund-7a53d0f0aa97",
      "ts_end": "2026-11-01T07:11:08.297Z",
      "span_id": "t4",
      "ts_start": "2026-11-01T07:11:06.979Z",
      "tool_name": "handoff_notify_customer",
      "latency_ms": 1318,
      "tool_call_id": "call_uqGDHOoqvzJR0AsXk46Sjfzs",
      "parent_span_id": "l3",
      "schema_version": 1,
      "policy_evaluated": {
        "passed": true
      },
      "_hash": "602f26e0b52c35e23d2444318c058873e05d964e6c58dc776d9d4225ca02d613"
    },
    {
      "seq": 8,
      "type": "llm",
      "error": null,
      "model": {
        "model_id": "gpt-4o-mini",
        "provider": "openai"
      },
      "usage": {
        "input_tokens": 657,
        "total_tokens": 682,
        "output_tokens": 25
      },
      "run_id": "sbx-support-refund-7a53d0f0aa97",
      "ts_end": "2026-11-01T07:11:09.391Z",
      "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 #7058 is asking for a refund of A$28.61 on order ORD-79061 because the item arrived damaged."
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "customer_id": 7058
                },
                "toolName": "lookup_customer",
                "toolCallId": "call_BibAdqWdD9Riuw6ub72d4ZEI"
              },
              {
                "type": "tool-call",
                "input": {
                  "order_id": "ORD-79061"
                },
                "toolName": "lookup_order",
                "toolCallId": "call_vXX2U1V8r13DH7npw5Tk6awf"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "id": 7058,
                    "city": "Adelaide",
                    "name": "Avery Sandbox",
                    "tier": "gold",
                    "customer_since": "2019-11-01"
                  }
                },
                "toolName": "lookup_customer",
                "toolCallId": "call_BibAdqWdD9Riuw6ub72d4ZEI"
              },
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "status": "delivered",
                    "payment": "card",
                    "disputed": false,
                    "order_id": "ORD-79061",
                    "total_aud": 28.61,
                    "customer_id": 7058
                  }
                },
                "toolName": "lookup_order",
                "toolCallId": "call_vXX2U1V8r13DH7npw5Tk6awf"
              }
            ]
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "amount": 28.61,
                  "order_id": "ORD-79061",
                  "customer_id": 7058
                },
                "toolName": "issue_refund",
                "toolCallId": "call_LWaNRzeA8het9gmrCsprWbGU"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "sandbox": true,
                    "refunded": true,
                    "refund_id": "RF-0582861",
                    "amount_aud": 28.61
                  }
                },
                "toolName": "issue_refund",
                "toolCallId": "call_LWaNRzeA8het9gmrCsprWbGU"
              }
            ]
          },
          {
            "role": "assistant",
            "content": [
              {
                "type": "tool-call",
                "input": {
                  "message": "Your refund of A$28.61 for order ORD-79061 has been processed due to the damaged item.",
                  "customer_id": 7058
                },
                "toolName": "handoff_notify_customer",
                "toolCallId": "call_uqGDHOoqvzJR0AsXk46Sjfzs"
              }
            ]
          },
          {
            "role": "tool",
            "content": [
              {
                "type": "tool-result",
                "output": {
                  "type": "json",
                  "value": {
                    "agent": "notify-customer-agent",
                    "run_id": "sbx-notify-customer-ce13e813e7ac",
                    "outcome": "completed",
                    "summary": "Sent an email to customer #7058 notifying them that their refund of A$28.61 for order ORD-79061 has been processed.",
                    "delegated": true
                  }
                },
                "toolName": "handoff_notify_customer",
                "toolCallId": "call_uqGDHOoqvzJR0AsXk46Sjfzs"
              }
            ]
          }
        ]
      },
      "span_id": "l4",
      "response": {
        "text": "I processed a refund of A$28.61 for order ORD-79061 and notified the customer about it.",
        "reasoning": null,
        "tool_calls": [],
        "finish_reason": "stop"
      },
      "ts_start": "2026-11-01T07:11:08.297Z",
      "latency_ms": 1094,
      "parent_span_id": "r",
      "schema_version": 1,
      "_hash": "3820c2dbbf136b196bce1c66949df858cd95cb4915b94afcf776bba1bf0bb70b"
    },
    {
      "seq": 9,
      "name": "support-refund-agent",
      "type": "run",
      "error": null,
      "input": null,
      "phase": "end",
      "output": {
        "summary": "I processed a refund of A$28.61 for order ORD-79061 and notified the customer about it."
      },
      "run_id": "sbx-support-refund-7a53d0f0aa97",
      "status": "success",
      "ts_end": "2026-11-01T07:11:09.391Z",
      "span_id": "re",
      "metadata": {
        "demo_agent": true,
        "sandbox_tools": true
      },
      "ts_start": "2026-11-01T07:11:09.391Z",
      "parent_span_id": null,
      "schema_version": 1,
      "_hash": "e23b6b281c50d18523e6d6239ce10605bc3ba0c0db50cc3017a8fd3b4ebb6c3a"
    }
  ]
}