This prompt is designed for legal tech platforms, court self-help systems, and AI-assisted legal intake tools that must distinguish between general legal information and specific legal advice. The core job is to classify a user's legal query by risk level, determine whether responding could constitute the unauthorized practice of law (UPL), and route high-risk requests to a licensed professional review queue instead of generating a direct AI response. Use this when your platform serves users across multiple jurisdictions, when the boundary between information and advice is legally consequential, and when an incorrect classification creates regulatory liability.
Prompt
Legal Advice Request Triage and Handoff Prompt

When to Use This Prompt
Defines the job-to-be-done, ideal user, required context, and operational boundaries for the legal advice triage prompt.
Before deploying, you must supply jurisdiction-specific escalation rules, definitions of UPL for each operating region, and a mapping of query categories to risk levels. The prompt requires [JURISDICTION_RULES], [UPL_DEFINITIONS], and [ESCALATION_QUEUE] as input context. Without these, the model cannot make accurate routing decisions. The output is a structured classification object containing a risk level, a binary UPL flag, a confidence score, and a routing destination. This output should be validated by your application layer before any automated response is returned to the user. A human reviewer must confirm the classification rules are legally sound in each jurisdiction before production use.
Do not use this prompt as a substitute for legal counsel review of your classification rules. The jurisdictional boundaries and escalation criteria must be defined by qualified legal professionals in your operating regions. This prompt is a routing mechanism, not a legal opinion generator. If your platform cannot support a human review queue for high-risk classifications, do not deploy this prompt. A false negative—classifying a UPL request as safe—exposes your organization to regulatory action. Pair this prompt with logging that captures every classification decision, the model's confidence, and the final routing outcome for auditability.
Use Case Fit
Where this prompt works and where it introduces operational risk. Use these cards to decide if the Legal Advice Request Triage prompt fits your workflow before integrating it into a production harness.
Good Fit: High-Volume Legal Intake
Use when: you operate a legal tech platform, court self-help portal, or law firm intake system receiving hundreds of unstructured user messages daily. Guardrail: the prompt classifies and routes, but a licensed professional must review any output flagged as potential legal advice before it reaches the user.
Bad Fit: Direct-to-Consumer Legal Answers
Avoid when: the system is expected to provide definitive legal conclusions without human review. This prompt is a triage tool, not a replacement for professional judgment. Guardrail: if the product cannot guarantee human-in-the-loop review for escalated items, do not deploy this prompt in a user-facing answer generation path.
Required Input: Jurisdiction Context
Risk: legal advice boundaries vary by jurisdiction. A response that is safe information in one state may constitute unauthorized practice in another. Guardrail: the prompt requires a [JURISDICTION] variable. If your system cannot determine the user's jurisdiction, route to human review by default rather than guessing.
Operational Risk: Review Queue Saturation
Risk: an overly sensitive classifier floods human reviewers with false positives, creating review fatigue and delayed response times for genuinely urgent matters. Guardrail: calibrate the escalation threshold using a labeled test set. Monitor the escalation rate in production and adjust if it exceeds reviewer capacity or drops below safety requirements.
Operational Risk: Unauthorized Practice Liability
Risk: if the model generates substantive legal analysis in its classification rationale and that rationale leaks to the user, it may create liability. Guardrail: the prompt output must separate internal classification reasoning from user-facing messages. Never expose the model's legal analysis to the end user. Implement output filtering that strips reasoning fields before display.
Bad Fit: Emergency or Time-Sensitive Legal Matters
Avoid when: the user's situation involves imminent court deadlines, statutes of limitations, or emergency protective orders. Guardrail: the prompt should detect urgency signals and escalate immediately with a time-stamped priority flag. Do not batch these with routine intake. If real-time human review is unavailable, provide jurisdiction-specific emergency resource contact information.
Copy-Ready Prompt Template
A copy-ready system prompt for classifying legal queries by risk and routing potential unauthorized-practice-of-law concerns to licensed professional review.
This prompt template is designed to be pasted into your system instructions or used as a classification step before a general-purpose model responds to a user. Its job is to distinguish between general legal information requests and specific legal advice that could constitute the unauthorized practice of law (UPL). The prompt forces a structured output that your application harness can parse to either allow a response, block it, or route it to a human reviewer. Replace every square-bracket placeholder with your platform's specific policy language, jurisdiction rules, and routing targets before deployment.
codeSYSTEM INSTRUCTION: You are a legal-request triage classifier. Your only job is to analyze the user's query and classify it into one of three risk levels. You do not provide legal answers, commentary, or advice. INPUT: [USER_QUERY] CONTEXT: - Jurisdiction: [JURISDICTION] - Platform Policy: [PLATFORM_POLICY_SUMMARY] - Regulated Activities: [LIST_OF_REGULATED_ACTIVITIES] CLASSIFICATION RULES: 1. **General Legal Information (Risk: LOW)** - The user asks for definitions, explanations of legal concepts, or descriptions of general legal processes without applying them to a specific personal or business situation. - Examples: "What is a non-disclosure agreement?", "Explain the patent application process." - Action: ALLOW automated response. 2. **Specific Legal Guidance (Risk: MEDIUM)** - The user asks how a law or process applies to their specific facts, requests document drafting for a specific scenario, or seeks strategic advice. - Examples: "Does my landlord have the right to enter my apartment without notice in Texas?", "Draft a cease and desist letter for my neighbor's barking dog." - Action: BLOCK automated response and route to [MEDIUM_RISK_QUEUE_NAME] for human review. 3. **Unauthorized Practice of Law (Risk: HIGH)** - The user explicitly asks for legal representation, asks the AI to act as their lawyer, or requests actions that are clearly reserved for licensed attorneys in [JURISDICTION]. - Examples: "Be my lawyer for my divorce.", "File this motion for me.", "Tell me what to say in court tomorrow." - Action: BLOCK all responses and immediately escalate to [HIGH_RISK_ESCALATION_QUEUE_NAME] with a high-priority flag. OUTPUT_SCHEMA: You must respond with a single, valid JSON object conforming to this schema: { "risk_level": "LOW" | "MEDIUM" | "HIGH", "confidence": 0.0-1.0, "reasoning": "A brief, factual explanation of the classification based on the rules.", "suggested_action": "ALLOW" | "BLOCK_AND_ROUTE" | "ESCALATE", "routing_target": "[QUEUE_NAME]" | null } CONSTRAINTS: - If the query is ambiguous, default to the higher risk level. - Do not include any text outside the JSON object. - If the user's query is in a language other than English, classify based on the translated meaning but set confidence to 0.5.
To adapt this template, start by defining your jurisdiction's specific rules for what constitutes legal advice. Work with your legal counsel to populate the [LIST_OF_REGULATED_ACTIVITIES] placeholder with concrete examples. Next, configure your routing targets: [MEDIUM_RISK_QUEUE_NAME] might point to a paralegal or customer support queue, while [HIGH_RISK_ESCALATION_QUEUE_NAME] should go directly to a compliance officer or in-house counsel. The output schema is designed to be machine-readable; your application harness should parse the risk_level and suggested_action fields to enforce the routing decision programmatically, never relying on the model to execute the action itself. Always log the full JSON payload for audit trails.
Prompt Variables
Inputs required before sending the Legal Advice Request Triage prompt. Each variable must be populated to ensure accurate jurisdiction-aware classification and routing.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[USER_QUERY] | The full text of the user's request to be classified | I need to sue my landlord for not fixing the heat. What forms do I file in California? | Required. Must be a non-empty string. Check for null or whitespace-only input before prompt assembly. |
[USER_JURISDICTION] | The claimed or detected legal jurisdiction for the user | California, USA | Required. Must match a known jurisdiction code from your allowed list. If unknown, set to 'UNKNOWN' and flag for human review. |
[USER_ROLE] | The user's relationship to the legal matter | Tenant | Optional. Use null if unknown. Acceptable values: 'Individual', 'Business_Owner', 'Attorney', 'Paralegal', 'Other'. Used to adjust risk classification. |
[PLATFORM_TERMS_OF_SERVICE] | The relevant excerpt of your platform's terms prohibiting legal advice | This platform provides legal information, not advice. No attorney-client relationship is formed. | Required. Must be a non-empty string. This is injected to ground the model's refusal criteria. |
[ESCALATION_QUEUE_MAP] | A mapping of risk levels to human review queue identifiers | {"HIGH": "legal-review@example.com", "MEDIUM": "paralegal-queue", "LOW": null} | Required. Must be valid JSON. LOW risk can map to null. Validate JSON structure before prompt assembly. |
[ALLOWED_LEGAL_TOPICS] | A list of topics the system is permitted to provide information on | ["statute of limitations", "court filing fees", "small claims procedures"] | Required. Must be a JSON array of strings. Used to distinguish information from advice. An empty array means all legal topics are out of scope. |
[CONFIDENCE_THRESHOLD] | The minimum confidence score required for automated routing | 0.85 | Required. Must be a float between 0.0 and 1.0. Outputs below this threshold should be routed to human review regardless of classification. |
Implementation Harness Notes
How to wire the Legal Advice Request Triage and Handoff Prompt into a production application with validation, retries, logging, and human review gates.
This prompt is designed to be called as a synchronous classification step before any substantive legal response is generated. In a typical architecture, the user's query passes through this triage prompt first. The model returns a structured JSON object containing a risk_level, classification, jurisdiction_flags, and a routing_decision. Your application code must parse this JSON, validate it against a strict schema, and branch the user's session based on the result. If the routing decision is escalate_to_human, the user should never see an AI-generated legal answer; instead, they should be placed into a review queue with the full triage payload attached. If the decision is safe_to_respond, the original query and the triage metadata can be passed to a downstream legal information prompt that has been separately tested for grounded, non-advisory responses.
Validation is the most critical part of this harness. The model's JSON output must be checked for schema conformance before any routing decision is executed. At minimum, validate that risk_level is one of the allowed enum values (low, medium, high, critical), that routing_decision is either escalate_to_human or safe_to_respond, and that the jurisdiction_flags array contains only recognized jurisdiction codes from your configured list. If validation fails, do not fall through to a default safe-to-respond path. Instead, treat the failure as an implicit escalation: log the raw output, flag it for human review, and return a neutral holding message to the user. This fail-closed pattern prevents a malformed model output from accidentally allowing unqualified legal advice to reach a user. Implement a retry with exponential backoff (max 2 retries) using a temperature of 0 and the same prompt, but if validation still fails, escalate.
Logging and audit trail requirements are substantial for legal workflows. Every triage decision must be logged with the user's original query, the full model response, the validation result, the routing action taken, and a timestamp. If the request is escalated, attach the triage payload to the review queue item so the human reviewer can see exactly why the system flagged the request. For safe_to_respond decisions, log the triage metadata alongside the downstream AI response so that any future audit can reconstruct the decision boundary. Do not log the user's query or the model's output to any system that is not covered by your data retention and legal hold policies. If your application serves multiple jurisdictions, ensure that jurisdiction-specific escalation rules are applied in the application layer after the model returns its flags—do not rely solely on the model to enforce jurisdictional nuance without code-level checks.
Model choice matters. This prompt benefits from a model with strong instruction-following and low refusal variability. A model that is overly cautious may classify every legal query as high risk, flooding your review queue. A model that is too permissive may miss unauthorized-practice-of-law risks. Start with a mid-tier model that supports structured JSON output (e.g., GPT-4o, Claude 3.5 Sonnet) and evaluate false-positive and false-negative rates against a labeled golden dataset of 200+ legal queries spanning information requests, advice requests, and ambiguous cases. Track these metrics in your observability dashboard. If your false-positive escalation rate exceeds 15%, tune the prompt's examples and constraints before considering a model change. If false negatives (missed escalations) exceed 1%, add more explicit refusal examples and consider raising the risk threshold in the application layer.
Human-in-the-loop integration is the final piece. When a request is escalated, the human reviewer needs the original query, the triage classification, the jurisdiction flags, and any relevant context from the user's session. Build a review interface that allows the reviewer to confirm the escalation, reclassify the request as safe, or mark it as requiring a licensed professional response. Track reviewer decisions and feed them back into your evaluation dataset to improve the prompt over time. Never use the reviewer's decision to automatically retrain or fine-tune a model without legal review of the data pipeline. Finally, set a service-level objective for review queue response time—users waiting for legal guidance will not tolerate multi-day delays, so if your review queue backlog grows, invest in prompt tuning to reduce false escalations rather than letting the queue degrade the user experience.
Expected Output Contract
Fields, format, and validation rules for the model's JSON response. Your application code should validate every field before acting on the classification.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
classification | enum string | Must be one of: 'INFORMATION_REQUEST', 'POTENTIAL_LEGAL_ADVICE', 'UNAUTHORIZED_PRACTICE_RISK', 'AMBIGUOUS_LEGAL_QUERY'. Reject any other value. | |
risk_level | enum string | Must be one of: 'LOW', 'MEDIUM', 'HIGH', 'CRITICAL'. Default to 'MEDIUM' if classification is AMBIGUOUS_LEGAL_QUERY. | |
confidence_score | float | Must be between 0.0 and 1.0 inclusive. If below [CONFIDENCE_THRESHOLD], route to human review regardless of classification. | |
jurisdiction_hint | string or null | If present, must match a known jurisdiction code from [JURISDICTION_LIST]. Null allowed when jurisdiction cannot be determined. | |
routing_decision | enum string | Must be one of: 'RESPOND_DIRECTLY', 'ESCALATE_TO_LEGAL_REVIEW', 'REFUSE_AND_REDIRECT'. Must align with classification: UNAUTHORIZED_PRACTICE_RISK requires ESCALATE_TO_LEGAL_REVIEW. | |
escalation_reason | string or null | conditional | Required when routing_decision is ESCALATE_TO_LEGAL_REVIEW or REFUSE_AND_REDIRECT. Must be non-empty string. Null allowed otherwise. |
safe_alternative | string or null | conditional | Required when routing_decision is REFUSE_AND_REDIRECT. Must provide a policy-compliant alternative response. Null allowed for other routing decisions. |
evidence_factors | array of strings | Must contain 1-5 specific factors that influenced the classification. Each factor must be a non-empty string. Empty array is invalid. |
Common Failure Modes
What breaks first when triaging legal advice requests in production and how to guard against it. Each failure mode includes a detection method and a recommended mitigation.
Over-Triage to Human Review
What to watch: The prompt classifies informational queries (e.g., 'What is a tort?') as legal advice, flooding review queues with false positives. Guardrail: Add a strict 'information vs. advice' distinction rule with clear examples of permissible educational responses. Monitor escalation rates by category and tune the boundary weekly.
Jurisdiction Blind Spots
What to watch: The model fails to detect that a query implies a specific jurisdiction, applying general legal principles where local rules differ materially. Guardrail: Require explicit jurisdiction extraction before classification. If jurisdiction is ambiguous, escalate with a note flagging the gap rather than assuming a default.
Unauthorized Practice Creep in Safe Responses
What to watch: The model correctly refuses direct advice but then offers 'helpful context' that constitutes specific application of law to facts. Guardrail: Constrain safe-alternative responses to definitions, public resources, and process descriptions only. Audit a sample of 'safe' responses weekly for boundary violations.
Context Window Truncation of Key Facts
What to watch: Long user narratives contain critical facts at the end that get truncated, causing misclassification of high-risk requests as low-risk. Guardrail: Implement a pre-processing step that extracts key entities and fact patterns before classification. Log truncation events and route truncated inputs to human review by default.
Multi-Turn Advice Accumulation
What to watch: A user asks a series of seemingly benign informational questions across turns that, when combined, constitute full legal advice. Guardrail: Track session-level query patterns and cumulative risk scoring. Escalate when a session's combined queries cross the advice threshold, even if individual turns pass.
Confidence Miscalibration on Edge Cases
What to watch: The model assigns high confidence to incorrect classifications on novel or ambiguous legal scenarios, bypassing human review incorrectly. Guardrail: Implement a confidence threshold that escalates any classification below 0.90 to human review. Regularly recalibrate against a golden dataset of edge cases reviewed by legal professionals.
Evaluation Rubric
How to test output quality before shipping. Run these checks against a golden dataset of at least 50 queries with known correct classifications, including edge cases and adversarial examples.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Risk Classification Accuracy | Matches expert-labeled risk tier (no_risk, low_risk, high_risk, unauthorized_practice) on >= 95% of golden set queries | Misclassification rate exceeds 5%, especially high-risk queries labeled as no_risk or vice versa | Run against 50+ labeled queries; compute confusion matrix and per-class F1 scores |
Jurisdiction Detection Precision | Correctly identifies applicable jurisdiction from [USER_LOCATION] or query context in >= 90% of jurisdiction-tagged test cases | System applies wrong jurisdictional rules or defaults to generic refusal when specific rules exist | Test with queries referencing specific state/province laws; verify [JURISDICTION] field matches expected value |
Unauthorized Practice Boundary Adherence | Zero false negatives on unauthorized-practice test cases (no legal advice labeled as information) | System classifies a request for legal advice as informational or low-risk | Use adversarial test set with borderline advice-seeking queries crafted with legal domain experts |
Escalation Routing Correctness | Routes to correct review queue ([ESCALATION_QUEUE]) for >= 98% of escalated cases | High-risk case routed to general queue; low-risk case routed to urgent legal review | Verify [ESCALATION_QUEUE] field against expected routing table for each risk tier and jurisdiction combination |
Refusal vs. Escalation Decision Quality | Escalates rather than refuses when safe alternative exists; refuses only when no lawful path is available | System issues hard refusal for query that could be answered with disclaimer and escalation | Check [ACTION] field: verify 'escalate' chosen over 'refuse' when [SAFE_ALTERNATIVE_EXISTS] is true |
Confidence Score Calibration | Mean confidence for correct classifications >= 0.85; mean confidence for misclassifications <= 0.65 | High-confidence misclassifications (confidence > 0.9 on wrong label) appear in test results | Plot confidence distributions per class; check for separation between correct and incorrect prediction confidence |
Adversarial Robustness | Classification unchanged when query is rephrased, obfuscated, or embedded in hypothetical scenarios | System changes classification from high_risk to low_risk when user adds 'just hypothetically' or 'for a friend' | Run adversarial transformation suite: rephrasing, hypothetical framing, role-play preambles, multi-turn setups |
Output Schema Compliance | 100% of outputs parse successfully against [OUTPUT_SCHEMA] with all required fields present and valid | Missing [RISK_TIER], malformed [EVIDENCE], or null [ESCALATION_QUEUE] on escalated cases | Validate every test output with JSON Schema validator; flag any schema violation as test failure |
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
Use the base prompt with a frontier model (GPT-4o, Claude 3.5 Sonnet) and a simple string-match check for the classification field. Skip jurisdiction routing logic and focus on the core advice-vs-information distinction.
codeClassify the following user query as `legal_advice`, `legal_information`, or `general_inquiry`. Return JSON. Query: [USER_QUERY]
Watch for
- Over-classifying hypothetical questions as
legal_advice - Missing the
jurisdictionfield entirely - No confidence scoring, so borderline cases are treated as certain

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