This prompt is for billing and entitlement engineers building AI-powered routing middleware that must respect downgrade grace periods. When a customer downgrades their subscription, most SaaS platforms provide a grace window during which the customer retains their previous tier's entitlements. Routing requests based on the new, lower tier during this window causes premature feature revocation, broken support experiences, and compliance violations. This prompt classifies an incoming request against the customer's effective tier, which accounts for active grace periods, and returns a deterministic routing decision with an audit trail.
Prompt
Tier Downgrade Grace Period Routing Prompt

When to Use This Prompt
A practical guide for billing and entitlement engineers who need to route requests correctly during subscription downgrade grace periods.
Use this prompt inside a classification step before dispatching to feature gates, support queues, or resource allocators. It expects upstream context that includes the customer's current tier, downgrade event timestamp, grace period duration, and the request's required entitlement level. The prompt does not perform initial tier detection or contract extraction—pair it with the Account Tier Detection Prompt or Contract SLA Mapping Prompt to supply the necessary inputs. The output is a structured routing decision with an effective tier, a boolean indicating whether the request should be honored under grace period rules, and a timestamp for when the grace window expires.
Do not use this prompt for initial tier detection, contract extraction, or for customers who are upgrading rather than downgrading. It is not designed to handle multi-product bundles where different features have independent grace periods—that scenario requires a more granular entitlement matrix. Avoid using this prompt as the sole authorization mechanism for regulated or financially material entitlements; always pair it with a deterministic business rules engine that can be independently audited. Before deploying, test against edge cases including zero-duration grace periods, overlapping downgrade events, and customers who downgrade multiple tiers in a single event.
Use Case Fit
Where the Tier Downgrade Grace Period Routing Prompt works, where it breaks, and what inputs and operational risks you must manage before putting it into production.
Good Fit: Grace-Period Enforcement
Use when: a customer's paid tier has expired but a contractual or policy-based grace period is still active. The prompt must route the request using the previous tier's entitlements, not the downgraded tier. Guardrail: always supply the grace-period end timestamp and the pre-downgrade tier as explicit input fields; never rely on the model to infer them from notes.
Bad Fit: Real-Time Entitlement Decisions
Avoid when: the routing decision must be made synchronously in a hot path with sub-50ms latency. An LLM call adds unacceptable delay. Guardrail: pre-compute effective tier in application code using a rules engine or cached entitlement service, and use the prompt only for offline audit, logging, or asynchronous review workflows.
Required Inputs
What you must provide: [ACCOUNT_ID], [PREVIOUS_TIER], [CURRENT_TIER], [GRACE_PERIOD_END_DATE], [REQUEST_TIMESTAMP], and [REQUEST_CONTEXT]. Guardrail: validate all timestamps are in UTC and that GRACE_PERIOD_END_DATE is a future date relative to REQUEST_TIMESTAMP before invoking the prompt. Missing or stale inputs produce incorrect routing.
Operational Risk: Premature Feature Revocation
Risk: the model routes a grace-period customer using the downgraded tier, revoking access to paid features before the grace period ends. This creates immediate customer escalations and potential contractual breach. Guardrail: implement a post-routing validator that blocks any downgrade-tier routing when REQUEST_TIMESTAMP < GRACE_PERIOD_END_DATE. Log and alert on validator blocks.
Operational Risk: Indefinite Grace Loops
Risk: a bug in upstream systems supplies a GRACE_PERIOD_END_DATE far in the future or null, causing the prompt to route customers at the higher tier indefinitely. Guardrail: enforce a maximum grace-period duration (e.g., 30 days) in the application layer. Reject any input where the grace period exceeds this ceiling and escalate for manual review.
Variant: Multi-Tier Downgrade Chains
Use when: a customer downgrades through multiple tiers in quick succession (e.g., Enterprise → Pro → Free) and overlapping grace periods create ambiguity about which tier applies. Guardrail: the prompt must accept an ordered [TIER_HISTORY] array with effective dates and resolve the correct tier using the most recent active grace period. Test with overlapping and adjacent grace windows.
Copy-Ready Prompt Template
A reusable prompt for routing customer requests during a tier downgrade grace period, ensuring entitlements are not prematurely revoked.
This prompt template is designed to be integrated into a billing or entitlement middleware service. Its core job is to evaluate a customer support or feature access request against the customer's current account state, specifically checking for an active downgrade grace period. The model must decide whether to honor the previous (higher) tier's entitlements or enforce the new (lower) tier's limits. Copy the template below and replace each [PLACEHOLDER] with data from your account, billing, and contract systems before sending it to the model.
textYou are an automated entitlement routing engine for a SaaS platform. Your task is to classify a customer's request based on their account tier, with special handling for accounts currently in a downgrade grace period. ## Input Data - Current Request: [USER_REQUEST] - Account ID: [ACCOUNT_ID] - Previous Tier: [PREVIOUS_TIER] - New Tier: [NEW_TIER] - Downgrade Effective Date: [DOWNGRADE_DATE] - Grace Period End Date: [GRACE_PERIOD_END_DATE] - Current Date: [CURRENT_DATE] - Previous Tier Entitlements: [PREVIOUS_TIER_FEATURES] - New Tier Entitlements: [NEW_TIER_FEATURES] ## Classification Rules 1. **Grace Period Active:** If `[CURRENT_DATE]` is on or before `[GRACE_PERIOD_END_DATE]`, the account is in a grace period. 2. **Routing Logic:** * If the `[USER_REQUEST]` maps to an entitlement in `[PREVIOUS_TIER_FEATURES]` AND the account is in a grace period, route to the `PREVIOUS_TIER_QUEUE`. * If the `[USER_REQUEST]` maps to an entitlement in `[PREVIOUS_TIER_FEATURES]` AND the account is NOT in a grace period, route to the `NEW_TIER_QUEUE` and flag as a potential upsell. * If the `[USER_REQUEST]` maps to an entitlement in `[NEW_TIER_FEATURES]`, always route to the `NEW_TIER_QUEUE`. * If the `[USER_REQUEST]` does not map to any known entitlement, route to the `GENERAL_SUPPORT_QUEUE`. ## Output Schema Return a single, valid JSON object without markdown fences. Do not include any explanatory text. { "account_id": "[ACCOUNT_ID]", "is_grace_period_active": boolean, "routing_target": "PREVIOUS_TIER_QUEUE" | "NEW_TIER_QUEUE" | "GENERAL_SUPPORT_QUEUE", "classification_reason": "string" }
To adapt this template, ensure the [PREVIOUS_TIER_FEATURES] and [NEW_TIER_FEATURES] placeholders are populated with structured lists of feature flags or support categories, not just tier names. The model needs to perform a semantic match between the user's natural language request and these feature lists. For high-stakes environments, the classification_reason string is critical for auditability; it should concisely state which rule was matched. Before deploying, run this prompt through a test suite that simulates requests on the exact boundary of the [GRACE_PERIOD_END_DATE] to catch off-by-one errors in date logic.
A common failure mode is the model misinterpreting the [CURRENT_DATE] format or performing the date comparison incorrectly. To mitigate this, always inject dates in an unambiguous ISO 8601 format (YYYY-MM-DD) and explicitly instruct the model to perform a chronological comparison. Another risk is the model hallucinating a feature match. You can reduce this by adding a [CONSTRAINTS] placeholder: "If the user's request does not clearly match a specific feature in either entitlement list, set the routing target to GENERAL_SUPPORT_QUEUE." After generating the output, validate the JSON schema and verify the routing_target against a hardcoded business rules engine as a secondary check before the routing decision takes effect.
Prompt Variables
Inputs the prompt needs to work reliably. Validate each field before invoking the model to prevent premature feature revocation or incorrect routing during grace periods.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[CUSTOMER_ID] | Unique account identifier for lookup against billing and entitlement systems | cust_8a7b3c2d | Must match ^[a-z]{4}_[a-f0-9]{8}$ pattern. Reject if null or empty. Verify account exists in billing system before prompt invocation. |
[CURRENT_TIER] | The customer's current effective tier before any downgrade is applied | enterprise | Must be one of: free, starter, professional, enterprise, partner. Reject unknown values. Cross-reference with billing system of record; do not trust user-provided tier. |
[TARGET_TIER] | The tier the customer would be downgraded to if grace period expires | professional | Must be one of: free, starter, professional, enterprise, partner. Must differ from [CURRENT_TIER]. If identical, skip routing and log anomaly. |
[GRACE_PERIOD_START] | ISO-8601 timestamp when the grace period began | 2025-01-15T00:00:00Z | Must parse as valid ISO-8601 datetime. Must be in the past. Reject future dates. Compare against billing system event log for consistency. |
[GRACE_PERIOD_DURATION_DAYS] | Number of days the grace period lasts from start date | 30 | Must be a positive integer between 1 and 365. Null not allowed. Cross-check against contract or entitlement record; do not default without explicit policy. |
[REQUEST_TYPE] | Category of the incoming customer request to determine routing rules | feature_access | Must be one of: feature_access, support_ticket, api_rate_limit, data_export, account_change. Reject unmapped types. Unknown types should route to human review queue. |
[REQUEST_TIMESTAMP] | ISO-8601 timestamp when the request was received | 2025-02-01T14:22:00Z | Must parse as valid ISO-8601 datetime. Must not be before [GRACE_PERIOD_START]. Used to calculate remaining grace days and SLA clock start. |
[ENTITLEMENT_OVERRIDE] | Optional manual override flag from support or sales for exceptional cases | null | If present, must be boolean true or null. true means bypass grace-period logic and route at [CURRENT_TIER]. Requires audit log entry with override reason and approver ID. |
Implementation Harness Notes
How to wire the Tier Downgrade Grace Period Routing Prompt into a production routing middleware with validation, retries, and audit logging.
The Tier Downgrade Grace Period Routing Prompt is not a standalone decision engine—it is a classification step inside a larger routing middleware that must enforce commercial rules deterministically. The prompt's job is to consume account metadata, downgrade timestamps, grace-period policy definitions, and the incoming request context, then return a structured routing decision that downstream systems can act on without ambiguity. The application layer owns the final enforcement: if the prompt returns route_as_tier: "premium" with grace_period_active: true, the middleware must honor that decision and not prematurely revoke access. The prompt should never be the sole source of truth for account state—always cross-reference the output against a source-of-truth billing or entitlement service before executing feature gates or queue assignments.
Wire the prompt into a pre-routing classification step that fires after account resolution but before queue dispatch. The harness should: (1) fetch the account's current tier, downgrade effective date, and grace-period policy from your billing or CRM API; (2) assemble the prompt with [ACCOUNT_CONTEXT] containing tier, downgrade timestamp, grace-period duration, and any custom contract overrides; (3) include [REQUEST_CONTEXT] with the incoming request type, channel, and requested feature or support level; (4) call the model with temperature=0 and a strict JSON output schema to prevent creative tier assignments; (5) validate the response against a schema that requires effective_tier, grace_period_active, grace_period_remaining_days, route_as_tier, and rationale fields; (6) if validation fails, retry once with the validation error injected into [PREVIOUS_ERROR] before escalating to a human reviewer or falling back to a conservative default (treat as downgraded tier to avoid over-entitlement). Log every decision with the full prompt, response, validation result, and final routing action for auditability.
Model choice matters here. Use a model with strong instruction-following and low hallucination rates on structured extraction tasks—GPT-4o, Claude 3.5 Sonnet, or equivalent. Avoid smaller models that may confuse grace-period logic or hallucinate tier assignments. Set response_format to JSON mode if available, and include a [OUTPUT_SCHEMA] placeholder in the prompt that mirrors your application's expected schema exactly. Retry logic should be bounded: one retry on schema validation failure, then escalate. Do not loop more than twice—grace-period decisions are time-sensitive, and a stuck retry loop during a customer interaction is worse than a conservative fallback. Human review triggers should fire when: the account has a custom contract that conflicts with standard grace-period policy, the downgrade timestamp is missing or ambiguous, or the model's confidence signal (if you request one) falls below a threshold. In high-stakes environments where premature feature revocation could cause revenue loss or contractual breach, route all grace-period-active decisions to a review queue for spot-checking during the first week of deployment.
Testing before production requires a golden dataset of account states: active grace period (within window), expired grace period (past window), no downgrade in progress, missing downgrade timestamp, custom contract with extended grace period, and edge cases like same-day downgrade-and-request. For each case, assert the expected route_as_tier and grace_period_active values. Add regression tests that catch false-positive grace-period extensions and false-negative premature downgrades. Observability should capture: prompt version, model version, account ID, downgrade timestamp, grace-period policy duration, model output, validation result, retry count, final routing decision, and latency. This trace data is essential for debugging misroutes and demonstrating compliance with contractual obligations during customer disputes. Do not deploy this prompt without first running it against your eval dataset and confirming that no test case produces a silent misclassification.
Expected Output Contract
Fields, types, and validation rules for the Tier Downgrade Grace Period Routing Prompt response. Use this contract to parse, validate, and route the model output before acting on it in production.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
routing_decision | string (enum) | Must be one of: 'GRACE_PERIOD_ACTIVE', 'DOWNGRADE_APPLIED', 'CLARIFICATION_NEEDED'. No other values allowed. | |
effective_tier | string | Must match a tier label from the input [ACCOUNT_TIERS] list. If grace period is active, this must equal the pre-downgrade tier. | |
grace_period_days_remaining | integer | Must be >= 0. If routing_decision is 'DOWNGRADE_APPLIED', this must be 0. If 'GRACE_PERIOD_ACTIVE', must be > 0. | |
grace_period_end_date | string (ISO 8601 date) | Must parse as a valid date. Must be today or in the future if grace period is active. Must be today or in the past if downgrade is applied. | |
downgrade_target_tier | string | Must match a tier label from [ACCOUNT_TIERS]. Represents the tier the account will move to after the grace period expires. | |
feature_access_rules | array of objects | Each object must contain 'feature_name' (string), 'access_granted' (boolean), and 'revocation_date' (ISO 8601 date or null). Revocation date must be >= grace_period_end_date if access_granted is false. | |
escalation_required | boolean | Must be true if any of: grace_period_days_remaining < [ESCALATION_THRESHOLD_DAYS], conflicting tier data detected, or account has [VIP_FLAG] set to true. Otherwise false. | |
evidence_summary | string | Must cite specific fields from [ACCOUNT_METADATA] that informed the decision. Must not exceed 300 characters. Must include downgrade_event_date and current_date comparison. |
Common Failure Modes
Grace-period routing is brittle because it sits at the intersection of billing events, cached entitlements, and real-time support logic. These failures break trust before the system logs an error.
Stale Tier Cache Overrides Grace Period
What to watch: The application reads a cached tier value that was written before the downgrade event, ignoring the active grace-period window. The model routes the request as if the customer is already on the lower tier. Guardrail: Require the prompt to receive a grace_period_end timestamp from the source of truth (billing system) and include a hard rule: if now() < grace_period_end, the effective tier must remain the pre-downgrade tier regardless of any cached value.
Premature Feature Revocation
What to watch: The model correctly identifies the grace period but still routes the request to a workflow that checks feature flags keyed to the new, downgraded tier. The customer loses access mid-grace-period. Guardrail: The prompt output must include an effective_tier field separate from billing_tier. Downstream feature gates must consume effective_tier, not the raw account tier. Validate this contract in integration tests.
Ambiguous Downgrade Date Parsing
What to watch: The billing system provides a downgrade date in an ambiguous format (e.g., 03/04/2025) or with a timezone mismatch. The model misinterprets the grace-period window, expiring it hours or days early. Guardrail: Normalize all timestamps to ISO 8601 UTC before they reach the prompt. Add a validation step that rejects inputs where grace_period_end cannot be parsed unambiguously and escalates to a human for manual tier verification.
Multi-Product Entitlement Confusion
What to watch: A customer downgrades one product but retains a premium tier on another. The prompt conflates the products and applies the lower tier to all requests, blocking access to the still-premium product. Guardrail: The prompt must accept a product_id or entitlement_scope parameter and evaluate the grace period per product. The output schema must include a per_product_effective_tier map, not a single account-wide tier.
Silent Grace-Period Expiry Without Notification
What to watch: The grace period ends, and the model immediately routes the customer to the downgraded experience without any transition messaging. The customer perceives this as a sudden, unexplained loss of functionality. Guardrail: The prompt should include a grace_period_status output field (active, expiring_soon, expired). When status is expiring_soon or expired, the routing decision must include a customer_notice string that the application surfaces before the downgraded workflow executes.
Manual Override Bypasses Grace Rules
What to watch: A support agent manually adjusts the account tier during the grace period to resolve an unrelated issue. The manual override wipes the grace-period flag, and the next automated routing decision treats the account as permanently downgraded. Guardrail: The prompt must receive a tier_override_source field. If the source is manual, the model must compare the override tier against the grace-period tier and flag a conflict for human review instead of silently accepting the lower tier.
Evaluation Rubric
Test cases to validate the Tier Downgrade Grace Period Routing Prompt before production deployment. Run each case against the prompt with the specified inputs and verify the output matches the expected behavior.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Active grace period routing | Output routes to [GRACE_PERIOD_QUEUE] with effective_tier equal to [PREVIOUS_TIER] and feature_revocation set to false | Output routes to [STANDARD_QUEUE] with effective_tier equal to [NEW_TIER] or feature_revocation set to true | Provide [ACCOUNT_ID] with downgrade_date within [GRACE_PERIOD_DAYS] and verify routing_target, effective_tier, and feature_revocation fields |
Expired grace period routing | Output routes to [STANDARD_QUEUE] with effective_tier equal to [NEW_TIER] and feature_revocation set to true | Output retains [PREVIOUS_TIER] as effective_tier or sets feature_revocation to false | Provide [ACCOUNT_ID] with downgrade_date exceeding [GRACE_PERIOD_DAYS] and verify effective_tier matches [NEW_TIER] |
Grace period boundary: last day | Output routes to [GRACE_PERIOD_QUEUE] with effective_tier equal to [PREVIOUS_TIER] | Output routes to [STANDARD_QUEUE] or effective_tier equals [NEW_TIER] | Provide [ACCOUNT_ID] where downgrade_date equals exactly [GRACE_PERIOD_DAYS] ago and verify routing_target is [GRACE_PERIOD_QUEUE] |
Grace period boundary: first day after | Output routes to [STANDARD_QUEUE] with effective_tier equal to [NEW_TIER] | Output routes to [GRACE_PERIOD_QUEUE] or effective_tier equals [PREVIOUS_TIER] | Provide [ACCOUNT_ID] where downgrade_date equals [GRACE_PERIOD_DAYS] plus one day ago and verify routing_target is [STANDARD_QUEUE] |
Missing downgrade_date field | Output sets confidence below [CONFIDENCE_THRESHOLD] and routes to [MANUAL_REVIEW_QUEUE] with missing_field flag set to true | Output hallucinates a downgrade_date or routes to a standard queue with high confidence | Provide [ACCOUNT_ID] with downgrade_date set to null or absent and verify routing_target is [MANUAL_REVIEW_QUEUE] |
Multiple concurrent tier changes | Output selects the most recent downgrade event and applies grace period logic to that tier transition only | Output averages tiers, applies grace period to wrong tier, or returns ambiguous effective_tier | Provide [ACCOUNT_ID] with two tier_change events within [GRACE_PERIOD_DAYS] and verify effective_tier matches the tier before the most recent downgrade |
Grace period with active support ticket | Output routes to [GRACE_PERIOD_QUEUE] and includes grace_period_active flag set to true in routing metadata | Output ignores grace period because a support ticket exists or routes to [STANDARD_QUEUE] | Provide [ACCOUNT_ID] with downgrade_date within [GRACE_PERIOD_DAYS] and an open support ticket and verify routing_target is [GRACE_PERIOD_QUEUE] |
Custom grace period duration per contract | Output uses [CUSTOM_GRACE_PERIOD_DAYS] from contract metadata instead of default [GRACE_PERIOD_DAYS] | Output applies default [GRACE_PERIOD_DAYS] when contract specifies a different duration | Provide [ACCOUNT_ID] with contract_grace_period_days set to a value different from default and verify effective grace period calculation uses the custom value |
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
Pull grace-period rules from a contract store or feature-flag service at runtime. Add schema validation, retry logic with exponential backoff, and structured logging for every routing decision. Include a confidence threshold below which the request is queued for human review. Cache grace-period lookups to reduce latency.
Prompt snippet
codeYou are a billing routing engine for [PRODUCT_NAME]. Given: - Account: [ACCOUNT_METADATA] - Request: [REQUEST_DETAILS] - Grace period rules: [GRACE_PERIOD_CONFIG] Determine the effective tier. If the account downgraded on [DOWNGRADE_DATE] and today is within [GRACE_PERIOD_DAYS], preserve the pre-downgrade tier. Return: { "in_grace_period": boolean, "effective_tier": "[TIER_ENUM]", "grace_period_remaining_days": number | null, "confidence": 0.0-1.0, "evidence": ["string"] }
Watch for
- Stale grace-period configs in cache causing incorrect routing
- Retry storms when the model returns malformed JSON repeatedly
- Missing human-review escalation when confidence is low
- Logging PII or account identifiers in plaintext trace output

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