Case study

AgentDesk

A multi-agent customer-operations assistant with tool calling, RAG with citations, guardrails and an eval harness

AgentDesk preview
4
cooperating agents
16/16
eval cases passed
3/3
injection attacks blocked

What it does

AgentDesk takes a support request such as "Where is order 1042, and can I get a refund?", plans the steps, looks things up, takes actions through tools and answers with sources, while keeping risky actions behind guardrails and human approval.

Architecture

AgentJobTools it may call
PlannerTurns the request into an ordered list of tool calls, validated with Pydanticnone
KnowledgeAnswers policy questions from the knowledge basesearch_policies
DataReads order and customer dataget_order, list_my_orders
ActionChanges staterequest_refund, send_email

Each agent can only call its own tools, so a plan that asks the knowledge agent to issue a refund is rejected before anything runs. SQL tools use parameterised queries; the model never writes SQL. It works with any OpenAI-compatible API, and without a key it runs a rule-based planner so the demo, tests and evaluation run anywhere.

Guardrails

  • Prompt-injection detection on user messages and on retrieved documents; the knowledge base deliberately contains a poisoned document to show this.
  • Ownership checks, so a customer can only read their own orders.
  • Refunds above Rs. 5,000 wait for a supervisor's approval.
  • PII redaction of emails, phone numbers and card numbers in replies and logs, and a hard limit on steps per request.

Evaluation

A fixed set of 16 cases covers order status, policy questions, refunds that should be issued, sent for approval or refused, access to another customer's order, three prompt-injection attacks and a question that touches the poisoned document. The harness scores tool selection, attack refusals, grounding, latency and token cost. The offline planner passes 16 of 16, with 13 of 13 correct tool selections and 3 of 3 attacks blocked; 28 unit tests cover the rest.

More case studies

Hiring for AI engineers?

I'm Abhinav Tarigoppula, open to AI engineer roles: internships now, full-time from 2027.