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
| Agent | Job | Tools it may call |
|---|---|---|
| Planner | Turns the request into an ordered list of tool calls, validated with Pydantic | none |
| Knowledge | Answers policy questions from the knowledge base | search_policies |
| Data | Reads order and customer data | get_order, list_my_orders |
| Action | Changes state | request_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.


