Draft replies to refund requests with AI, never send them

An agent checks a refund request against your policy and drafts a reply for a human to approve. It cannot issue the refund.

  • Files
  • Read-only connection
  • Callback
  • Budget cap

Watch a real run

A real run on Oct 7, 2026, replayed. Model: openai/gpt-6-luna.

Input
{
  "ticket_id": "tkt_1001",
  "today": "2026-10-06"
}
Succeededrun_3602104e2ab91b251b1b9eac8516ac97$0.002782 of $0.03
  1. Queuedbudget $0.03 reserved
  2. MicroVMmicroVM ready
  3. MicroVMworker started · shell off · web off
  4. Fileread refund-policy.md
  5. Connectionhelpdesk GET /tickets/tkt_1001
  6. Resulthelpdesk GET → 200
  7. MicroVMmicroVM destroyed
  8. Succeeded3 model calls, 4,442 tokensRecorded output (English)

    Decision: Eligible

    Reason: Policy clause 1 allows a full refund within 14 days for an annual plan if no project was created and no API call was made. The ticket shows purchase on 2026-09-28, zero projects, and zero API calls; the request is dated 2026-10-06, within 14 days.

    Draft reply: Hi Maria, your annual plan meets the refund criteria. The billing team will process the refund to your original payment method. Best, Support

  9. Worker destroyed$0.002782 charged, $0.027218 released
Model $0.000382 · Web $0.00 · Compute $0.0024

Run it yourself

Open the sample in the playground with the whole request filled in. It runs on your own account, within the budget shown, against the same read-only sample systems.

Budget for this sample: $0.03

How it works

The policy is a file and the ticket comes from a read-only helpdesk connection. The agent decides whether the request is eligible, quotes the clause it relied on, and writes a draft. A person approves and the billing system does the rest.

What the agent can and cannot do

The permissions are part of the request. Anything not listed here is not available to the run.

SettingAllowed
Connections
helpdesk: GET only, at ephemer.al/api/samples/support-api
WebOff
ShellOff
Filesrefund-policy.md (read-only)
Zero data retentionOff: the record is kept for 30 days
Budget$0.03, a hard cap
Timeout60 seconds

Credentials never enter the machine: a broker adds them to each call and enforces the methods above.

The code

This is the exact request the sample sends. Set EPHEMERAL_API_KEY to a member key of your organization.

curl -X POST $EPHEMERAL_URL/v1/runs \
  -H "Authorization: Bearer $EPHEMERAL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d @request.json

Files in the request

Passed inline, so nothing is uploaded first. The agent sees each one as a read-only file.

refund-policy.md
refund-policy.md
# Refund policy

1. Annual plans may be refunded in full within 14 days of purchase if no project has been created and no API call has been made.
2. After 14 days, or after any use, annual plans are refunded pro rata for the unused full months only, at our discretion.
3. Monthly plans are not refunded for the current month; cancelling stops the next charge.
4. A refund is issued by the billing team only, to the original payment method. Never promise a date.
5. Always be polite, concise and plain. Do not offer discounts.
Full request body request.json

The same body, with the files inline.

request.json
{
  "prompt": "Handle the refund request in the helpdesk ticket input.ticket_id (GET /tickets/{id}); today's date is input.today. Apply refund-policy.md. Reply in Markdown with: Decision (eligible, not eligible or needs a human, one line), Reason (cite the policy clause number and the ticket facts you used), and Draft reply (under 90 words, in the customer's language). The draft is for a human to review: never say a refund has been issued, only that the billing team will process it if the decision is eligible. Use only what the data returns and never guess; if a call fails or a field is missing, say so.",
  "input": {
    "ticket_id": "tkt_1001",
    "today": "2026-10-06"
  },
  "files": [
    {
      "path": "refund-policy.md",
      "content": "# Refund policy\n\n1. Annual plans may be refunded in full within 14 days of purchase if no project has been created and no API call has been made.\n2. After 14 days, or after any use, annual plans are refunded pro rata for the unused full months only, at our discretion.\n3. Monthly plans are not refunded for the current month; cancelling stops the next charge.\n4. A refund is issued by the billing team only, to the original payment method. Never promise a date.\n5. Always be polite, concise and plain. Do not offer discounts.\n"
    }
  ],
  "connections": {
    "helpdesk": {
      "type": "http",
      "url": "https://ephemer.al/api/samples/support-api",
      "auth": {
        "type": "bearer",
        "token": "sample_read_key"
      },
      "allowed_methods": [
        "GET"
      ],
      "instructions": "A helpdesk. GET /tickets lists tickets (id, subject, status, language). GET /tickets/{id} returns one ticket with customer, context (order or invoice facts) and the full message thread. Amounts are in cents."
    }
  },
  "shell": false,
  "timeout_seconds": 60,
  "max_cost_micros": 30000
}

Read more

Related samples

esc

Nothing matches “”.