Production AI Institute — vendor-neutral certification for AI practitioners
Verify a credentialFor organisationsContact
Pattern LibraryCore Patterns
Part 1: Core PatternsPSF D2 · Output ValidationPSF D6 · Human OversightPAI-8 C5 · Output ControlsPAI-8 C4 · Human Oversight

Reflection

An agent critiques and revises its own output before it reaches a human.

Reflection adds a quality control loop inside the agent system. Before any output is returned to a user or passed downstream, a reflection step reviews it against defined criteria and either approves it, revises it, or escalates it for human review.

The reflection pattern separates generation from evaluation. The primary agent produces an initial output. A reflection prompt — which may be handled by the same model or a separate one — reviews that output against explicit criteria: correctness, completeness, tone, compliance with defined constraints, internal consistency. If the reflection finds problems, it produces a revised output. The cycle can repeat up to a defined maximum number of iterations. Termination conditions are critical: the loop must stop when output quality meets the threshold, or when the maximum iteration limit is reached — regardless of whether quality is satisfactory. Unresolved issues should be flagged for human review rather than silently passed through.

In practice

A government agency uses a reflection pattern for drafting consultation responses. The primary agent drafts an initial response to a public submission. The reflection agent reviews it against a checklist: Does it address every point raised? Is the language appropriate for public communication? Does it contradict any stated policy positions? Does it make claims that require supporting evidence? When all criteria are met, the response is queued for human sign-off. The reflection loop reduces the human reviewer's correction rate from 68% to 11%.

Why it matters

The cost of catching errors before output reaches humans is orders of magnitude lower than catching them after. A reflection loop is automated quality assurance built into the agent architecture. It doesn't eliminate the need for human oversight of high-stakes outputs — but it ensures that what reaches human reviewers is already at a high baseline quality.

Framework alignment

PSF Domains
D2
Output Validation
View PSF domain →
D6
Human Oversight
View PSF domain →
PAI-8 Controls
C5
C4

Production failure modes

How this pattern fails in practice — and what to watch for.

Hallucinated self-critique

The reflection agent confidently identifies 'errors' in a correct output and 'corrects' them, introducing hallucinations. This is particularly dangerous because the revised output looks more carefully reviewed — it has been through an extra step — but is actually worse than the original.

Infinite loop without termination

Reflection criteria are defined in a way that can never be fully satisfied. The agent revises indefinitely, never converging. Without a hard maximum iteration limit, this consumes resources and time without ever producing output.

Sycophantic convergence

When the same model is used for both generation and reflection, it tends to approve its own outputs. The reflection step becomes a rubber stamp that adds the appearance of quality review without the substance. This is especially likely for long outputs where the model loses context on what it originally generated.

Implementation checklist

Seven things to verify before deploying this pattern in production.

1

Set a hard maximum iteration limit — the loop must terminate regardless of quality

2

Test reflection with known-correct outputs to verify it doesn't corrupt them

3

Use a different model instance or system prompt for reflection vs. generation where possible

4

Define explicit, measurable reflection criteria — avoid vague instructions like 'is this good'

5

Log the before and after state of every reflection cycle for audit

6

Define what constitutes 'improved enough' to proceed without further iteration

7

Flag unresolved reflection issues for human review rather than passing them through silently

Certification relevance

Reflection is one of the most-tested patterns in the AIDA exam, appearing under both D2 (the loop design) and D6 (when reflection should escalate to human review rather than continuing). CAIG examines the governance angle: how do you verify that the reflection criteria are appropriate, and who owns them? CAIAUD auditors look for evidence that termination conditions are implemented and that reflection logs are retained.

AIDA — Take the exam →CAIG — Take the exam →CAIAUD — Take the exam →

Related patterns

Part 1 · Core Patterns
Prompt Chaining
Sequential task decomposition where each model output feeds the next input.
Part 3 · Enterprise Patterns
Debate and Verification
Two agents take opposing positions; a third evaluates the debate and produces a verified conclusion.
Part 2 · Production Patterns
Human-in-the-Loop
The architecture for deciding when agents act autonomously and when they pause for human review.
Production AI Institute

Certify your understanding of production AI patterns

The AIDA certification covers all 21 agentic design patterns with a focus on deployment safety, governance, and the PSF. Free to attempt.

Start AIDA — Free →All 21 patterns