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.

How to use this resource

  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

FAQ

How does a repair prompt fix one bad label without regenerating the whole response?

The OUTPUT RULES pin it down: "Fix only the problems listed above — do not change anything else" and "Keep everything that was already correct unchanged." In this example only the invalid "Very Urgent" label is flagged, so your assistant returns the corrected classification against the defined set and leaves the rest untouched — a surgical edit, not a re-roll.

Where does the repair prompt come from and where does the corrected output go?

The AI Output Validator generates the repair prompt from real findings, so no violations means no repair. You send it in the same thread where the model's response is still warm, then paste the corrected output back into the validator — a PASS closes the loop, anything else gets a fresh repair prompt. NewPrompt never runs or confirms the fix.

More resources from AI Output Validator

Resources that pair well

Related tools

Guides for this resource

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