Inferensys

Prompt

Regulated Domain Request Triage Prompt

A practical prompt playbook for classifying user requests that may cross into regulated territory and routing them to human review.
Developer doing prompt engineering on laptop, prompt variations visible on screen, casual coding session.
PROMPT PLAYBOOK

When to Use This Prompt

Defines the precise job-to-be-done, the ideal operator, and the critical boundaries for deploying the Regulated Domain Request Triage Prompt in a production AI system.

This prompt is a production guardrail for compliance engineers and platform operators who need a deterministic, auditable decision before a general-purpose model responds to a user. Its job is to classify whether a user request crosses into a regulated domain—specifically medical, legal, or financial advice—and to produce a structured triage decision that routes the request to either an automated safe-alternative flow or a human professional review queue. Use it when the cost of an unqualified AI response includes real legal liability, professional licensing violations, or regulatory penalty, not just brand risk. It is not a classifier for generic safety policy violations like hate speech or self-harm; those belong to a separate unsafe-request detection workflow.

The ideal operator is a compliance or trust-and-safety engineer integrating this prompt into an AI gateway, a model router, or a post-hoc audit pipeline. You need a defined regulated-domain policy that specifies what constitutes medical, legal, or financial advice in your jurisdiction and product context. The prompt requires a user request as input and expects a structured JSON output containing a binary classification, a risk level, a domain boundary analysis, and a routing instruction. Do not use this prompt if you lack a human review queue to receive escalations; routing to a dead letter queue creates a worse compliance posture than a well-engineered refusal. Do not use it to generate the actual regulated advice—even for testing—because the model may produce convincing but non-compliant content.

Before deploying, define your escalation path and test the prompt against a golden dataset of borderline requests that sit near your policy boundaries. Common failure modes include over-classifying benign informational questions as regulated advice and under-classifying indirect requests that imply a need for professional judgment. Wire the output into a decision harness that logs every triage result, measures the false-positive escalation rate against your review team's capacity, and feeds ambiguous cases back into policy clarification. The next step after reading this section is to review the prompt template and adapt its domain boundary definitions to your specific regulatory context.

PRACTICAL GUARDRAILS

Use Case Fit

Where this prompt works and where it creates risk. Use it to gate regulated-domain requests before a model attempts a substantive response.

01

Good Fit: Pre-Response Triage

Use when: you need to classify a user request before the main model generates a response. Guardrail: Run this prompt as a lightweight upstream classifier. Route to a specialized prompt or human queue based on the output label, not the raw model reply.

02

Bad Fit: Standalone Advice

Avoid when: you expect the prompt to decide whether advice is correct. This prompt classifies the request type, not the answer quality. Guardrail: Never use the output of this prompt as a substitute for professional review. It is a router, not an auditor.

03

Required Input: Domain Boundary Definitions

Risk: Without clear definitions of what crosses into medical, legal, or financial advice, the model will apply its own fuzzy boundaries. Guardrail: Provide a structured [DOMAIN_BOUNDARIES] input with explicit examples of regulated and non-regulated requests for each domain you care about.

04

Required Input: Escalation Paths

Risk: A correct classification is useless if the system doesn't know where to send the request next. Guardrail: Map each output label to a concrete [ESCALATION_ROUTES] object specifying the target queue, reviewer role, and SLA. Test that every possible label has a route.

05

Operational Risk: Over-Triage

Risk: The model classifies benign informational questions as regulated advice, flooding human review queues and frustrating users. Guardrail: Track the false-positive rate by sampling triaged requests. Add counterexamples to [FEW_SHOT_EXAMPLES] for common over-triage patterns and set a review threshold.

06

Operational Risk: Boundary Drift

Risk: As your product or regulations change, the prompt's domain definitions become stale, causing systematic misclassification. Guardrail: Version your [DOMAIN_BOUNDARIES] input alongside the prompt. Run regression tests with known edge cases on every boundary update and every model change.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A reusable prompt template for classifying whether a user request crosses into a regulated domain requiring human professional review.

This prompt template is designed to be pasted directly into your system prompt, safety classifier, or an initial triage step in your AI application. It forces the model to act as a strict boundary classifier, not a subject-matter expert. The core job is to analyze the user's request against a defined set of regulated domain criteria and output a structured routing decision. The template uses square-bracket placeholders for all dynamic inputs, allowing you to adapt it to your specific compliance policies, risk tolerance, and review queue structure without rewriting the core logic.

text
You are a compliance triage classifier. Your only job is to analyze the following user request and determine if it crosses into a regulated domain that requires mandatory human professional review. Do not answer the user's request. Do not provide advice, information, or alternatives. Only classify and route.

## Regulated Domain Definitions
[DEFINITIONS]

## User Request
[INPUT]

## Classification Rules
1. If the request explicitly asks for professional advice, diagnosis, legal interpretation, or financial recommendations within a regulated domain, classify as `ROUTE_TO_HUMAN`.
2. If the request provides specific personal context (symptoms, legal situation, financial details) and asks for analysis or a course of action, classify as `ROUTE_TO_HUMAN`.
3. If the request asks for general educational information about a regulated topic without personal context or a request for application, classify as `SAFE_TO_RESPOND`.
4. If the request is ambiguous, default to `ROUTE_TO_HUMAN` with a `LOW_CONFIDENCE` flag.

## Output Schema
Return ONLY a valid JSON object with no other text:
{
  "classification": "ROUTE_TO_HUMAN" | "SAFE_TO_RESPOND",
  "confidence": "HIGH" | "MEDIUM" | "LOW",
  "regulated_domain": ["DOMAIN_NAME"] | [],
  "reasoning": "Brief, specific explanation citing the part of the request that triggered this classification.",
  "recommended_queue": ["QUEUE_NAME"] | []
}

## Constraints
- Do not generate any text outside the JSON object.
- If classification is `SAFE_TO_RESPOND`, `recommended_queue` must be an empty array.
- If confidence is `LOW`, classification must be `ROUTE_TO_HUMAN`.

To adapt this template for your production environment, start by populating the [DEFINITIONS] placeholder with precise, policy-aligned descriptions of each regulated domain you need to enforce. For example, define 'Medical Advice' as 'Requests that ask for diagnosis, treatment recommendations, or interpretation of symptoms for a specific individual.' Vague definitions cause inconsistent classification. Next, map the [QUEUE_NAME] values to actual routing targets in your system, such as 'legal_review_queue' or 'clinical_escalation_queue'. The output schema is designed for direct parsing by an application harness, so maintain the exact field names and enum values. Before deploying, run this prompt against a golden dataset of known safe and regulated requests to calibrate your confidence thresholds and ensure the LOW_CONFIDENCE default-to-escalate behavior is not generating an unmanageable review queue volume.

IMPLEMENTATION TABLE

Prompt Variables

Required inputs for the Regulated Domain Request Triage 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.

PlaceholderPurposeExampleValidation Notes

[USER_QUERY]

The full text of the user request to classify

Can I use this power of attorney form to transfer property in Florida without a lawyer?

Non-empty string check. Must not be truncated. Sanitize for embedded null bytes or control characters before insertion.

[DOMAIN_DEFINITIONS]

A structured map of regulated domains, their boundary criteria, and escalation rules

{"legal_advice": {"boundary": "Applying law to specific facts or recommending a course of legal action", "escalate_to": "legal_review_queue"}}

Parse as valid JSON. Confirm at least one domain definition exists. Each domain must have a non-empty boundary and escalate_to field.

[JURISDICTION]

The applicable legal or regulatory jurisdiction for the request context

US-FL | EU-GDPR | null

Must match an allowed jurisdiction code from the system registry. Use null only when jurisdiction is genuinely unknown and the prompt is designed to handle that case.

[ESCALATION_PATHS]

A map of available review queues, their SLAs, and required approval levels

{"legal_review_queue": {"sla_minutes": 30, "required_role": "licensed_attorney"}}

Parse as valid JSON. Each path must include sla_minutes as a positive integer and required_role as a non-empty string.

[CONFIDENCE_THRESHOLD]

The minimum classification confidence score below which the request is routed to human review

0.85

Must be a float between 0.0 and 1.0. Values below 0.7 produce high false-positive escalation rates. Values above 0.95 risk missed regulated requests.

[OUTPUT_SCHEMA]

The expected JSON schema for the triage decision output

{"type": "object", "properties": {"is_regulated": {"type": "boolean"}, "domain": {"type": "string"}, "confidence": {"type": "number"}, "escalation_path": {"type": "string"}, "rationale": {"type": "string"}}, "required": ["is_regulated", "domain", "confidence", "escalation_path", "rationale"]}

Must be valid JSON Schema draft-07 or later. Required fields must include is_regulated, domain, confidence, escalation_path, and rationale at minimum.

[FEW_SHOT_EXAMPLES]

Curated examples of user queries with correct triage labels for in-context learning

[{"query": "What is the statute of limitations for contract disputes in California?", "is_regulated": false, "domain": "none", "rationale": "General legal information request without application to specific facts"}]

Parse as valid JSON array. Each example must include query, is_regulated, domain, and rationale fields. Minimum 3 examples recommended for stable classification.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the Regulated Domain Request Triage Prompt into a production application with validation, routing, and human review.

This prompt is designed to sit at the boundary between user input and your core application logic. It should be invoked before any substantive model response is generated, acting as a synchronous classification gate. The ideal integration point is within an API middleware layer or a serverless function that intercepts every user message. The prompt's output is a structured JSON classification object, which your application must parse to decide the next step: allow the request to proceed to the main conversational or task model, block it with a safe refusal, or route it to a human review queue. Do not stream the triage prompt's output to the user; it is a control-plane decision, not a user-facing message.

Wiring the prompt into your application requires a strict contract. The prompt expects a [USER_QUERY] and a [DOMAIN_DEFINITIONS] object that maps regulated domains (e.g., medical, legal, financial) to boolean flags and jurisdictional notes. Your application must inject these at runtime. After the model responds, validate the output against a JSON schema that enforces the presence of classification, regulated_domain, confidence_score, and rationale fields. If validation fails, retry once with a repair prompt that includes the schema and the malformed output. If the retry also fails, default to the safest action: route to human review and log the failure as a critical error. For model choice, a fast, cost-effective model like GPT-4o-mini or Claude Haiku is sufficient for classification; reserve larger models for the downstream task that the triage prompt is protecting.

Routing logic must be implemented in application code, not in the prompt. Use the classification field to drive a switch statement: allowed requests proceed; refused requests trigger a safe-refusal response (potentially using a separate Refusal Style prompt); escalate requests are pushed to a review queue with the full triage output and session context attached. For escalate decisions, include a routing_target field in your application's internal payload—mapped from the prompt's regulated_domain output—to send the item to the correct legal, medical, or compliance review team. Log every triage decision, including the raw user input, the prompt version, the model response, and the routing outcome, to create an audit trail for compliance and prompt evaluation. Never log PII in plaintext unless required and secured.

Testing and evaluation must cover both safety and throughput. Build a golden dataset of 200+ queries spanning clear non-regulated requests, clear regulated requests, and ambiguous boundary cases. Measure precision and recall for each classification label, with a specific focus on false negatives (regulated requests misclassified as allowed). Set a minimum recall target of 0.99 for the regulated and escalate classes; a single miss here is a compliance incident. Also measure latency at the 95th percentile (p95) to ensure the triage step doesn't degrade user experience. If p95 latency exceeds 500ms, consider model distillation or caching common non-regulated query patterns. Run this evaluation suite as a gate in your CI/CD pipeline before any prompt or model change reaches production. The next step is to integrate the triage output with your downstream refusal and handoff prompts to create a complete safety flow.

IMPLEMENTATION TABLE

Expected Output Contract

Defines the exact JSON structure, field types, and validation rules for the triage classification output. Use this contract to build downstream routing logic, enforce schema compliance, and detect malformed or ambiguous responses before they reach a review queue.

Field or ElementType or FormatRequiredValidation Rule

classification

enum string

Must be exactly one of: regulated_domain, non_regulated, ambiguous, unsafe_request. No other values allowed.

regulated_domain_type

enum string or null

Required if classification is regulated_domain. Must be one of: medical, legal, financial, electoral, child_safety. Must be null for all other classifications.

risk_level

enum string

Must be one of: low, medium, high, critical. Critical is reserved for imminent harm, child safety, or regulated advice with high liability exposure.

confidence_score

float

Must be a number between 0.0 and 1.0 inclusive. Scores below 0.7 should trigger classification as ambiguous unless evidence is definitive.

escalation_required

boolean

Must be true if classification is regulated_domain or unsafe_request, or if risk_level is high or critical. Must be false if classification is non_regulated and risk_level is low.

routing_target

string

Must be a valid queue identifier: human_review_legal, human_review_medical, human_review_financial, human_review_safety, human_review_general, or null. Must be null only when escalation_required is false.

reasoning_summary

string

Must be a non-empty string under 300 characters. Must cite the specific policy boundary or domain indicator that triggered the classification. Must not contain PII from the user request.

safe_alternative_offered

boolean or null

Required if classification is regulated_domain or unsafe_request. Must be true if the response includes a redirection to compliant resources. Must be false if no safe alternative was provided. Must be null for non_regulated classifications.

PRACTICAL GUARDRAILS

Common Failure Modes

What breaks first when triaging requests in regulated domains and how to guard against it.

01

Over-Classification of Benign Queries

What to watch: The prompt flags general education questions, hypotheticals, or publicly available information as regulated advice, creating unnecessary review queues and user friction. Guardrail: Include explicit negative examples and a 'general information vs. specific advice' distinction in the classification schema. Test against a golden set of borderline educational queries.

02

Missing Jurisdictional Context

What to watch: The prompt classifies a request without considering that regulatory definitions vary by jurisdiction, leading to incorrect routing for users in different legal or licensing regions. Guardrail: Require jurisdiction as an input variable and include jurisdiction-specific boundary definitions in the prompt context. Route to human review when jurisdiction is unknown.

03

Prompt Injection via Hypothetical Framing

What to watch: Users embed regulated requests inside hypotheticals, role-play scenarios, or 'for a book I'm writing' framing to bypass classification. Guardrail: Add explicit instruction to classify the underlying request regardless of framing. Include adversarial examples in few-shot demonstrations that strip away narrative wrappers.

04

Confidence Drift on Edge Cases

What to watch: The model assigns high confidence to incorrect classifications when requests mix regulated and non-regulated elements, causing silent misrouting. Guardrail: Require a confidence score with every classification and route any score below a configurable threshold to human review. Log all low-confidence decisions for periodic audit.

05

Domain Boundary Creep

What to watch: Adjacent domains bleed into each other—financial advice gets classified as legal, or medical triage gets classified as general health information—because boundary definitions are too vague. Guardrail: Define each regulated domain with concrete inclusion and exclusion criteria. Use a multi-label classification that can flag cross-domain ambiguity for human review.

06

Liability Language Leakage

What to watch: The classification output or routing message inadvertently includes language that could be construed as the system providing regulated advice, creating liability before human review occurs. Guardrail: Strictly constrain the output schema to classification labels, confidence scores, and routing instructions only. Never allow the prompt to generate substantive response content in the triage step.

IMPLEMENTATION TABLE

Evaluation Rubric

Criteria for testing the Regulated Domain Request Triage Prompt before production deployment. Each row defines a pass standard, a failure signal, and a concrete test method.

CriterionPass StandardFailure SignalTest Method

Regulated domain classification accuracy

Correctly labels medical, legal, and financial requests as regulated when they request professional advice or analysis

Labels a request for professional medical diagnosis as non-regulated or labels a general health question as regulated

Run against a golden dataset of 50 labeled examples spanning clear regulated, clear non-regulated, and borderline requests; require >95% accuracy on clear cases

Non-regulated domain precision

Correctly labels general information requests, educational queries, and non-professional discussions as non-regulated

Over-classifies benign requests as regulated, such as flagging 'What is a 401k?' as regulated financial advice

Test with 30 common non-regulated queries from each domain; false positive rate must be below 5%

Boundary case handling

Routes ambiguous requests to human review with a confidence score below the configured threshold

Makes a high-confidence classification on a genuinely ambiguous request without flagging uncertainty

Inject 10 deliberately ambiguous requests; verify all receive confidence scores below 0.8 and trigger human review routing

Output schema compliance

Returns valid JSON matching the defined [OUTPUT_SCHEMA] with all required fields populated

Missing required fields, malformed JSON, or extra fields not in schema

Validate output with JSON Schema validator; reject any response that fails structural validation

Confidence score calibration

Confidence scores correlate with actual classification correctness; high-confidence predictions are accurate

High-confidence predictions (>0.9) are frequently wrong, indicating miscalibration

Bin predictions by confidence decile; verify that accuracy in the 0.9-1.0 bin exceeds 95%

Routing instruction correctness

Produces a valid routing target from the approved [ROUTING_TARGETS] list with appropriate priority level

Routes to an undefined target, omits priority, or assigns critical priority to a low-risk request

Check routing target against allowed enum values; verify priority level matches risk classification

Refusal language absence

Does not generate refusal text or user-facing disclaimers; only produces structured classification output

Output contains phrases like 'I cannot help with that' or 'Please consult a professional' in the classification fields

Scan output fields for refusal patterns using regex; flag any match as failure

Latency and token budget

Completes classification within 500ms and under 200 output tokens for standard requests

Exceeds 1000ms latency or generates verbose explanations beyond the structured output contract

Measure end-to-end response time and token count across 100 requests; P95 latency must be under 500ms

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Start with the base classification prompt and a simple JSON output schema. Use a single domain boundary list (e.g., medical only) and skip multi-turn session tracking. Test with 20-30 labeled examples covering clear in-domain, clear out-of-domain, and ambiguous cases.

Add a placeholder for the domain list:

code
[DOMAIN_BOUNDARIES]: medical_diagnosis, treatment_recommendation, drug_dosing

Watch for

  • Over-classification of general health questions as regulated
  • Missing the distinction between information and advice
  • No confidence scoring, so borderline cases get hard-routed incorrectly
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.