OpenAI Agents SDK Starter: Customer Support Desk

Skip the hello-world: start from a multi-agent support desk with guardrails, approvals and tests that already pass.

OpenAI Agents SDK Starter: Customer Support Desk product illustration

What it does

A working multi-agent customer-support app on the OpenAI Agents SDK (openai-agents 0.24.0, Python 3.10+), with the parts tutorials skip: guardrails, human approval for refunds, pause-and-resume across processes, session memory, ownership checks and offline tests.

customer -> Triage agent --handoff--> Orders agent  (lookup_order, track_shipment, search_faq, create_ticket)
                         \--handoff--> Billing agent (lookup_order, refund_order*, search_faq, create_ticket)
            * refunds above $50 pause the run until a person approves or rejects

What you get

The screenshot is real output from the kit’s own commands. Tested from a fresh download of this exact zip: ./run_tests.sh ran 23 tests OK on Python 3.13 and 3.10.

Real terminal output from OpenAI Agents SDK Starter: Customer Support Desk: demo and passing tests

What's inside

FileWhat it does
support_desk/desk.pyThe three agents, handoffs (with the SDK's recommended handoff prompt) and per-agent tools
support_desk/tools.pyFunction tools that check inputs and the signed-in customer themselves (never trust the model for that)
support_desk/guardrails.pyCard-number blocker (Luhn-checked, runs *before* the model sees the message), prompt-injection blocker, output leak guard, optional model-based on-topic check
support_desk/desk_runner.pyOne customer turn: approvals loop, guardrail handling, save_paused / load_paused to resume a paused run later in another process
support_desk/store.pySQLite stand-in for your order system: replace these functions with your API
support_desk/testing.pyScriptedModel (you script each model reply) and DemoModel (rule-based, for the offline demo). Both implement the SDK's Model interface
support_desk/__main__.pyCLI: ask (one message) and chat (with SQLite session memory)
tests/23 offline tests

Run it

python3 -m venv .venv && . .venv/bin/activate
pip install -r requirements.txt
./demo.sh                                     # offline, no API key
./run_tests.sh                                # offline, no API key

export OPENAI_API_KEY=...                     # then talk to a real model
python -m support_desk chat --email maya@example.com
python -m support_desk ask "Where is my order A1002?" --email maya@example.com

The model is the SDK's default unless you set OPENAI_MODEL. --limit 100 changes the auto-approve refund limit. Demo customers: maya@, leo@ and ana@example.com (orders A1001-A1005).

Things this kit gets right (and why)

  • Input guardrails run only for the agent a run starts with. If you continue a conversation with the Billing agent, guardrails on the triage agent alone would be skipped. Every agent here has them, and a test checks it.
  • The card blocker runs before the model (run_in_parallel=False), so the number is never sent to OpenAI. A test proves the model is never called.
  • Approvals fail closed. With a callable needs_approval, the SDK asks a human whenever argument validation changes the input, so a plain float amount makes the model's 20 (an integer) need approval every time. amount is typed int | float and a test covers it.
  • Paused runs survive restarts. save_paused() serializes the run with only the safe parts of your context; load_paused() re-attaches your live database in another process.
  • Ownership is checked in code. Asking about someone else's order gets nothing, whatever the model is told.
  • Refunds are limited in code to delivered orders, the 30-day window and the amount left on the order.

Test your own agents offline

from support_desk.testing import ScriptedModel, call, say
model = ScriptedModel([[call("transfer_to_billing_agent")], [call("lookup_order", order_id="A1001")], [say("Found it!")]])
triage = build_agents(model)   # real Runner, tools, handoffs and guardrails; scripted LLM replies

model.seen records the instructions, input and tools each call received, so you can assert on what the model was shown.

How it was tested

23 tests on Python 3.13 and 3.10 with openai-agents 0.24.0: routing and handoffs, auto and manual refund approval (approve, reject, no approver), serialize-and-resume in a fresh agent graph, ownership checks, refund limits, the integer-amount approval gotcha, all guardrails (including that the model is never called), session memory across SQLiteSession objects, and the CLI. The SDK's runner, tools, handoffs, guardrails, approvals and sessions all run for real; only the LLM is replaced by an offline model.

Honest limits

  • Tests don't call a real model (no API key needed). With a real model, answers vary; the code-level checks (ownership, limits, guardrails, approvals) do not.
  • DemoModel is a rule-based stand-in for the demo, not a chatbot.
  • The prompt-injection blocker is a keyword filter; add the model-based on_topic check or your own for stronger screening.
  • The store is a SQLite demo. Connect your real order system before going live.
  • Tracing is on by default with a real key (sensitive data excluded); turn it off with set_tracing_disabled(True) if you don't want traces sent to OpenAI.

Format and license

Zip, 20 KB, v1.0, 15 files. You may use and modify this kit for your own work and for clients you serve, including paid client work. Not affiliated with or endorsed by OpenAI.

FAQ

Do I need an API key to try it?
No. The demo and all 23 tests run offline; you need a key only to talk to a real model.
Which model does it use?
The SDK's default unless you set OPENAI_MODEL.
Can I adapt it to my store?
Yes: replace the functions in store.py with calls to your order system and edit the agents' instructions.
How do I get the files?
Pay by card right here on youraitools.co: your download links appear on this page the moment the payment goes through (claim window: 72 hours, up to 5 downloads per 7 days). Need the files re-sent later? Email hello@youraitools.co.
Refunds?
Email hello@youraitools.co within 14 days if it doesn’t work and we can’t fix it.
Can I pay with crypto?
Yes. Pay the same price in USDC or USDT on Base, Ethereum, Arbitrum, Optimism, Polygon or Solana from the "Pay with crypto" button, with no account or KYC. We check the payment on-chain and show your download links as soon as it confirms.

Get OpenAI Agents SDK Starter: Customer Support Desk

OpenAI Agents SDK starter in Python: triage, orders and billing agents, handoffs, guardrails, human approval for refunds, sessions and 23 offline tests.

Save with a bundle

Pairs well with

DownloadFree

System Prompt Templates Starter (Free)

Free system prompt templates for a support agent, ticket triage (JSON) and RAG with citations, plus a test runner for any OpenAI-compatible model.

View System Prompt Templates Starter (Free)

Related

1 email a week: new x402 + MCP tools and free kits.

Short weekly digest of new x402 + MCP tools and free kits, including the MCP OAuth Checker. No spam, unsubscribe any time.