Skip to content
Agentic AI services

Closed-loop AI evaluation and agentic testing

Evaluation gets built into an agent from the start, not bolted on afterwards: agents that test agents, simulated users, failure feedback loops and human review gates. Weaknesses show up in a test run, not in front of a customer.

What it is
Testing whose results feed back into the system being tested
Best for
Agents already handling real work in production
Pairs with
Self-learning systems

What closed-loop evaluation is

An open loop measures an agent and produces a score. A closed loop feeds those results back into the system that produced them.

AI systems need this more than conventional software does. Outputs vary between runs, so one successful trial proves little. There is usually no one correct string, so correctness must be written as criteria. And they fail softly: a wrong answer arrives in the same confident tone as a correct one. The AI agents versus chatbots page covers the difference in expectations.

Agents that test agents

Producing thousands of realistic test cases by hand is not feasible, so the work splits across three agent roles.

  • Case generation. A generator agent writes inputs across the range the real system will meet: partial information, contradictory requests, unusual formats.
  • Grading. A separate agent judges each output against explicit written criteria, so the verdict is reproducible and reviewable.
  • Adversarial probing. A third role hunts for inputs that push the agent outside its scope, away from its instructions, or into confident guessing.

A grader is itself a model and can be wrong. So the criteria are written down before grading begins, and its judgments are sampled against human review.

Simulating real user behavior

Real users change their mind halfway, leave out the detail that matters and wander off topic. So the tests run against whole conversations and workflows, end to end.

Simulation drives the system with agents playing users: one gives requirements piecemeal, one contradicts an earlier answer, one asks for something out of scope. Context gets dropped, or an earlier constraint is forgotten. Failures that only appear on turn six are invisible to single-turn testing and obvious under simulation. Conversational systems are covered on the agentic chat assistant page.

Failure feedback loops

A failure is only useful if it changes the system. Each one runs through the same five steps.

  1. Capture the whole trace

    Input, context retrieved, tools called, intermediate outputs, final answer. A final answer alone is not diagnosable.
  2. Classify the cause

    Retrieval returned the wrong material, routing sent the work to the wrong step, or the instructions were ambiguous. The model may also have reasoned badly over correct inputs. Each cause has a different fix.
  3. Fix the cause, not the symptom

    Patching a prompt to cover a retrieval problem just moves the failure.
  4. Freeze the case as a regression test

    So that failure cannot quietly return.
  5. Re-run the full suite

    A change that fixes one class of input often degrades another.

A failure can only be attributed to its cause if the handoffs are inspectable. That is why Fig AI Systems designs multi-agent orchestration around structured handoffs. Retrieval changes are measured on the vector databases and retrieval side.

Human-in-the-loop review gates

Some decisions should not be fully automated. Evaluation data shows which ones, so Fig AI Systems places review gates where the evidence says they are needed.

A review gate pauses a workflow, shows the reviewer the output and the evidence, and records the decision. That record shows whether the written criteria match what an expert wants. It feeds straight back into the grading criteria. Over time the gates can narrow to the cases that genuinely need judgment.

These patterns in Report Grader

Report Grader is a domain-specific AI analysis system for education teams. It grades school reports against national and international standards, cutting manual correction time.

Skill-enabled agents are mapped to a domain-specific corpus, so judgments are anchored to the criteria that apply. DOCX and PDF parsing with segmentation channels parallel LLM calls at high concurrency. Human-in-the-loop grading keeps inspector input where it matters.

1,000+LLM call orchestrationReport Grader runs this loopA Fig AI Systems demo for education teams. Review criteria sit between inspector input and the system, so a correction improves the criteria and not just one output.See Report Grader

When evaluation is worth building

Evaluation earns its cost when the same agent runs many times and a wrong answer has a consequence.

A good fit when

  • Outputs reach customers
  • Several people keep changing prompts
  • A reviewer can say whether an output was right
  • Failures repeat in recognisable classes

Not yet when

  • The agent is a one-off internal experiment
  • A person reads every output anyway
  • Nobody can define what correct means

Either way, write down what a good output looks like before building. Those sentences become the grading criteria later. More questions of this kind are answered on the Fig AI Systems FAQ.

Frequently asked questions

How is evaluating an AI agent different from writing unit tests?

A unit test asserts one exact result. An AI agent can word the same correct answer many ways, and varies between runs. Asserting on an exact string either fails constantly or tests nothing. Evaluation judges outputs against written criteria across many cases. Fig AI Systems keeps unit tests for the deterministic parts: parsing, routing, tool calls, data contracts. Graded evaluation covers what a model decides.

Can one AI model be trusted to grade another one?

Within limits, and only with safeguards. The criteria must be written down explicitly. The grader must not be the agent that produced the answer. Its judgments must be sampled against human review, so drift stays visible. Fig AI Systems uses model graders to cover volume no team could review by hand.

Can evaluation be added to an AI agent that is already live?

Yes, and it is a common starting point. The first step is capturing full traces of what the live system already does. Those traces become a regression suite built from actual failures. Graders and review gates then go around the steps where a wrong answer costs most.

Ready when you are

Find the failures before your users do

Any agent can be wrapped in a closed evaluation loop, live or prototype: real traces, graded cases, regression coverage and review gates.