This prompt is for platform engineers building SaaS routing middleware that must classify a customer's account tier from structured or semi-structured metadata. It ingests account fields, contract snippets, or entitlement payloads and returns a normalized tier label with a confidence score. Use it when downstream workflows, queue assignments, feature gates, or SLA enforcement depend on accurate tier detection, and when tier signals are spread across CRM fields, contract text, support entitlements, and provisioning metadata rather than residing in a single clean database field.
Prompt
Account Tier Detection Prompt Template

When to Use This Prompt
Determine if the Account Tier Detection Prompt is the right tool for your routing middleware versus a deterministic rules engine or alternative classification approach.
The ideal user is an infrastructure or platform engineer who has already attempted deterministic tier resolution and found it brittle. Common triggers include: account tier stored inconsistently across systems acquired through mergers, tier encoded in human-readable contract language rather than machine-readable fields, entitlement data that requires interpretation of legal or commercial terms, or environments where the canonical account database is known to be stale or untrusted. In these cases, an LLM-based classifier can normalize messy, multi-source signals into a structured output that downstream systems can consume reliably.
Do not use this prompt when account tier is stored in a single, well-maintained database field with strong data governance. A deterministic lookup or simple rules engine will be faster, cheaper, and more auditable. Similarly, avoid this prompt for real-time latency-sensitive paths where sub-100ms responses are required unless you have validated that your model serving infrastructure meets those targets. For high-throughput streaming pipelines, batch the classification step or use a cached tier resolution layer that re-evaluates only when account metadata changes.
This prompt is also not a replacement for contract review or legal interpretation of entitlements. It classifies tier from available signals but does not resolve contractual disputes or interpret novel legal language. When the prompt returns low confidence or conflicting signals, the correct next step is escalation to a human reviewer or a manual override queue, not blind acceptance of the model's best guess. Wire the confidence score into your routing logic with explicit thresholds: high-confidence results can route automatically, medium-confidence results should log for audit, and low-confidence results must trigger human review before any SLA-bound action is taken.
Use Case Fit
Where the Account Tier Detection Prompt works, where it breaks, and the operational preconditions required before wiring it into a production routing middleware.
Strong Fit: Deterministic Tier Extraction
Use when: account metadata is structured, complete, and contains explicit tier fields (e.g., account_tier: enterprise, support_level: premium). The prompt reliably normalizes known labels into a canonical tier enum. Guardrail: validate input schema before prompt invocation; reject requests with missing required fields rather than asking the model to guess.
Weak Fit: Ambiguous or Implicit Tier Signals
Avoid when: tier must be inferred from indirect signals like usage volume, support history, or sentiment. The prompt is not designed for probabilistic inference from behavioral data. Guardrail: route ambiguous cases to a separate scoring prompt or a human review queue rather than forcing a tier decision from weak evidence.
Required Inputs: Structured Account Context
What to watch: the prompt depends on pre-resolved account fields such as contract tier, support plan, or entitlement flags. If these fields are missing, stale, or conflicting, the output will be unreliable. Guardrail: implement a pre-fetch layer that gathers account context from the source of truth and validates field presence before prompt assembly.
Operational Risk: Tier Misclassification
What to watch: a misclassified enterprise account routed to a self-service queue creates SLA breaches and customer escalation. A misclassified freemium account routed to premium support wastes expensive resources. Guardrail: add a confidence threshold check; if the model's confidence is below the threshold, fall back to a default tier or escalate to a human reviewer.
Operational Risk: Missing Account Fallback
What to watch: requests arriving without any account context (e.g., unauthenticated users, deleted accounts, data sync failures) can produce hallucinated tiers or null-pointer errors downstream. Guardrail: define an explicit fallback tier (e.g., anonymous or unverified) and require the prompt to return it when account data is absent, with a distinct missing_account: true flag for observability.
Integration Risk: Stale or Cached Tier Data
What to watch: account tier changes (upgrades, downgrades, grace periods) may not propagate instantly to the context fed into the prompt, causing routing decisions based on outdated entitlements. Guardrail: include a tier_updated_at timestamp in the prompt context and compare it against the current time; if the data is older than the acceptable staleness window, trigger a refresh or fallback.
Copy-Ready Prompt Template
A production-ready prompt for extracting a normalized account tier from structured or unstructured account metadata.
This prompt template is designed to be pasted directly into your system instructions or a classification node within your routing middleware. It accepts account metadata, contract fields, or support entitlement strings and returns a normalized tier label with a confidence score. The prompt is structured to handle missing data gracefully, avoid hallucinating tiers, and produce output that downstream dispatch logic can consume without additional parsing.
textYou are an account tier classifier for a SaaS routing system. Your job is to read the provided account metadata and return exactly one normalized tier label with a confidence score. ## INPUT Account Metadata: [ACCOUNT_METADATA] ## TIER TAXONOMY Use ONLY the following tier labels: - enterprise - premium - standard - freemium - trial - partner - unknown ## CLASSIFICATION RULES 1. If the metadata contains explicit tier fields (e.g., "plan": "enterprise", "support_level": "premium"), use that value after normalizing it to the taxonomy above. 2. If multiple tier signals conflict, prefer the most recent contract or entitlement field and note the conflict in the evidence field. 3. If no tier information is present, return "unknown" with confidence 0.0. 4. If the account is in a downgrade grace period, classify as the higher of the current and previous tier and set the `grace_period` flag to true. 5. If the account is a child account in a hierarchy, resolve the effective tier from the parent if parent metadata is provided. Document the inheritance chain. 6. Do not infer tier from company name, employee count, or revenue unless those fields are explicitly labeled as tier determinants. ## OUTPUT SCHEMA Return ONLY valid JSON matching this schema: { "tier": "<normalized_tier_label>", "confidence": <float 0.0 to 1.0>, "evidence": ["<field_name>: <value>", ...], "grace_period": <boolean>, "inheritance_chain": ["<account_id>", ...] | null, "fallback_reason": "<reason if tier is unknown, else null>" } ## CONSTRAINTS - Do not return tiers outside the taxonomy. - If confidence is below 0.7, set tier to "unknown" and explain why in fallback_reason. - Never fabricate account metadata. Only use what is provided. - If the input is empty or malformed, return tier "unknown" with confidence 0.0 and fallback_reason "empty_or_malformed_input".
To adapt this template, replace [ACCOUNT_METADATA] with the actual payload from your account service, CRM, or contract store. The metadata can be a JSON object, a flattened string of key-value pairs, or a concatenation of relevant fields. Ensure the taxonomy labels match your internal routing constants exactly. If your system uses different tier names, update the taxonomy list and the normalization logic in the classification rules. The output schema is designed to be parsed by a downstream validator before any routing decision is made.
Before deploying, wire a post-processing validator that checks the returned tier against your allowed enum and rejects any response where confidence is below your operational threshold. Log every classification with the evidence array and fallback_reason to build an audit trail for misclassification debugging. For high-stakes routing—such as enterprise escalations or SLA-bound queues—require human review when confidence is below 0.85 or when grace_period is true. This prompt is a classification node, not a decision engine; the routing logic that consumes its output should own the final dispatch, retry, and escalation paths.
Prompt Variables
Required inputs for the Account Tier Detection Prompt. Each placeholder must be populated before the prompt is sent. Validation notes describe how to verify the input is well-formed and safe.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[ACCOUNT_METADATA] | Raw account record containing tier, contract, and entitlement fields | { "tier": "enterprise", "plan": "pro", "contract_start": "2024-01-01", "features": ["priority_support", "ssd_storage"] } | Must be valid JSON. Check for null or empty object. If missing, trigger missing-account fallback path. |
[REQUEST_CONTEXT] | The incoming customer request or support ticket content | "My dashboard is not loading and I need this fixed urgently. We have 500 users affected." | Must be a non-empty string. Truncate to 4000 tokens if longer. Check for PII before logging. |
[TIER_DEFINITIONS] | Mapping of tier labels to entitlement rules and SLA thresholds | { "enterprise": { "support_channel": "priority", "response_sla_hours": 1 }, "professional": { "support_channel": "standard", "response_sla_hours": 4 }, "free": { "support_channel": "community", "response_sla_hours": 72 } } | Must be valid JSON with at least one tier defined. Validate that each tier has required fields: support_channel, response_sla_hours. Missing definitions should abort routing. |
[CONTRACT_FIELD_MAP] | Field name mappings from account schema to tier-relevant fields | { "tier_field": "subscription_tier", "plan_field": "current_plan", "entitlements_field": "enabled_features", "contract_status_field": "contract_status" } | Must be valid JSON. All mapped fields must exist in [ACCOUNT_METADATA] schema. Missing field map entries should trigger a warning and fallback to default field names. |
[FALLBACK_TIER] | Default tier label when account metadata is missing or unparseable | "standard" | Must be a non-empty string matching one of the tier labels in [TIER_DEFINITIONS]. If not found in definitions, abort and escalate to human review. |
[CONFIDENCE_THRESHOLD] | Minimum confidence score required to auto-route without human review | 0.85 | Must be a float between 0.0 and 1.0. Values below 0.7 should force human review regardless of threshold setting. Validate as numeric before comparison. |
[GRACE_PERIOD_RULES] | Rules for handling accounts in downgrade grace periods or trial extensions | { "downgrade_grace_days": 30, "trial_extension_days": 14, "apply_grace_to_routing": true } | Must be valid JSON. If apply_grace_to_routing is true, validate that grace_days is a positive integer. Missing rules should default to no grace period. |
[OUTPUT_SCHEMA] | Expected JSON schema for the normalized tier output | { "effective_tier": "string", "confidence": "number", "source_field": "string", "grace_applied": "boolean", "routing_instructions": "string" } | Must be valid JSON Schema or example object. Validate that output from the prompt conforms to this schema before routing. Schema mismatch triggers output repair or retry. |
Implementation Harness Notes
How to wire the Account Tier Detection prompt into a production SaaS routing middleware with validation, fallback, and audit logging.
This prompt is designed to be called synchronously within a request processing pipeline—typically after authentication and before queue dispatch or tool authorization. The application layer should fetch the account object, contract metadata, and any support entitlement flags from your internal services, then inject them into the [ACCOUNT_METADATA] and [ENTITLEMENT_CONTEXT] placeholders. Do not pass raw database rows or unredacted PII; the prompt needs structured fields like plan_code, contract_tier, support_level, account_status, and entitlements_array. If your system uses a feature-flag service or a billing API to determine entitlements, resolve those flags first and pass the resolved boolean map rather than asking the model to interpret raw feature gate responses.
Wrap the LLM call in a thin service function that enforces a strict JSON schema on the output. The expected shape includes tier (enum: enterprise, premium, standard, freemium, trial, unknown), confidence (0.0–1.0), evidence_fields (array of field names used), and fallback_applied (boolean). Validate this schema immediately after the model responds. If parsing fails, retry once with a repair prompt that includes the raw output and the schema. If the retry also fails or returns tier: unknown with confidence below your threshold (we recommend 0.7 as a starting point), route the request to a human review queue and log the full prompt context and failed output for later diagnosis. For high-traffic systems, consider caching tier determinations per account ID with a short TTL (e.g., 5 minutes) to avoid redundant LLM calls on burst requests from the same customer.
Model choice matters here. This is a classification task with a constrained output schema, so a smaller, faster model (e.g., Claude Haiku, GPT-4o-mini, or a fine-tuned open-weight model) is usually sufficient. Reserve larger models for cases where the account metadata is messy, unstructured, or contains free-text contract notes that require reasoning. Instrument the call with latency and token-usage metrics, and set a timeout (500–800 ms is reasonable for synchronous routing). If the model exceeds the timeout, apply your configured fallback tier (typically the most restrictive tier the account could have based on cached data) and flag the request for async review. Log every routing decision with the account ID, determined tier, confidence, model used, latency, and whether a fallback was applied—this audit trail is essential for SLA compliance disputes and for tuning your confidence thresholds over time.
Expected Output Contract
Validate the normalized tier label and confidence score returned by the Account Tier Detection prompt before routing decisions are made downstream.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
tier_label | string (enum) | Must match one of the allowed tier values exactly: [TIER_LIST]. Case-sensitive check. | |
tier_confidence | float (0.0–1.0) | Must be a number between 0.0 and 1.0 inclusive. Reject if null or non-numeric. | |
matched_account_id | string | Must match the [ACCOUNT_ID] provided in the input context. Reject on mismatch. | |
matched_field_source | string | Must reference a valid field path from [ACCOUNT_METADATA_SCHEMA]. Reject if source is hallucinated. | |
fallback_reason | string or null | Required when tier_confidence < [CONFIDENCE_THRESHOLD]. Must be a non-empty string explaining ambiguity. | |
normalized_tier | string (enum) | Must be the canonical internal tier code (e.g., 'enterprise', 'premium', 'standard', 'trial', 'freemium'). Reject if raw contract language is returned instead of normalized code. | |
routing_instruction | string (enum) | Must be one of: 'route_premium', 'route_standard', 'route_trial', 'escalate_for_review'. Reject if instruction does not match the normalized_tier mapping. | |
audit_trail | array of objects | If present, each object must contain 'step' (string), 'evidence' (string), and 'timestamp' (ISO 8601). Reject if evidence field is empty or timestamp is invalid. |
Common Failure Modes
Account tier detection fails silently in production when edge cases hit. Here's what breaks first and how to guard against it.
Missing or Null Account Metadata
What to watch: The prompt receives an empty account object, null fields, or a user ID with no matching profile. The model hallucinates a tier instead of returning an unknown state. Guardrail: Add an explicit [UNKNOWN_ACCOUNT] fallback instruction in the prompt. Validate input completeness before model invocation and route missing-account cases to a human review queue.
Tier Misclassification from Ambiguous Signals
What to watch: An account has conflicting signals—enterprise contract fields but freemium usage patterns, or a trial flag alongside a paid subscription. The model picks one signal arbitrarily. Guardrail: Require the prompt to output a confidence score and a conflicting_signals array. Set a confidence threshold below which routing falls back to a conservative default tier and flags for manual review.
Silent Tier Downgrade on Partial Updates
What to watch: A downstream system updates only part of the account record, and the prompt reads stale or incomplete fields, producing a lower tier than the customer is entitled to. Guardrail: Include a data_freshness check in the prompt that inspects last_updated timestamps. If any required field is older than the SLA window, output tier: "INDETERMINATE" and route to a reconciliation workflow.
Parent-Child Hierarchy Inheritance Failures
What to watch: A child account inherits tier from a parent, but the prompt only inspects the child record and returns the wrong tier. Or the hierarchy is circular and the model loops. Guardrail: Explicitly instruct the prompt to traverse the hierarchy chain, cap traversal depth at a fixed limit, and output the effective_tier alongside the inheritance_chain for auditability. Reject circular references as INVALID_HIERARCHY.
Grace Period and Transition State Mishandling
What to watch: A customer is in a downgrade grace period or a trial-to-paid conversion window. The prompt applies the new tier immediately, revoking access prematurely. Guardrail: Add a transition_state field to the output schema. Instruct the prompt to check grace_period_end and effective_date fields and apply the higher-entitlement tier until the transition window closes.
Over-Confidence on Unseen Account Structures
What to watch: A custom enterprise contract uses bespoke fields or non-standard tier labels the prompt has never seen. The model maps them to the closest known tier with high confidence, producing a wrong routing decision. Guardrail: Include few-shot examples of UNRECOGNIZED_STRUCTURE outputs. Require the prompt to flag any field it cannot map to a known tier schema and output tier: "BESPOKE" with a requires_manual_review: true flag.
Evaluation Rubric
Use this rubric to test the Account Tier Detection prompt before shipping. Each criterion targets a known failure mode in production routing middleware.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Tier Label Normalization | Output matches one of the allowed enum values: [ENTERPRISE], [PREMIUM], [STANDARD], [BASIC], [TRIAL], [UNKNOWN]. No creative variations. | Output contains a non-standard label like 'Gold', 'Platinum', or 'Free'. | Schema validation against the tier enum. Run 50 varied account payloads and assert 100% enum compliance. |
Confidence Score Calibration | Confidence is a float between 0.0 and 1.0. Scores below 0.8 correlate with genuinely ambiguous or missing account metadata. | Confidence is always 0.99 or always 0.5 regardless of input quality. Score does not drop when [ACCOUNT_METADATA] is empty. | Inject 10 cases with missing fields and 10 with clear tier signals. Assert mean confidence for missing cases is below 0.7 and clear cases is above 0.9. |
Missing Account Fallback | When [ACCOUNT_METADATA] is null or empty, output tier is [UNKNOWN] with confidence below 0.5 and a non-null [FALLBACK_REASON]. | Prompt hallucinates a tier like [STANDARD] or returns null for [FALLBACK_REASON]. | Send a request with [ACCOUNT_METADATA] set to null. Assert tier equals [UNKNOWN] and [FALLBACK_REASON] is populated. |
Contract Field Priority | When both [SUPPORT_PLAN] and [CONTRACT_TIER] are present and conflict, the prompt uses [CONTRACT_TIER] as the source of truth. | Prompt oscillates between fields or returns a tier that matches neither field. | Provide a payload where [SUPPORT_PLAN] is 'Basic' and [CONTRACT_TIER] is 'Enterprise'. Assert output tier is [ENTERPRISE]. |
Trial Account Discrimination | Accounts with [TRIAL_EXPIRY] in the future or [BILLING_STATUS] equal to 'trialing' are classified as [TRIAL], not [BASIC] or [STANDARD]. | Trial accounts are misclassified as [BASIC] and routed to paid-only features. | Send a payload with [BILLING_STATUS] set to 'trialing'. Assert tier equals [TRIAL]. |
Grace Period Handling | When [TIER_EXPIRY] is in the past but [GRACE_PERIOD_DAYS] is non-zero and the current date falls within the grace window, the original tier is preserved. | Prompt immediately downgrades the tier on the expiry date, ignoring the grace period. | Set [TIER_EXPIRY] to yesterday, [GRACE_PERIOD_DAYS] to 7, and [CURRENT_DATE] to today. Assert tier matches the pre-expiry tier. |
Parent-Child Hierarchy Resolution | When [PARENT_ACCOUNT_TIER] is present and higher than [ACCOUNT_TIER], the effective tier is the parent tier. [EVIDENCE] field cites the inheritance chain. | Prompt ignores [PARENT_ACCOUNT_TIER] or returns the child tier without explanation. | Provide a child account with tier [BASIC] and a parent with tier [PREMIUM]. Assert effective tier is [PREMIUM] and [EVIDENCE] mentions the parent account. |
Output Schema Compliance | Response is valid JSON with all required fields: [TIER], [CONFIDENCE], [EVIDENCE], [FALLBACK_REASON]. No extra commentary outside the JSON object. | Response is a markdown-wrapped JSON block, plain text, or missing the [EVIDENCE] field. | Parse the raw model response with a JSON validator. Assert no parse errors and all required keys are present across 100 test cases. |
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 single model call and minimal validation. Focus on getting the tier label and confidence score correct for a known set of test accounts. Replace [ACCOUNT_METADATA] with a flat JSON object containing the fields your prototype needs (e.g., plan_type, contract_tier, support_level).
Watch for
- Missing fallback when account fields are absent or null
- Overly broad tier definitions that collapse distinct tiers (e.g., "enterprise" and "premium" merging)
- Confidence scores that don't reflect actual ambiguity in the input data

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