Paylane Support Agent
Fintech support agent whose refund policy can't be broken — 0 policy-violating refunds across every eval run
Overview
A chat support agent for Paylane, a mock fintech, that handles refunds, identity verification, frozen cards and escalations by policy. Built as the take-home for an AI Solutions Engineer role at Fini. A code-level guard means it can't issue a refund the policy forbids, whatever the model says.
Problem
Support agents that move money are only as safe as their prompt — and prompts can be talked around. In testing, a customer message pretending to be a 'SYSTEM' instruction fooled the first version in 3 out of 3 runs.
Solution
The policy is enforced twice: the prompt teaches the rules and a deterministic guard blocks any refund that breaks them. The model sees as little as possible, hard escalations bypass verification, and the eval scores what the model tried, not just what got through.
Architecture
- 1Router: the only path from model to API; compares card digits in code and gives the model only first name, card status and verified flag
- 2Refund guard and preflight pattern check for legal threats, fraud claims and closures
- 3Hand-written tool loop with a tool budget and honest fallback to escalation
- 4Session state as the source of truth, with a 3-strike verification lock
- 5Eval harness: 21 scenarios × 3 runs, independent policy oracle, LLM judge
- 6Provider-agnostic adapters for Anthropic and OpenAI
Technical Challenges
- Defending against prompt injection without relying on the prompt alone.
- Measuring forbidden refund attempts independently of the guard's own verdicts.
Results
- Fake SYSTEM message resisted in 0/3 runs before the fix and 3/3 after.
- 0 policy-violating refunds executed in any prompt version.
- 111 tests that run with no API key.