Inferensys

Prompt

Human Review Routing Prompt Based on Confidence

A practical prompt playbook for using Human Review Routing Prompt Based on Confidence in production AI workflows.
Operations team reviewing AI workflow automation on laptop, workflow builder visible, casual office setup.
PROMPT PLAYBOOK

When to Use This Prompt

Determine if a confidence-based routing prompt is the right tool for your extraction pipeline's human review stage.

This prompt is designed for operations teams who have already completed the extraction and confidence-scoring phase of a document processing pipeline. You have a structured payload containing extracted fields, each annotated with a confidence score, null reason codes, and source spans. The job-to-be-done is not to improve the extraction itself, but to make a deterministic, auditable routing decision about which records and individual fields require human review before the data can be trusted in downstream systems. The ideal user is a pipeline architect or operations engineer who needs to replace ad-hoc, manual sampling with a configurable, rules-based review queue that integrates directly into an application.

Use this prompt when you need to apply configurable routing rules—such as per-field confidence thresholds, record-level aggregate scores, and critical-field overrides—to a batch of extraction results. The prompt expects a well-defined input schema, including the extraction payload and a routing configuration that specifies thresholds, priority weights, and SLI tracking parameters. It produces a structured review queue assignment with priority scores, routing labels, and hooks for tracking service level indicators (SLIs) like time-to-review. This is a deterministic routing layer, not a probabilistic one; the prompt's value is in consistently applying your business rules, not in making subjective judgments about data quality.

Do not use this prompt for the initial extraction step or for generating confidence scores. It assumes that extraction and confidence annotation are already complete and that the input payload conforms to a known schema. If your pipeline lacks per-field confidence scores, or if you need to disambiguate null origins (e.g., missing vs. redacted), you should first apply a prompt like the Confidence-Annotated Field Extraction Prompt Template or the Null Origin Classification Prompt Template. This prompt is also not a replacement for a full human-in-the-loop orchestration system; it handles the routing decision, but you will need to build the surrounding application logic for queue management, reviewer assignment, and SLI monitoring. The next step after reading this section is to examine the prompt template and implementation harness to understand how to wire this decision point into your pipeline.

PRACTICAL GUARDRAILS

Use Case Fit

Where a confidence-based human review routing prompt adds value and where it introduces risk. This playbook is designed for structured extraction pipelines that need auditable escalation, not for open-ended chat or creative generation.

01

Good Fit: Structured Extraction Pipelines

Use when: You have a defined schema, per-field confidence scores, and a downstream review queue. The prompt excels at transforming raw extraction outputs into prioritized worklists for human operators. Guardrail: Ensure the upstream extraction prompt already produces calibrated 0.0–1.0 confidence scores before routing.

02

Bad Fit: Real-Time Chat or Unstructured Generation

Avoid when: The system requires sub-second latency or the output is free-text without a schema. Confidence routing adds a classification step that introduces latency and is meaningless without typed fields to evaluate. Guardrail: Use lightweight intent classifiers for chat routing instead.

03

Required Inputs

Must have: A structured extraction payload with per-field confidence scores, a configured threshold map per field type, and a review queue destination. Guardrail: Validate the input schema before routing; missing confidence fields should trigger a schema error, not a silent default route.

04

Operational Risk: Threshold Drift

What to watch: Confidence score distributions shift after model updates or data drift, causing sudden spikes in false escalations or missed low-confidence records. Guardrail: Monitor the volume of routed items per threshold bucket and set alerts when routing rates deviate more than 20% from the 7-day rolling average.

05

Operational Risk: Review Queue Flooding

What to watch: A single bad batch of documents can route hundreds of records to human review, overwhelming operators and causing review fatigue. Guardrail: Implement per-batch circuit breakers that halt routing and flag the batch for triage when the escalation rate exceeds a configured maximum.

06

Bad Fit: Binary Automation Decisions

Avoid when: The downstream action is fully automated and irreversible, such as posting a transaction or sending a legal notice. Confidence routing is a prioritization tool, not a safety gate for high-stakes actions. Guardrail: Require explicit human approval for any action with legal, financial, or clinical consequence, regardless of confidence score.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A production-ready prompt that evaluates per-field and per-record confidence against routing rules, assigns review queue assignments with priority scores, and includes SLI tracking hooks.

This prompt template is designed to be pasted directly into your orchestration layer. It accepts an extraction payload containing fields, confidence scores, null reason codes, and source spans, then applies configurable routing rules to determine whether each record should be auto-accepted, escalated for human review, or rejected. Replace every square-bracket placeholder with your specific extraction schema, routing thresholds, queue names, and SLI tracking requirements before deployment.

text
You are a human-review routing engine for an extraction pipeline. Your job is to evaluate extraction records against routing rules and produce a structured review queue assignment.

## INPUT
You will receive an extraction payload in the following JSON schema:
[EXTRACTION_PAYLOAD_SCHEMA]

Example payload:
[EXAMPLE_PAYLOAD]

## ROUTING RULES
Apply the following rules in order. The first matching rule determines the routing decision.

1. **Reject**: If any field in [CRITICAL_FIELD_LIST] has confidence below [CRITICAL_THRESHOLD] OR null_reason is [UNACCEPTABLE_NULL_REASONS], route to REJECT queue with priority = 1.
2. **Escalate**: If any field has confidence below [FIELD_THRESHOLD_MAP] for its field type, OR if ambiguity_flags contains [ESCALATION_FLAGS], route to [REVIEW_QUEUE_NAME] with priority = [PRIORITY_CALCULATION_RULE].
3. **Escalate**: If record_confidence is below [RECORD_THRESHOLD], route to [REVIEW_QUEUE_NAME] with priority = [PRIORITY_CALCULATION_RULE].
4. **Auto-Accept**: Otherwise, route to [ACCEPTED_QUEUE_NAME] with priority = 0.

## OUTPUT SCHEMA
Return a valid JSON object with this exact structure:
{
  "record_id": "string",
  "routing_decision": "ACCEPT" | "ESCALATE" | "REJECT",
  "queue_name": "string",
  "priority": number,
  "matched_rule": "string",
  "triggered_fields": [
    {
      "field_path": "string",
      "confidence": number,
      "threshold": number,
      "reason": "string"
    }
  ],
  "sli_metadata": {
    "routing_timestamp": "ISO8601",
    "total_fields_evaluated": number,
    "fields_below_threshold": number,
    "record_confidence": number
  },
  "human_review_context": {
    "summary": "One-sentence summary of why this record needs review",
    "source_spans": ["span_reference"],
    "ambiguity_notes": ["string"]
  }
}

## CONSTRAINTS
- Never auto-accept a record where [CRITICAL_FIELD_LIST] fields are missing or below threshold.
- Priority must be an integer from 0 (lowest) to [MAX_PRIORITY] (highest).
- If multiple fields trigger escalation, include all of them in triggered_fields.
- If no fields trigger escalation but record_confidence is below threshold, set triggered_fields to an empty array and note record-level confidence as the reason.
- The human_review_context.summary must cite specific field names and confidence values.
- Do not hallucinate fields or confidence values not present in the input.

## EXAMPLES
[FEW_SHOT_EXAMPLES]

## CURRENT PAYLOAD
[EXTRACTION_PAYLOAD]

After pasting this template, replace the placeholders with your production values. [CRITICAL_FIELD_LIST] should include fields whose absence or low confidence makes the entire record unusable—typically identifiers, dates, or regulated data points. [FIELD_THRESHOLD_MAP] defines per-field confidence floors; set these based on calibration benchmarks from your confidence scoring system prompt. [PRIORITY_CALCULATION_RULE] can be a simple formula like 10 - (record_confidence * 10) or a lookup table. The sli_metadata block is essential for tracking routing accuracy over time—pipe it into your observability stack alongside extraction confidence distributions. Validate the output against the schema before enqueueing, and log any records that fail schema validation for prompt debugging.

IMPLEMENTATION TABLE

Prompt Variables

Required inputs for the Human Review Routing Prompt. Each variable must be populated before the prompt is assembled and sent. Validation notes describe how to check the input before execution.

PlaceholderPurposeExampleValidation Notes

[EXTRACTION_PAYLOAD]

The full extraction output containing per-field confidence scores, null reason codes, and source spans

{"record_id": "INV-1042", "fields": [{"name": "total_amount", "value": null, "confidence": 0.34, "null_reason": "MISSING"}]}

Must be valid JSON. Must contain a fields array with confidence scores in 0.0-1.0 range. Reject if fields array is empty or missing.

[ROUTING_RULES]

Field-level and record-level confidence thresholds that determine review queue assignment

{"field_thresholds": {"total_amount": 0.85, "vendor_name": 0.70}, "record_threshold": 0.80, "escalation_threshold": 0.50}

Must be valid JSON. Each threshold must be a float between 0.0 and 1.0. record_threshold and escalation_threshold are required. Reject if escalation_threshold > record_threshold.

[QUEUE_DEFINITIONS]

Available review queues with priority levels, SLAs, and assignment logic

{"queues": [{"name": "urgent_review", "priority": 1, "sla_minutes": 15}, {"name": "standard_review", "priority": 2, "sla_minutes": 120}]}

Must be valid JSON with at least one queue. Each queue requires name, priority as integer, and sla_minutes as positive integer. Reject if duplicate queue names.

[SLI_HOOKS]

Service level indicator tracking configuration for latency, queue depth, and resolution time

{"track_latency": true, "track_queue_depth": true, "alert_threshold_queue_depth": 50}

Must be valid JSON. Boolean fields must be true or false. alert_threshold_queue_depth must be a positive integer if provided. Null allowed for optional fields.

[RECORD_ID]

Unique identifier for the extraction record being routed

INV-1042

Must be a non-empty string. Should match the record_id in EXTRACTION_PAYLOAD. Reject if null, empty, or whitespace-only.

[SOURCE_DOCUMENT_REF]

Reference to the source document for audit trail and reviewer context

s3://invoices/2025/inv-1042.pdf#page=2

Must be a non-empty string. Should be a resolvable path or URI. Null allowed if source is unavailable, but audit completeness will be flagged.

[ROUTING_TIMESTAMP]

ISO 8601 timestamp of when routing decision is requested

2025-01-15T14:32:00Z

Must be valid ISO 8601 format. Must be parseable by standard datetime libraries. Reject if in the future by more than 5 minutes.

[PREVIOUS_ROUTING_DECISIONS]

History of prior routing decisions for this record to prevent duplicate assignments

[{"timestamp": "2025-01-15T10:00:00Z", "queue": "standard_review", "status": "pending"}]

Must be valid JSON array or null. Each entry requires timestamp, queue, and status fields. Reject if status is not one of: pending, in_progress, resolved, escalated.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the Human Review Routing Prompt into a production application with validation, retries, logging, and queue assignment.

The routing prompt is not a standalone decision-maker; it is a classification step inside a larger extraction pipeline. The application layer should call this prompt only after field-level extraction and confidence scoring are complete. The prompt expects a structured payload containing per-field confidence scores, null reason codes, and source spans. It returns a routing decision with a priority score and a queue assignment. The application must validate that the input payload is complete before invoking the model, because missing confidence data will produce unreliable routing decisions.

Wire the prompt into a post-extraction processing step. After the primary extraction model returns its annotated JSON, run a lightweight validation check: confirm every required field has a confidence score between 0.0 and 1.0, verify that null reason codes are present where values are absent, and check that source spans are non-empty for extracted values. If validation fails, log the malformed record and route it to a dead-letter queue for manual inspection—do not pass it to the routing prompt. For validated records, assemble the routing prompt with the extraction payload inserted into the [EXTRACTION_OUTPUT] placeholder and the configured thresholds in [CONFIDENCE_THRESHOLDS]. Use a fast, cost-effective model for this classification step (e.g., GPT-4o-mini, Claude Haiku) since the task is structured judgment, not generation. Set temperature=0 to ensure deterministic routing decisions. On the response, validate that the output contains routing_decision, priority_score, and queue_assignment fields. If the model returns an invalid structure, retry once with a stricter schema instruction; if it fails again, escalate the record to a human-operated review queue with a ROUTING_ERROR flag.

Log every routing decision with the record ID, timestamp, model version, confidence scores, priority score, and assigned queue. This audit trail is essential for SLI tracking: measure the rate of auto-approved records, the escalation rate, the human overturn rate on escalated records, and the routing error rate. Set up a periodic eval that samples routed records and checks whether the routing decision aligns with a human reviewer's judgment; use this to tune [CONFIDENCE_THRESHOLDS] and detect threshold drift. Avoid routing high-risk fields (e.g., financial amounts, clinical findings, legal obligations) without a mandatory human review step regardless of confidence score—encode this as a hard rule in the application layer, not just in the prompt. When a record is routed for human review, attach the full extraction payload, source spans, and confidence justifications so the reviewer can make an informed decision without re-reading the entire source document.

PRACTICAL GUARDRAILS

Common Failure Modes

What breaks first when routing extraction tasks to human review based on confidence scores, and how to guard against it.

01

Threshold Tuning Drift

What to watch: Static confidence thresholds (e.g., 0.7) become misaligned as model behavior, data distribution, or business tolerance changes. Too low floods the queue; too high lets errors through. Guardrail: Implement threshold as a runtime configuration parameter, not a hardcoded prompt value. Monitor acceptance rate and false-negative rate weekly, and trigger a review when either shifts by more than 10%.

02

Confidence Score Inflation

What to watch: The model assigns high confidence to incorrect extractions because it misinterprets fluent but wrong text as certain. This is common with plausible-sounding dates, amounts, or names that match a pattern but not the source. Guardrail: Run a calibration benchmark with known-correct and known-incorrect examples before deployment. Flag any field where high-confidence predictions exceed a 5% error rate for prompt revision.

03

Queue Starvation from Over-Escalation

What to watch: A single ambiguous document type or field pattern triggers mass escalation, overwhelming reviewers and creating a backlog that defeats the purpose of automation. Guardrail: Implement a circuit breaker that caps the percentage of records routed to review per batch. When the cap is hit, log a sample of escalated records for diagnosis and route the remainder with a low_confidence_override flag for downstream handling.

04

Silent Null Misclassification

What to watch: The model assigns high confidence to a null classification (e.g., Not Applicable) when the value is actually present but unrecognized. The extraction is marked complete and bypasses review, but data is lost. Guardrail: Require a mandatory evidence_span for every null reason code. If no span can be cited, force the field into the review queue regardless of confidence score. Add a specific eval for null-recall on a held-out set with known present values.

05

Priority Inversion in Review Queues

What to watch: All escalated records receive the same priority, so a critical field with 0.4 confidence waits behind a cosmetic field with 0.69 confidence. Reviewers waste time on low-impact items while high-impact errors age. Guardrail: Weight the priority score by field criticality (predefined per schema) multiplied by (1 - confidence). Route high-criticality, low-confidence items to the top of the queue. Include the priority formula in the escalation payload.

06

Review Feedback Loop Breakage

What to watch: Reviewers correct escalated extractions, but those corrections never feed back into prompt improvement or threshold tuning. The same errors escalate repeatedly, and the system never learns. Guardrail: Log every reviewer correction with the original model output, confidence score, and source context. Run a monthly analysis to identify the top three error patterns and update prompts, examples, or thresholds accordingly. Close the loop or accept permanent review cost.

IMPLEMENTATION TABLE

Evaluation Rubric

Use this rubric to test the Human Review Routing Prompt before deployment. Each criterion validates a specific routing behavior. Run these tests against a golden dataset of records with known confidence profiles.

CriterionPass StandardFailure SignalTest Method

High-confidence auto-approval

Records with all fields above [HIGH_CONFIDENCE_THRESHOLD] route to auto-approve queue with priority 0

Record routed to review queue or assigned non-zero priority

Run 20 records with per-field confidence >= 0.95; assert queue = auto-approve and priority = 0

Low-confidence escalation

Records with any field below [LOW_CONFIDENCE_THRESHOLD] route to human_review queue with priority >= 3

Record routed to auto-approve or assigned priority < 3

Run 20 records with at least one field confidence < 0.60; assert queue = human_review and priority >= 3

Mixed-confidence routing

Records with fields between thresholds route to review queue with priority 1-2 based on lowest field confidence

Record auto-approved or assigned priority outside 1-2 range

Run 20 records with min field confidence between 0.60 and 0.95; assert queue = review and 1 <= priority <= 2

Null reason code preservation

Null fields retain their [NULL_REASON_CODE] in the routing payload without coercion

Null reason code overwritten, defaulted to Unknown, or missing from payload

Run records with Missing, Redacted, and Not Applicable null codes; assert output preserves original code per field

Priority score monotonicity

Records with lower minimum confidence receive strictly higher or equal priority scores

Record with min confidence 0.55 receives lower priority than record with min confidence 0.65

Sort 30 records by min confidence descending; assert priority scores are non-decreasing

SLI tracking fields present

Output includes [ROUTING_TIMESTAMP], [QUEUE_ASSIGNMENT], [PRIORITY_SCORE], and [LOWEST_CONFIDENCE_FIELD] for every record

Any SLI field missing or null in routing payload

Validate output schema for 50 records; assert all four SLI fields present and non-null

Batch routing consistency

Identical records routed through the same prompt invocation receive identical queue and priority assignments

Same record receives different queue or priority within a single batch

Duplicate 5 records within a 50-record batch; assert routing output matches for each duplicate pair

Edge case: all fields null

Record where every field is null routes to human_review with priority 5 and reason code ALL_NULL

Record auto-approved or assigned priority < 5

Run 5 records with all fields null and reason codes set; assert queue = human_review, priority = 5, reason = ALL_NULL

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Start with the base prompt and a simple threshold rule: if any field confidence is below [THRESHOLD], route the entire record to a review queue. Use a flat JSON output with review_decision (auto/review) and priority_score (0.0-1.0). Skip SLI tracking hooks and queue assignment logic. Test with 10-20 records manually.

code
If any field in [EXTRACTED_RECORD] has confidence < [THRESHOLD], set review_decision to "review".

Watch for

  • Hardcoded thresholds that don't match field criticality
  • No distinction between low-confidence critical fields and low-confidence optional fields
  • Review queue flooding when confidence is uniformly low across a batch
Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.