← All case studies
AI Agent Testing
An evaluation platform that proves an AI agent is safe to ship
An organization was rolling out AI agents across its internal operations, some vendor-hosted and some built in-house, with no consistent way to show that an agent was safe, on-brand and correct before more people started using it. A QA engineer designed and built an evaluation platform to close that gap. It runs scenario-based tests against any agent, scores every response in three layers, and produces governance-grade evidence for go, constrain or hold decisions.
85tests in the adversarial and functional pack
3scoring layers: code, LLM judge, human
32/32code and LLM judge agreement
5release gates, sandbox to production
The problem
- Impressions instead of evidence. Agents were judged on demos, not repeatable results.
- Many ways in. Agents could be reached through a browser behind single sign-on (SSO), an API, a prompt file or a code repository.
- Real security exposure. Prompt injection, data exfiltration, PII leakage and identity override needed adversarial testing, not happy-path checks.
- Different readers, different needs. Developers, governance, security and leadership each needed a different view of the same results.
The solution
The platform has three components.
| Component | Purpose |
|---|---|
| Evaluation engine | Runs scenario packs against agents, scores the responses and produces evidence. |
| Service (API) | Handles intake, requests, QA assignment, report storage and work-item integration. |
| Portal (web app) | Lets teams request an evaluation, QA run and track it, and stakeholders view reports. |
How it works
- IntakeThe owner describes the agent: its purpose, limits, data access and how to reach it.
- Runner selectionOne reusable runner exists for each access type. The browser runner (Playwright with an SSO session) and the manifest runner (replays an agent's own instructions against the same model) are built. API and code-aware runners are planned.
- Scenario packEach agent gets YAML test cases tagged by category and severity. Categories include brand, operational correctness, legal and liability, PII, prompt injection, data exfiltration, escalation and adversarial cases.
- Layered scoring
- Code judge. Deterministic regex patterns covering auto-fail, fail and pass. This is the hard gate.
- LLM judge. Settles ambiguous results. Each score records a pinned contract (model ID, rubric version and a SHA-256 hash of the prompt) so it can be reproduced.
- Human review. Required for critical injection cases. Those never pass just because no evidence of failure was found.
- CalibrationBlind human labels are compared with machine verdicts using Cohen's kappa before the automated judges are trusted at scale.
- Release gatesFive stages run from sandbox to full production (G0 to G4). Thresholds are explicit; for example, 100% on critical security categories is required to move past sandbox.
- Reporting
Each audience gets its own output:
- Developer fix packages with expected versus actual results and remediation steps
- Governance evidence packages
- Leadership scorecards and static HTML dashboards
Design principles
- Evidence over impression. Every run is an immutable, schema-validated artifact.
- No invented data. Reports are sent exactly as produced. A translation layer that had to make up missing fields was removed.
- Answer-key isolation. The agent under test never sees expected outputs, judge prompts or grading logic.
- Agent output is untrusted input. The judge itself is built to resist injection.
- Core plus adapters. A new agent is configuration plus a scenario pack, not a rebuild.
- Human-gated changes. For agents the team owns, the platform proposes fixes. For external agents, it only produces fix packages. Rubrics, judge contracts and gate thresholds stay under human approval.
- Tools added only when a measured gap appears. DeepEval comes in if the semantic false-pass rate rises above 8%. Promptfoo or Garak come in when red-team scale requires them.
Outcomes
- An 85-test adversarial and functional pack (v1.3) for a production help-desk agent, plus packs for two more agents.
- Dozens of reproducible, schema-validated runs, with a one-command flow: preflight, capture, judge, report.
- 100% agreement (32 of 32) between the code judge and the LLM judge where both scored the same tests.
- Early runs surfaced critical-severity issues in security categories. They went to the owning team as actionable fix packages rather than anecdotes.
- The work grew from a framework into a three-tier internal platform with self-service intake and a governed path to release.
Technology stack
Evaluation engine
- Python 3.14 with Playwright (Chromium) for browser automation
- PyYAML scenario packs; every run artifact validated against a JSON Schema (draft-07)
- OpenAI Python SDK pointed at GitHub Models, with GPT-4o for critical cases and GPT-4o-mini for bulk, routed by severity
- Standard-library statistics for Cohen's kappa; generated static HTML dashboards and slide decks
- PowerShell bootstrap and a preflight readiness check for dependencies, browser and auth session
AI-assisted operations
- A fleet of 11 GitHub Copilot custom agents: orchestrator, runner, scenario evaluator, brand, compliance, escalation and privacy evaluators, regression detector, evidence-package generator, architect and outbound reviewer
- Model Context Protocol (MCP) integrations for work tracking and a persistent project knowledge base
- Model routing by tier: Claude Sonnet for build work, Claude Opus for design judgment, GPT models for drafting and red-team variety
Service (backend)
- Python 3.12, FastAPI, Uvicorn, Pydantic Settings
- SQLAlchemy 2.0, Alembic migrations, pyodbc to Azure SQL
- Microsoft Entra ID JWT validation (PyJWT) with role-based access stored in SQL
- Managed identity via azure-identity; a transactional outbox that creates work items
- uv lockfile, pytest, Ruff, mypy in strict mode
Portal (frontend)
- React 18, TypeScript 5, Vite 6, Tailwind CSS, Radix UI, Lucide icons
- Redux Toolkit with redux-persist, TanStack Query, React Router 7, Axios
- MSAL (Entra ID SSO), Module Federation micro-frontend, a shared internal component library
- Vitest, Testing Library, Mock Service Worker, and Playwright for end-to-end and visual-regression tests
- ESLint and Prettier; a dependency-free Node 22 static host
Cloud and delivery
- Azure App Service (Linux), Azure SQL, Key Vault, Storage, Application Insights and Log Analytics
- VNet integration, private endpoints, HTTPS-only and managed identities; Service Bus planned for async work
- Azure DevOps YAML pipelines, kept separate for PR validation, code, infrastructure and database migration
- ARM parameter files defined for Dev, QA and Prod; GitVersion, justfile and WSL2 support
Need proof your agent is ready?
If you are putting AI agents in front of real users and want repeatable evidence instead of a good demo, let's talk.
Let's Talk