This prompt is designed for product reliability teams who need to build an automated review queue that catches inputs outside the normal operating envelope of a production AI system. The core job-to-be-done is distribution-aware triage: before an input reaches a downstream model, agent, or RAG pipeline, you need to classify it as in-distribution (safe to process automatically), a boundary case (process with caution or elevated logging), or out-of-distribution (route to a human review queue with diagnostic context). The ideal user is an MLOps engineer, AI safety engineer, or backend developer integrating this classifier into a request preprocessing layer where silent failures on novel inputs are more expensive than a human review loop.
Prompt
Novel Input Classifier Prompt for Review Routing

When to Use This Prompt
Define the job, the ideal user, required context, and when this prompt is the wrong tool.
You should use this prompt when you have a defined baseline of expected inputs and a taxonomy of known edge cases, but you anticipate distribution shift, adversarial inputs, or genuinely novel scenarios in production. The prompt requires several concrete inputs to function: a representative sample of in-distribution examples, a set of known boundary cases, and a defined output schema that your review queue system can parse. It works best when paired with a nearest-neighbor retrieval step that provides the classifier with similar known examples for comparison. Do not use this prompt as a standalone safety filter for blocking toxic content or enforcing hard policy rules—it is a routing classifier, not a guardrail. It also should not replace a dedicated prompt injection detector or a hallucination scorer; those are separate specialized tools that may feed into the same review queue.
Before deploying this prompt, you must prepare eval criteria that measure recall on known edge cases (you should catch the boundary cases you already know about) and routing accuracy (in-distribution inputs should not be escalated, and out-of-distribution inputs should not be passed through). Common failure modes include over-escalation when the in-distribution examples are too narrow, and under-escalation when the boundary between in-distribution and boundary-case is poorly defined. Start by running this classifier on a golden dataset of labeled examples, measure the false positive and false negative rates for escalation, and tune the prompt's instructions and few-shot examples until the routing decisions match your risk tolerance. Only then should you wire it into a live review queue with human reviewers who can provide feedback to relabel misclassified cases.
Use Case Fit
Where the Novel Input Classifier Prompt delivers value and where it introduces risk. Use these cards to decide if this pattern fits your review routing architecture.
Good Fit: Production Review Queues
Use when: you have a live system receiving diverse user inputs and need to separate routine cases from edge cases before autonomous handling. Guardrail: Pair with a human review queue that receives structured escalation payloads containing confidence scores and nearest-neighbor context.
Bad Fit: Static or Narrow Domains
Avoid when: your input distribution is small, fixed, or entirely known at build time. A classifier adds latency and maintenance overhead without benefit. Guardrail: Use simple rule-based routing or keyword matching until input diversity justifies learned classification.
Required Input: Baseline Distribution
What to watch: the classifier needs a reference window of known in-distribution examples to compare against. Without this, novelty scores become arbitrary. Guardrail: Maintain a versioned baseline dataset and update it after known distribution shifts or model migrations.
Operational Risk: Routing Latency
What to watch: adding a classification step before routing increases end-to-end latency, which can degrade user experience in real-time systems. Guardrail: Set a latency budget for the classification call and fall back to a default queue if the classifier times out.
Operational Risk: Boundary Drift
What to watch: the boundary between in-distribution and out-of-distribution shifts as your product evolves, causing the classifier to over-escalate or under-escalate. Guardrail: Monitor escalation rates weekly and recalibrate thresholds when rates deviate more than 20% from baseline.
Operational Risk: Review Queue Overload
What to watch: a classifier that is too conservative will flood human reviewers with false positives, causing alert fatigue and slow triage. Guardrail: Set a target escalation rate and tune confidence thresholds to meet it. Track reviewer feedback to identify systematic over-escalation patterns.
Copy-Ready Prompt Template
A reusable prompt template for classifying inputs as in-distribution, boundary-case, or out-of-distribution and routing novel cases to human review.
This prompt template is the core classification engine for your review routing pipeline. It takes an input, compares it against a defined distribution baseline and known edge cases, and produces a structured classification with a confidence score and routing decision. The template uses square-bracket placeholders so you can swap in your own taxonomy, examples, and output schema without rewriting the logic. Copy it directly into your prompt management system, replace the placeholders with your domain-specific values, and wire it into your application's pre-processing or guard stage.
textYou are an input classifier for a production AI system. Your job is to determine whether an input falls within the system's known operating distribution, sits at a boundary case, or is out-of-distribution and requires human review. ## Classification Taxonomy - IN_DISTRIBUTION: The input matches known patterns, topics, and complexity levels the system handles reliably. - BOUNDARY_CASE: The input partially matches known patterns but contains unusual elements, edge conditions, or ambiguity that reduces confidence. - OUT_OF_DISTRIBUTION: The input is novel, unexpected, or falls outside the system's defined capability boundary. ## Distribution Baseline [IN_DISTRIBUTION_DESCRIPTION] ## Known Edge Cases [EDGE_CASE_EXAMPLES] ## Input to Classify [INPUT] ## Output Schema Return a JSON object with exactly these fields: { "classification": "IN_DISTRIBUTION" | "BOUNDARY_CASE" | "OUT_OF_DISTRIBUTION", "confidence": 0.0-1.0, "rationale": "Brief explanation of the classification decision", "nearest_neighbor_context": "Description of the closest known pattern or edge case, or null if none applies", "recommended_action": "PROCEED_AUTONOMOUSLY" | "ROUTE_TO_REVIEW" | "BLOCK_AND_ESCALATE", "diagnostic_signals": ["List of specific signals that informed the classification"] } ## Constraints [CONSTRAINTS] ## Examples [EXAMPLES]
Adaptation guidance: Replace [IN_DISTRIBUTION_DESCRIPTION] with a concrete description of your system's normal operating range—include topic boundaries, input formats, complexity limits, and any domain-specific guardrails. Populate [EDGE_CASE_EXAMPLES] with 3-5 real boundary cases your system has encountered, including both false positives and false negatives from prior classification attempts. The [CONSTRAINTS] field should capture hard rules such as 'never classify medical emergency language as IN_DISTRIBUTION' or 'inputs exceeding 2000 tokens are automatically BOUNDARY_CASE.' For [EXAMPLES], provide 2-3 few-shot demonstrations showing the full JSON output for each classification category. If your system uses tools or retrieval, add a [TOOLS] placeholder describing available lookup functions. For high-risk domains, set [RISK_LEVEL] to trigger mandatory human review on all BOUNDARY_CASE and OUT_OF_DISTRIBUTION classifications regardless of confidence score.
Before deploying this prompt, validate it against a golden dataset of 50-100 labeled examples spanning all three classification categories. Measure recall on known edge cases and routing accuracy—the proportion of OUT_OF_DISTRIBUTION inputs correctly routed to human review. Common failure modes include over-classifying slightly unusual but safe inputs as BOUNDARY_CASE (false escalations that flood your review queue) and under-classifying genuinely novel inputs as IN_DISTRIBUTION (missed escalations that let unsafe inputs through). Start with a confidence threshold of 0.7 for autonomous routing and adjust based on your tolerance for missed escalations versus review queue volume.
Prompt Variables
Required inputs for the Novel Input Classifier Prompt. Each placeholder must be populated before the prompt is assembled and sent to the model. Validation notes describe how to verify the input is well-formed before execution.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[INPUT_TEXT] | The user query, document, or message to classify as in-distribution, boundary-case, or out-of-distribution | How do I reset my MFA token for the staging environment? | Non-empty string check. Reject null or whitespace-only inputs before prompt assembly. Max length enforced by context budget. |
[DISTRIBUTION_DESCRIPTION] | Natural language description of the expected input distribution, including typical topics, formats, and user intents the system was designed to handle | Technical support questions about authentication, deployment, and configuration for our SaaS platform. Users are internal engineers. | Must be a non-empty string. Should be reviewed by a domain expert for accuracy. Vague descriptions reduce classifier precision. |
[BOUNDARY_EXAMPLES] | Few-shot examples of inputs that fall at the edge of the distribution, with labels and reasoning to calibrate the boundary | {"input": "Can I use your API to delete all user records?", "label": "boundary-case", "reasoning": "Valid product question but high-risk action requiring approval"} | Must be valid JSON array with at least 3 examples. Each example requires input, label, and reasoning fields. Schema check before prompt injection. |
[OUT_OF_DISTRIBUTION_EXAMPLES] | Few-shot examples of inputs clearly outside the expected distribution, with labels and reasoning | {"input": "Write a poem about my cat's birthday party", "label": "out-of-distribution", "reasoning": "Creative writing request unrelated to technical support scope"} | Must be valid JSON array with at least 3 examples. Each example requires input, label, and reasoning fields. Schema check before prompt injection. |
[CONFIDENCE_THRESHOLD] | Minimum confidence score required for the classifier to route autonomously. Scores below this threshold trigger human review regardless of predicted class | 0.85 | Must be a float between 0.0 and 1.0. Values below 0.7 produce excessive escalations. Values above 0.95 may miss genuine edge cases. Validate range before prompt assembly. |
[OUTPUT_SCHEMA] | The expected JSON structure for the classifier response, including fields for classification label, confidence score, reasoning, and nearest-neighbor references | {"classification": "string", "confidence": "float", "reasoning": "string", "nearest_neighbors": [{"input": "string", "similarity": "float"}]} | Must be a valid JSON Schema or example structure. Parse check before prompt injection. Confirm all required fields are present and types are specified. |
[ESCALATION_QUEUE_ID] | Identifier for the review queue where escalated items should be routed, used to tag the output for downstream orchestration | review-queue-edge-cases-v2 | Non-empty string matching a valid queue identifier in the routing system. Validate against known queue registry before prompt execution. Null not allowed. |
[MAX_NEAREST_NEIGHBORS] | Maximum number of similar known examples to include in the classifier output for human reviewer context | 3 | Must be a positive integer. Values above 10 add noise and token cost. Values below 1 remove useful context. Validate as integer in range 1-10. |
Implementation Harness Notes
How to wire the Novel Input Classifier into a production review routing pipeline with validation, retries, and human-in-the-loop controls.
The Novel Input Classifier prompt is designed to sit at the ingress point of an AI pipeline, before any autonomous action or generation occurs. In a production harness, the raw user input is intercepted and passed to this classifier as the [INPUT] variable. The [CONTEXT] variable should be populated with a representative sample of in-distribution examples drawn from your production logs, typically the last 1,000–5,000 inputs, to serve as the baseline for novelty detection. The [OUTPUT_SCHEMA] must be enforced as a strict JSON contract containing classification (one of in_distribution, boundary_case, out_of_distribution), confidence_score (0.0–1.0), nearest_neighbor_examples (an array of the 3 closest matches from the provided context), and diagnostic_notes (a brief explanation of why the input was classified as it was). This structured output is what your application code will parse to make a routing decision.
After the model returns a classification, the application harness must validate the response before acting on it. First, confirm that the classification field matches one of the three allowed enum values; if not, retry the prompt once with a stricter schema reminder. Second, check that confidence_score is a float between 0 and 1. Third, if the classification is boundary_case or out_of_distribution, the harness should automatically route the input to a human review queue, packaging the original input, the classifier's full JSON response, and any available session metadata into a review ticket. For in_distribution classifications with a confidence score below 0.85, consider routing to a secondary review queue with a lower priority label. Log every classification decision, including the model version, prompt template version, input hash, and routing outcome, to enable offline evaluation of classifier accuracy and drift detection over time.
Model choice matters here. Use a model with strong instruction-following and JSON mode support, such as GPT-4o, Claude 3.5 Sonnet, or a fine-tuned open-weight model if you have labeled edge-case data. Avoid smaller or older models that may collapse boundary_case and out_of_distribution into a single bucket or produce malformed JSON under pressure. If your application has strict latency requirements, deploy this classifier as an asynchronous pre-check that populates a review queue rather than blocking the user-facing response. Never allow an input classified as out_of_distribution to proceed to autonomous execution without human approval. For high-stakes domains such as healthcare, finance, or safety-critical operations, require explicit human sign-off on all boundary_case inputs as well, and log the reviewer's identity and timestamp alongside the classification record for audit purposes.
Expected Output Contract
Defines the structured output schema for the Novel Input Classifier. Use this contract to validate model responses before routing decisions are made.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
classification | enum: in_distribution | boundary_case | out_of_distribution | Must match exactly one of the three enum values. Reject any response with a different or misspelled label. | |
confidence_score | number (float 0.0-1.0) | Must be a valid float between 0.0 and 1.0 inclusive. Reject if null, non-numeric, or out of range. If confidence is below 0.6, classification should not be in_distribution. | |
rationale | string | Must be a non-empty string with at least 20 characters. Should explain the classification decision with reference to specific input features. | |
nearest_neighbor_context | array of strings | If present, each element must be a non-empty string. Array length should not exceed 5. Reject if any element is null or empty. Provide null if no similar known cases exist. | |
diagnostic_signals | object | Must be a valid JSON object with at least one key. Expected keys include: semantic_novelty, format_deviation, intent_ambiguity, and domain_shift. Each value must be a float 0.0-1.0. | |
recommended_action | enum: auto_process | flag_for_review | escalate_immediately | Must match exactly one of the three enum values. Reject any other value. boundary_case should map to flag_for_review; out_of_distribution should map to escalate_immediately. | |
escalation_priority | enum: low | medium | high | critical | Required only when recommended_action is flag_for_review or escalate_immediately. Must match one of the four enum values. Provide null when auto_process. | |
input_summary | string | Must be a non-empty string summarizing the input in 10-50 words. Reject if empty or exceeds 100 words. Used for review queue preview. |
Common Failure Modes
Novel input classifiers break in predictable ways. Here are the most common failure modes and how to guard against them before they reach your review queue.
Over-Classification of Benign Inputs
What to watch: The classifier flags common but slightly varied inputs as out-of-distribution, flooding the review queue with false positives. This happens when the prompt's boundary definition is too rigid or the in-distribution examples are too narrow. Guardrail: Calibrate with a holdout set of known benign inputs. Add explicit negative examples in the prompt showing inputs that look unusual but should remain in-distribution. Monitor the false positive rate daily.
Confidence Score Inflation
What to watch: The model assigns high confidence scores to wrong classifications, especially on adversarial or subtly shifted inputs. This causes novel cases to bypass review entirely. Guardrail: Require the model to output explicit reasoning before the confidence score. Implement a secondary check: if the nearest-neighbor distance exceeds a threshold, override the confidence and escalate regardless of the stated score.
Nearest-Neighbor Context Collapse
What to watch: The prompt asks for nearest-neighbor examples, but the model fabricates plausible-sounding neighbors instead of retrieving real ones, or selects neighbors that share surface features but not semantic meaning. Guardrail: Never rely on the model's internal knowledge for neighbors. Provide a pre-computed set of real reference examples in the prompt context and instruct the model to cite from that set only. Validate that cited neighbors exist in the provided list.
Taxonomy Drift in Production
What to watch: The classifier's boundary definitions become stale as user behavior, product features, or data distributions shift. Inputs that are now common get routed as novel, or genuinely new patterns get normalized into existing categories. Guardrail: Log all classification decisions with input embeddings. Run periodic distribution comparison against the baseline. Trigger a prompt review when the rate of boundary-case classifications changes by more than 20% week-over-week.
Diagnostic Context Omission
What to watch: The escalation payload includes the classification label and confidence score but omits the specific features, evidence, or reasoning that led to the decision. Human reviewers lack the context to act quickly and must re-investigate from scratch. Guardrail: Require a structured diagnostic block in the output schema that includes the top contributing signals, the closest in-distribution and out-of-distribution examples, and a one-sentence summary of why the input was classified as it was.
Adversarial Evasion via Surface Features
What to watch: Inputs crafted to mimic in-distribution surface patterns bypass the classifier while carrying novel or malicious intent. The model latches onto shallow lexical cues instead of semantic meaning. Guardrail: Include adversarial examples in the few-shot prompt that demonstrate surface-level similarity with semantic novelty. Pair the classifier with a separate semantic similarity check against known safe clusters. Route inputs that pass the classifier but fail the semantic check to a secondary review queue.
Evaluation Rubric
Use this rubric to test the Novel Input Classifier Prompt before routing real inputs to human review queues. Each criterion targets a specific failure mode in distribution classification and routing accuracy.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
In-Distribution Recall |
| Frequent false escalation of normal inputs to human review | Run against a golden set of 500+ known in-distribution examples from production logs |
Out-of-Distribution Recall |
| Novel inputs silently processed without escalation | Run against a curated set of 100+ known OOD examples including adversarial and drift cases |
Boundary-Case Precision |
| Review queue flooded with clearly in-distribution items labeled as boundary | Sample 200 boundary-case classifications and have 2+ human reviewers label ground truth |
Confidence Score Calibration | Mean confidence for correct classifications exceeds mean confidence for incorrect by >= 0.2 | High-confidence misclassifications with no uncertainty signal | Compare confidence score distributions for correct vs. incorrect classifications across 1000 test inputs |
Nearest-Neighbor Context Relevance |
| Nearest-neighbor examples mislead reviewers by pointing to wrong distribution | Human review of 100 escalation payloads checking if top-3 neighbors match true class |
Routing Destination Accuracy |
| Escalated items sent to wrong team or queue causing re-routing delays | Trace 200 escalated items through routing and verify destination against policy mapping |
Latency Under Load | Classification completes in < 500ms p95 at peak production volume | Timeout or queue buildup during traffic spikes | Load test with 2x peak production volume for 30 minutes and measure p95 latency |
Adversarial Input Handling | No adversarial input classified as in-distribution with confidence > 0.5 | Prompt injection or obfuscated input bypasses escalation | Run against a red-team set of 50+ known injection and obfuscation patterns |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Adapt This Prompt
How to adapt
Start with the base classifier prompt and a simple three-label taxonomy: IN_DISTRIBUTION, BOUNDARY_CASE, OUT_OF_DISTRIBUTION. Use a lightweight JSON output with only classification, confidence_score, and rationale fields. Skip nearest-neighbor retrieval and route everything above a single confidence threshold to a shared review channel.
codeClassify the following input as IN_DISTRIBUTION, BOUNDARY_CASE, or OUT_OF_DISTRIBUTION. Input: [USER_INPUT] Reference distribution description: [DISTRIBUTION_DESCRIPTION] Return JSON with classification, confidence_score (0-1), and rationale.
Watch for
- Overly broad
IN_DISTRIBUTIONclassifications when the reference description is vague - Confidence scores that don't correlate with actual novelty (model may be overconfident on OOD inputs)
- No baseline comparison window, so drift detection is subjective

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.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us