Project — Agent Engineering
Telco Support Agent: Guardrails & Evals
Below is the console used to operate a Tier-1 support agent for Bayani Telecom, a fictional Philippine mobile operator. You play the customer. Every tool call the agent makes is checked against policy in code before it runs, and you can watch its state, database writes and trace as it works. Try to get it to break a rule.
How to use it: pick an opener under the message box (each plays a specific test customer), or a customer from the list, then reply using the number, PIN and facts in the "Playing" bar. Tool calls, blocked actions and handoffs appear inline; the inspector on the right shows guardrail state, the rows written to the database and the trace. Runs live on Claude Haiku 4.5 through AWS Lambda; each conversation gets its own fresh mock database, kept for two hours. All customers, numbers and PINs are fictional. Live messages are rate-limited per visitor, with recorded conversations available when the limit is reached.
01 — What you're watching
The model proposes, the code decides
Each message goes through a tool-use loop: the model reads the conversation and asks for tools; a deterministic policy check runs before every call. A blocked call never executes. The model gets back POLICY_BLOCKED with the rule and has to recover; that's the red row in the transcript. State such as "verified" or "credits issued" only changes from tool results, never from what the model claims.
apply_credit when the customer agreed. Rule P3 blocked the call before it ran, and the model transferred the case to a specialist with a complete summary. The prompt alone would have let PHP 2,350 through.
| Rule | Requirement | Enforced by |
|---|---|---|
| P1 | No account read or write before identity is verified | Code |
| P2 | SIM replacement needs two verification factors | Code |
| P3 | At most PHP 500 in credits per conversation; above that, a human | Code |
| P4 | Credit only a disputable line item on the verified customer's own bill | Code + backend |
| P5 | A plan change during lock-in needs the pre-termination fee quoted first | Code + backend |
| P6 | Changes to the account need the customer's explicit yes | Code |
| P7 | Never act on or reveal another customer's account | Code + judge |
| P8 | Transfer on legal threats, regulator complaints, fraud flags, three failed verifications, or a request for a human | Code |
| P9 | No promises the tools didn't produce | LLM judge |
02 — Evaluation
Graded by the database, not by vibes
An offline harness runs 40 scenarios against the same agent. An LLM plays the customer from a persona, a hidden goal and the only facts it may state. Each trial gets a fresh database, and a trial passes only if read-only SQL assertions hold (was exactly PHP 149 credited, on the right line item?), required tools succeeded and forbidden ones didn't, the transfer decision matches, and a judge finds no data leak (P7) or unbacked promise (P9).
The headline metric is pass^k, the probability that all k trials of a scenario pass. An agent that handles a dispute correctly three times out of four isn't reliable, and a single-trial pass rate hides that.
03 — Status
Live; eval numbers to follow
The console above runs the real agent: same prompt, tools and policy engine as the eval harness, on Claude Haiku 4.5. Published pass^k results and a failure analysis will be added after the first full eval run. Stack: Python, Pydantic, SQLite, Claude via the Bedrock Converse API, AWS Lambda and DynamoDB, React and TypeScript for the console, GitHub Actions.