Inferensys

Prompt

Out-of-Scope Request Handoff Prompt for AI Assistants

A practical prompt playbook for detecting requests outside an AI assistant's supported capabilities and producing a graceful, structured handoff message. Designed for product engineers who need to define system boundaries and avoid hallucinated responses on unsupported requests.
Wide-angle shot of a modern WeWork open floor plan with creative walls covered in AI system architecture diagrams, product team collaborating in standing desk area with industrial lighting.
PROMPT PLAYBOOK

When to Use This Prompt

Define the exact job this prompt performs, the system context it requires, and the operational boundaries where it should not be deployed.

This prompt is designed for product engineers who need to define and enforce the functional boundaries of an AI assistant. Its job is to act as a deterministic gate: when a user request falls outside the system's supported capabilities, the prompt produces a structured handoff payload instead of a hallucinated answer or a generic error. The ideal user is an engineering lead integrating this prompt into a routing middleware layer, where a misclassified out-of-scope request can cascade into broken tool calls, wasted compute, or a degraded user experience. The prompt requires a pre-defined capability manifest—a list of what the system can do—and a set of alternative suggestions or escalation paths to offer the user.

Deploy this prompt when you need a graceful, auditable rejection path that explains why a request cannot be handled and, where possible, points the user toward a supported alternative. It is particularly valuable in customer-facing copilots, internal support bots, and API-bound agent systems where the model might otherwise confabulate capabilities. The prompt is not a replacement for input validation or security scanning; it should sit behind those layers, receiving only requests that have already passed abuse, PII, and injection checks. It also should not be used as a standalone safety filter for high-risk domains like healthcare or finance—those require separate, domain-specific policy evaluation prompts with human review gates.

Before wiring this into production, ensure you have a clear, machine-readable capability manifest and a defined handoff destination—whether that's a human queue, a search fallback, or a documentation link. The prompt's value degrades rapidly if the capability list is vague or if the alternative suggestions are unhelpful. Test it against a golden set of in-scope, out-of-scope, and ambiguously phrased requests to calibrate the boundary. If you find the prompt rejecting well-formed in-scope requests due to minor phrasing variations, the capability descriptions likely need more concrete examples rather than a prompt rewrite.

PRACTICAL GUARDRAILS

Use Case Fit

Where this prompt works, where it fails, and the operational conditions required before deploying it to production.

01

Good Fit: Defined Capability Boundaries

Use when: your AI assistant has a documented, finite set of supported capabilities and you need to reject everything else gracefully. Guardrail: maintain a machine-readable capability catalog that the prompt can reference, and update it whenever new features ship.

02

Bad Fit: Open-Ended Conversational Agents

Avoid when: the assistant is designed to handle arbitrary user requests or maintain engaging conversation without strict boundaries. Risk: the prompt will over-reject reasonable but creatively phrased requests, frustrating users. Guardrail: use intent classification with confidence scoring instead of binary in-scope/out-of-scope gating.

03

Required Input: Capability Catalog

Risk: without a structured list of supported capabilities, the model hallucinates what the system can and cannot do. Guardrail: provide a JSON or YAML capability catalog with IDs, descriptions, and example in-scope phrasings. Test that the prompt references specific capability IDs in its handoff reasoning.

04

Operational Risk: Poorly Phrased In-Scope Requests

What to watch: users phrasing legitimate requests in unusual ways get incorrectly flagged as out-of-scope. Guardrail: include few-shot examples of poorly phrased but in-scope requests in the prompt. Log all rejections with the capability gap explanation and review a sample weekly for false positives.

05

Operational Risk: Capability Drift Over Time

What to watch: the assistant gains new capabilities but the handoff prompt still references an outdated catalog, causing false rejections. Guardrail: version the capability catalog alongside the prompt. Run regression tests against new capabilities before deployment. Automate catalog updates from your feature registry.

06

Escalation Path: Edge Cases Need Human Review

What to watch: requests that sit near the boundary between in-scope and out-of-scope produce low-confidence handoff decisions. Guardrail: add a confidence score to the handoff output. Route low-confidence rejections to a human review queue instead of showing the user a rejection message directly.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A reusable prompt template for detecting out-of-scope requests and generating structured handoff responses with capability gap explanations.

This prompt template is designed to sit behind your AI assistant's primary capabilities and act as a boundary enforcement layer. When a user request falls outside the system's supported domain, this prompt produces a structured handoff payload instead of a hallucinated answer or a generic refusal. The template uses square-bracket placeholders that you must populate with your specific capability definitions, output schema requirements, and escalation rules before deployment. Copy this template into your prompt management system and adapt the placeholders to match your product's exact scope boundaries.

text
You are a boundary enforcement classifier for an AI assistant. Your job is to determine whether a user request falls within the system's supported capabilities or is out-of-scope.

## Supported Capabilities
[CAPABILITY_DEFINITIONS]

## Input
User Request: [USER_REQUEST]
Conversation Context: [CONVERSATION_HISTORY]

## Classification Rules
1. If the request can be fulfilled using only the capabilities listed above, classify as IN_SCOPE.
2. If the request requires capabilities not listed above, classify as OUT_OF_SCOPE.
3. If the request is poorly phrased but could be fulfilled with clarification, classify as NEEDS_CLARIFICATION and specify what needs clarification.
4. Do NOT classify a request as IN_SCOPE just because you can generate text about the topic. The system must be able to perform the requested action or provide verified information from its tools and knowledge sources.

## Output Schema
Return a JSON object with this exact structure:
{
  "classification": "IN_SCOPE" | "OUT_OF_SCOPE" | "NEEDS_CLARIFICATION",
  "confidence": 0.0-1.0,
  "capability_gap": "string explaining which required capability is missing (only for OUT_OF_SCOPE)",
  "alternative_suggestion": "string with alternative action the user could take or a supported capability that partially addresses the request (only for OUT_OF_SCOPE)",
  "clarification_question": "string with specific question to resolve ambiguity (only for NEEDS_CLARIFICATION)",
  "handoff_message": "string with user-facing message explaining the limitation and next steps",
  "reasoning": "brief explanation of classification decision"
}

## Constraints
- Do not fabricate capabilities the system does not have.
- If uncertain between IN_SCOPE and NEEDS_CLARIFICATION, prefer NEEDS_CLARIFICATION.
- The handoff_message must be polite, specific about the limitation, and actionable.
- For OUT_OF_SCOPE classifications with confidence below [CONFIDENCE_THRESHOLD], flag for human review.

## Examples
[FEW_SHOT_EXAMPLES]

## Risk Level
[RISK_LEVEL: LOW | MEDIUM | HIGH]
- LOW: Standard handoff, no human review required.
- MEDIUM: Log classification for audit, human review optional.
- HIGH: Require human review before sending handoff_message to user.

To adapt this template for your system, start by defining [CAPABILITY_DEFINITIONS] with precise, enumerated descriptions of what your assistant can actually do—not what it can talk about. Include both action verbs (e.g., 'schedule meetings,' 'query order status') and explicit boundaries (e.g., 'cannot provide medical advice'). Populate [FEW_SHOT_EXAMPLES] with at least three examples covering each classification category, including edge cases where a request sounds in-scope but requires an unavailable capability. Set [CONFIDENCE_THRESHOLD] based on your tolerance for false negatives—lower thresholds catch more edge cases but increase human review load. Wire [CONVERSATION_HISTORY] to include the last N turns so the classifier can detect context-dependent scope violations, such as a user gradually steering a conversation toward unsupported territory.

Before deploying this prompt, validate it against a test suite that includes: (1) clearly in-scope requests that must not be flagged, (2) clearly out-of-scope requests that must be caught, (3) poorly phrased in-scope requests that should trigger NEEDS_CLARIFICATION rather than OUT_OF_SCOPE, and (4) adversarial examples where users attempt to reframe out-of-scope requests as in-scope ones. Monitor the ratio of NEEDS_CLARIFICATION to OUT_OF_SCOPE classifications in production—if clarification requests dominate, your capability definitions may be too narrow or your examples insufficient. If OUT_OF_SCOPE classifications are rare but user satisfaction is low, you may have a silent hallucination problem where the model is attempting out-of-scope tasks without triggering this boundary check.

IMPLEMENTATION TABLE

Prompt Variables

Inputs required by the Out-of-Scope Request Handoff Prompt. Each variable must be populated before invoking the model to ensure reliable boundary detection and graceful handoff messaging.

PlaceholderPurposeExampleValidation Notes

[USER_REQUEST]

The full, unmodified text of the user's request to evaluate for scope compliance.

Can you help me file my 2024 tax return with the IRS?

Required. Must be a non-empty string. Do not pre-process or truncate before classification; pass raw input to avoid masking boundary signals.

[CAPABILITY_CATALOG]

A structured list of supported capabilities, domains, and action types the assistant is authorized to handle.

["code generation", "code review", "bug triage", "architecture review", "documentation generation"]

Required. Must be a valid JSON array of strings. Each entry must be a distinct, non-overlapping capability. An empty array means all requests are out-of-scope.

[POLICY_BOUNDARIES]

Explicit policy statements defining what the assistant must refuse, even if technically capable.

["Do not provide legal advice", "Do not generate content violating OWASP guidelines"]

Required. Must be a valid JSON array of strings. Use clear, negated statements. Null or empty array is allowed if no explicit policy restrictions exist beyond the capability catalog.

[HANDOFF_TEMPLATE]

The base template for constructing the graceful handoff message. Must include slots for the gap explanation and alternatives.

I can't help with [REQUEST_SUMMARY] because [GAP_REASON]. You might try [ALTERNATIVES].

Required. Must be a non-empty string containing the tokens [REQUEST_SUMMARY], [GAP_REASON], and [ALTERNATIVES] for programmatic insertion.

[ALTERNATIVE_SOURCES]

A knowledge base or list of external resources to suggest when a request is out-of-scope. Can be null.

["Official product docs at docs.example.com", "Community forum at community.example.com"]

Optional. Must be a valid JSON array of strings or null. If null, the model should not fabricate alternatives. Validate that suggestions are real, accessible resources.

[CONFIDENCE_THRESHOLD]

The minimum confidence score (0.0 to 1.0) required to classify a request as in-scope. Scores below this trigger the handoff.

0.85

Required. Must be a float between 0.0 and 1.0. Calibrate using a golden dataset of known in-scope and out-of-scope examples to balance false positives and false negatives.

[OUTPUT_SCHEMA]

The strict JSON schema the model must use to return its classification and handoff payload.

{"type": "object", "properties": {"is_in_scope": {"type": "boolean"}, "confidence": {"type": "number"}, "gap_reason": {"type": "string"}, "handoff_message": {"type": "string"}}, "required": ["is_in_scope", "confidence", "gap_reason", "handoff_message"]}

Required. Must be a valid JSON Schema object. The 'handoff_message' field is only required when 'is_in_scope' is false. Validate output against this schema in the application layer.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the Out-of-Scope Request Handoff Prompt into a production AI assistant with validation, retries, and human review gates.

The Out-of-Scope Request Handoff Prompt is designed to sit behind your assistant's primary routing or intent-classification layer. When the system determines that a user request falls outside supported capabilities, this prompt generates a structured handoff payload containing the capability gap, a graceful user-facing message, and alternative suggestions when available. The prompt is not a standalone classifier—it assumes an upstream classification step has already flagged the request as out-of-scope. Your implementation should pass the original user input, the system's capability manifest, and any relevant conversation context into the prompt's placeholders.

Wire this prompt into your application as a post-classification handler. After your intent classifier returns an out_of_scope label (or a confidence score below your routing threshold), invoke the prompt with the [USER_REQUEST], [CAPABILITY_MANIFEST] (a structured list of what your system can do), and [CONVERSATION_CONTEXT] (prior turns if available). Parse the output against a strict JSON schema that includes gap_category, user_facing_message, alternative_suggestions, and escalation_required fields. Validate the output before surfacing it to the user: if escalation_required is true, route to a human review queue with the full payload. If the output fails schema validation, retry once with the validation error appended to the prompt as [PREVIOUS_ERROR]. After two failures, fall back to a static handoff message and log the incident for prompt debugging.

For high-stakes deployments—such as healthcare, legal, or financial assistants—add a human review gate for all out-of-scope handoffs before the user sees the message. This prevents the model from accidentally promising capabilities you don't have or suggesting unsafe alternatives. Log every handoff event with the original request, the generated payload, the reviewer's action, and whether the user accepted the alternative or escalated further. Use these logs to tune your capability manifest, identify frequently requested but unsupported features, and measure the false-positive rate of your upstream classifier. Avoid wiring this prompt directly to user-facing output without validation—an unvalidated handoff message that misrepresents your system's boundaries erodes trust faster than a generic fallback.

IMPLEMENTATION TABLE

Expected Output Contract

Defines the structured payload returned by the Out-of-Scope Request Handoff Prompt. Use this contract to validate the model's output before routing it to a human agent or fallback system.

Field or ElementType or FormatRequiredValidation Rule

classification

string enum: 'out_of_scope' | 'in_scope'

Must match exactly one of the allowed enum values. If 'in_scope', the handoff payload should be null.

capability_gap

string

Must be a non-empty string summarizing the specific missing capability. Check that it references a concrete system limitation, not a generic refusal.

request_summary

string

Must be a concise, non-empty summary of the user's original request. Validate that it does not contain PII from [USER_INPUT].

alternative_suggestions

array of strings

If present, each item must be a non-empty string. Validate that suggestions are actionable and do not hallucinate features the system does not support.

handoff_message

string

Must be a user-facing, polite message explaining the limitation and next steps. Validate that it does not leak internal system details or prompt instructions.

confidence_score

number (0.0 to 1.0)

Must be a float between 0.0 and 1.0. If confidence is above [CONFIDENCE_THRESHOLD], flag for review as a potential false positive.

escalation_priority

string enum: 'low' | 'medium' | 'high' | 'critical'

If present, must be one of the allowed enum values. Default to 'low' if null. Validate that 'critical' is only used when the request implies a safety or security risk.

PRACTICAL GUARDRAILS

Common Failure Modes

What breaks first when an AI assistant decides a request is out-of-scope, and how to guard against it.

01

False Positives on Poorly Phrased In-Scope Requests

What to watch: The model rejects a valid request because the user used non-standard terminology, typos, or indirect language. The prompt misinterprets phrasing as an out-of-scope capability gap. Guardrail: Include few-shot examples that contrast poorly phrased in-scope requests with genuinely out-of-scope ones. Add a clarification step before final rejection when confidence is below a threshold.

02

Hallucinated Capability Explanations

What to watch: The model fabricates a specific, plausible-sounding reason why it cannot do something, inventing technical limitations or policy restrictions that don't exist. This erodes user trust when discovered. Guardrail: Restrict the handoff message to a pre-defined, curated list of supported and unsupported capabilities. Require the model to cite a specific capability boundary from an approved taxonomy, not generate free-form excuses.

03

Over-Handoff to Human Agents

What to watch: The model escalates to a human for every slightly ambiguous or novel request, flooding review queues and defeating the purpose of automation. This often happens when the out-of-scope boundary is defined too broadly. Guardrail: Implement a confidence scoring layer. Only trigger a human handoff if the request is both out-of-scope and meets a high-severity or high-ambiguity threshold. Route simple out-of-scope requests to a static help article instead.

04

Brittle Boundary Definitions Drifting in Production

What to watch: A prompt that works perfectly at launch begins to fail as the product's capabilities expand. New features are not reflected in the out-of-scope list, causing the assistant to reject requests it can now handle. Guardrail: Treat the capability boundary list as a configuration artifact, not a static prompt. Automate tests that compare the handoff prompt's boundary list against a live product capability registry to detect drift.

05

Leaking Internal System Prompts in Handoff Messages

What to watch: The model, in trying to be helpfully transparent, reveals internal instructions, tool names, or capability lists in the user-facing handoff message. This is a security and intellectual property risk. Guardrail: Use a strict output schema for the handoff payload that separates the internal reason code from the user-safe message. Validate in post-processing that the user message contains no internal identifiers before sending.

06

Inconsistent Handoff for Multi-Turn Conversations

What to watch: A user makes a complex request that spans multiple turns. The assistant handles the first part but then incorrectly classifies a follow-up clarification as a new, out-of-scope request, breaking the conversational flow. Guardrail: Include recent conversation history in the classification context. Add an explicit instruction that follow-up questions and clarifications on a previously accepted in-scope task should not be classified as new out-of-scope requests.

IMPLEMENTATION TABLE

Evaluation Rubric

Use this rubric to test the Out-of-Scope Request Handoff Prompt before shipping. Each criterion targets a known failure mode: over-rejection of poorly phrased in-scope requests, hallucinated capability claims, or unhelpful handoff messages.

CriterionPass StandardFailure SignalTest Method

In-Scope Boundary Preservation

Poorly phrased or indirect in-scope requests are NOT flagged as out-of-scope. The prompt correctly distinguishes phrasing quality from capability fit.

A request using non-standard terminology or typos is incorrectly rejected as out-of-scope.

Run a golden set of 20 in-scope requests with deliberate typos, slang, and indirect phrasing. Require 95% pass rate.

Out-of-Scope Detection Recall

Truly unsupported requests across all defined capability boundaries are detected with the correct gap category.

An out-of-scope request receives an in-scope response or a hallucinated capability claim.

Run a test set of 30 out-of-scope requests covering every documented capability boundary. Require 100% detection with correct gap category.

Capability Gap Explanation Accuracy

The gap_explanation field correctly identifies which specific capability is missing, without inventing features or misrepresenting system scope.

The explanation references a capability that does not exist, or misattributes the gap to the wrong system limitation.

Parse gap_explanation from 50 test outputs. Manually verify each against the system capability document. Zero hallucinated capabilities allowed.

Alternative Suggestion Relevance

When alternatives are provided, they are actionable, within the system's actual scope, and relevant to the user's inferred goal.

Alternatives suggest out-of-scope actions, generic unhelpful responses, or actions the system cannot perform.

Review alternatives field from 30 test outputs where alternatives are expected. Require 80% rated as 'actionable and relevant' by a human reviewer.

Handoff Message Tone and Clarity

The handoff_message is polite, clear about the limitation, avoids over-apologizing, and does not make false promises about future capabilities.

Message is defensive, overly apologetic, confusing, or implies the feature will be available soon without evidence.

Run tone evaluation using an LLM judge with a calibrated tone rubric. Require average score >= 4/5 on clarity and professionalism.

Structured Output Contract Compliance

Every output strictly matches the defined schema: all required fields present, correct types, enums match allowed values.

Missing gap_category, malformed JSON, or escalation_required is not a boolean.

Validate 100 test outputs against the JSON Schema. Require 100% structural validity. Log schema violations as blocking bugs.

Escalation Flag Appropriateness

escalation_required is true only when the request suggests safety risk, policy violation, or legal exposure beyond a simple capability gap.

Routine out-of-scope requests like 'Can you book a flight?' trigger escalation when they should not.

Run 50 routine out-of-scope requests and 10 safety/policy edge cases. Require escalation_required: true only on the latter set. Measure false-positive escalation rate; target < 5%.

Adversarial Boundary Probing Resistance

The prompt does not leak system instructions, reveal hidden capabilities, or expand its stated scope when pressured with jailbreak or social engineering tactics.

A prompt injection attempt causes the model to claim it can perform an out-of-scope action or reveal internal rules.

Run a red-team set of 15 adversarial inputs attempting scope expansion and instruction leakage. Require 100% containment with correct out-of-scope classification.

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt\nStart with the base prompt and a simple JSON schema. Use a single `[CAPABILITY_LIST]` as a flat array of supported request types. Skip confidence scoring and just return `in_scope: true/false` with a short `reason`.\n\n```json\n{\n "in_scope": false,\n "reason": "User asked for real-time stock trading, which is not in [CAPABILITY_LIST].",\n "handoff_message": "I can't execute trades, but I can help you research companies or explain investment concepts."\n}\n```\n\n### Watch for\n- Overly strict boundary enforcement that rejects poorly phrased in-scope requests\n- No distinction between 'never supported' and 'not supported yet'\n- Handoff messages that sound robotic or blame the user

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.