Prompt Engineering Repair Prompt Output Validation

Repair AI Output with a Repair Prompt

Don't re-roll the whole response — send back a surgical prompt that fixes the violations and keeps everything that was right.

Overview

When output breaks the rules, the reflex is to regenerate — and lose everything that was correct in the re-roll. The repair prompt is the better move: it restates the original requirement, lists each violation with its specific fix, and instructs the model to return only the corrected output, changing nothing else. This setup demonstrates it on a classification that invented a label ("Very Urgent") outside the defined set — one of the violations where a surgical fix beats a fresh attempt.

Workflow

  1. Validate first

    The repair prompt is generated from real findings — no findings, no repair, no busywork.

  2. Send it in the same thread

    The model repairs its own response best when that response is still in context.

  3. Re-validate the repair

    Paste the corrected output back in — PASS closes the loop; anything else gets a fresh repair prompt.

Why This Works

  • "Fix only the problems listed" constrains the model exactly where regeneration doesn't
  • Restating the original requirement re-anchors the contract
  • The validate → repair → re-validate loop converges in one or two rounds

Best for

  • Responses that are 90% right — most of them
  • Long outputs where regeneration costs real tokens
  • Conversations where the model's context is still warm

Not for

  • Content that is wrong rather than misformatted — bad facts need a better prompt, not a repair
  • Defining label sets up front — that's the Data Classification Prompt

Use cases

  • Fixing one wrong label without re-rolling the analysis
  • Correcting format violations in long responses cheaply
  • Standardizing the repair flow across a team

Tip: Save time by exploring related resources and tools that integrate with this workflow.

Explore all resources