Use this prompt when you need an automated, auditable decision about whether a customer's requested action falls within their contracted entitlements. The primary job-to-be-done is preventing revenue leakage and compliance exposure by catching entitlement gaps before a feature is unlocked, a support ticket is routed to a premium queue, or a service-level commitment is triggered. The ideal user is a revenue operations engineer or a compliance platform builder embedding this check into middleware, an API gateway, or a support ticketing system. The prompt requires two structured inputs: a clear description of the requested action and the customer's known contract terms, which can be provided as structured JSON, key-value pairs, or semi-structured text from a CRM or billing system.
Prompt
Contract Entitlement Gap Detection Prompt

When to Use This Prompt
Determines when to deploy the Contract Entitlement Gap Detection Prompt in production access-control and compliance workflows.
This prompt is designed for deterministic gap detection, not for interpreting novel or highly ambiguous contract language. It excels when the contract terms are explicit (e.g., 'Enterprise tier includes 24/7 phone support' or 'Up to 10,000 API calls per month') and the request is concrete (e.g., 'Customer requests phone support for a P3 issue'). In these cases, the prompt will output a structured decision with a gap_detected boolean, a list of specific violated terms, and a recommended handling path like route_to_standard_queue or escalate_for_manual_review. The prompt includes false-positive controls by requiring the model to cite the exact contract clause that creates the gap, and by providing a confidence_score that you can threshold to route low-confidence cases to a human.
Do not use this prompt as a replacement for legal review when contract language is vague, when the customer disputes the terms, or when the request involves a custom enterprise agreement with non-standard clauses that require human interpretation. In these scenarios, the prompt should be configured to return a confidence_score below your threshold, which your application harness should catch and route to a manual review queue. The next section provides the copy-ready prompt template you can adapt for your own contract schemas and routing logic.
Use Case Fit
Where this prompt works, where it fails, and the operational conditions required before putting it into a production routing pipeline.
Good Fit: Structured Contract Metadata
Use when: contract entitlements are available as structured fields (SKUs, support tiers, feature flags) alongside the customer request. The prompt excels at comparing a requested action against a machine-readable permission set. Avoid when: entitlements exist only in unstructured, scanned PDFs without prior extraction.
Bad Fit: Implicit or Verbal Agreements
Risk: the model cannot detect side agreements, verbal promises, or email threads that modified the standard contract. Guardrail: require a [CONTRACT_SNAPSHOT] input that represents the system-of-record truth. If a gap is flagged but a manual override exists, route to a human review queue with the override evidence attached.
Required Inputs
What to watch: missing or stale entitlement data produces false gap flags and erodes trust. Guardrail: validate that [CUSTOMER_TIER], [ENTITLEMENT_MATRIX], and [REQUESTED_ACTION] are non-null before invoking the prompt. If any input is missing, abort the routing decision and escalate to a manual triage queue.
Operational Risk: False-Positive Gaps
Risk: flagging a legitimate request as out-of-entitlement blocks valid work and frustrates customers. Guardrail: implement a confidence threshold. If the gap detection confidence is below 90%, route to a human reviewer instead of auto-rejecting. Log all gap decisions with the evidence chain for audit.
Operational Risk: Silent False Negatives
Risk: the prompt misses an entitlement gap, allowing a customer to access features or support they haven't paid for. Guardrail: run periodic eval sweeps with known gap examples. Pair this prompt with a downstream enforcement check that verifies the final action against the contract snapshot before execution.
Variant: Revenue Recovery Path
Use when: the gap is real but the customer may be willing to upgrade. Guardrail: instead of a hard block, route gap detections to a "soft decline with offer" workflow that presents the upgrade path. This prompt variant should output a [RECOMMENDED_OFFER] field alongside the gap flag.
Copy-Ready Prompt Template
A reusable prompt template for detecting gaps between a customer request and their contracted entitlements, with structured output and recommended handling paths.
This prompt template is designed to be copied directly into your application's prompt layer. It accepts a customer request, the relevant contract entitlements, and a routing context, then produces a structured gap analysis. Every placeholder is enclosed in square brackets and must be replaced with live data at invocation time. The prompt is built for deterministic, auditable output that downstream systems can act on without manual interpretation.
textYou are an entitlement verification engine. Your job is to compare a customer request against their contracted entitlements and detect any gaps where the request falls outside what the contract permits. ## INPUTS ### Customer Request [REQUEST_DETAILS] ### Contracted Entitlements [ENTITLEMENTS] ### Account Context - Account Tier: [ACCOUNT_TIER] - SLA Tier: [SLA_TIER] - Account Health Score: [HEALTH_SCORE] - Contract Start Date: [CONTRACT_START] - Contract End Date: [CONTRACT_END] - Custom Terms: [CUSTOM_TERMS] ### Routing Context - Request Type: [REQUEST_TYPE] - Requested Feature or Service: [REQUESTED_FEATURE] - Current Queue: [CURRENT_QUEUE] - Elapsed Time Since Request: [ELAPSED_TIME] ## OUTPUT SCHEMA Return a JSON object with the following structure: { "entitlement_check": { "requested_item": "string (the feature, service, or support level requested)", "is_entitled": "boolean (true if the request falls within contracted entitlements)", "matched_entitlement": "string or null (the specific contract clause or entitlement that covers this request)", "confidence": "number between 0.0 and 1.0" }, "gap_detected": "boolean (true if any part of the request is not covered by entitlements)", "gaps": [ { "gap_type": "string (one of: 'feature_not_entitled', 'tier_mismatch', 'sla_exceeded', 'contract_expired', 'usage_limit_reached', 'custom_term_restriction', 'not_in_scope')", "description": "string (clear explanation of what was requested vs what is permitted)", "severity": "string (one of: 'critical', 'high', 'medium', 'low')", "recommended_action": "string (one of: 'deny_with_explanation', 'escalate_to_account_manager', 'offer_upgrade_path', 'route_to_sales', 'manual_review_required', 'honor_as_grace_period')" } ], "routing_decision": { "target_queue": "string (where this request should be routed)", "escalation_required": "boolean", "escalation_reason": "string or null", "sla_breach_risk": "boolean", "breach_risk_detail": "string or null" }, "audit_trail": { "contract_clauses_referenced": ["string"], "ambiguity_notes": "string or null (flag any unclear or conflicting entitlement language)", "fallback_applied": "boolean (true if a default or fallback entitlement rule was used)" } } ## CONSTRAINTS - If the contract language is ambiguous, set confidence below 0.8 and flag it in ambiguity_notes. - Do not assume entitlement unless there is explicit contract language supporting it. - For accounts in a downgrade grace period, apply the pre-downgrade entitlements and note it in audit_trail. - If the account has custom terms in [CUSTOM_TERMS], those override standard tier entitlements. - Never route a denied request to a queue that could fulfill it without proper entitlement verification. - If gap severity is 'critical' or 'high', escalation_required must be true. - Return only the JSON object. No additional commentary.
To adapt this prompt for your environment, replace each square-bracket placeholder with live data from your account service, contract store, and request pipeline. The output schema is designed to feed directly into a routing dispatcher: use routing_decision.target_queue to move the request and gaps[].recommended_action to trigger the correct handling workflow. If your system lacks some fields like HEALTH_SCORE or ELAPSED_TIME, either omit those sections or set them to null and adjust the constraints accordingly. The gap_type enum should be extended only if your contract model introduces new categories of entitlement violations.
Before deploying, validate this prompt against a golden dataset of known entitlement scenarios: requests that are clearly entitled, clearly denied, and ambiguous. Measure false-positive gap flags (denying entitled requests) and false-negative gaps (approving unentitled requests). Both failure modes carry risk, but false negatives that grant access to unentitled features or support channels are typically the higher-severity error in revenue and compliance contexts. Wire the confidence field into an observability dashboard so you can track ambiguity rates over time and identify contract language that consistently produces low-confidence decisions.
This prompt is a classification and routing tool, not a contract interpretation engine for legal disputes. If the gap severity is critical or the confidence is below 0.6, the recommended action should route to manual review rather than attempting automated resolution. Do not use this prompt to make entitlement decisions that carry financial liability, regulatory exposure, or customer termination risk without a human-in-the-loop approval step.
Prompt Variables
Required inputs for the Contract Entitlement Gap Detection Prompt. Each variable must be populated before the prompt is assembled and sent. Missing or malformed inputs are the most common cause of false-positive gap flags.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[CUSTOMER_REQUEST] | The full text of the customer's request, ticket, or inquiry being evaluated for entitlement coverage. | We need to export all user activity logs for the last 12 months to our external SIEM via API. | Must be non-empty string. Truncate at model context limit minus 2000 tokens. Strip PII before insertion if not needed for entitlement evaluation. |
[CONTRACT_ENTITLEMENTS] | Structured representation of the customer's contracted entitlements: features, limits, support channels, SLAs, and exclusions. | {"tier": "enterprise", "features": ["api_access", "audit_logs"], "data_retention_days": 90, "support_channel": "dedicated_slack"} | Must be valid JSON. Required fields: tier, features (array), support_channel. Null allowed for optional fields. Validate schema before prompt assembly; schema mismatch causes hallucinated gaps. |
[ACCOUNT_METADATA] | Current account state including tier, status, grace periods, parent-child relationships, and recent tier changes. | {"account_id": "acct_789", "status": "active", "current_tier": "enterprise", "downgrade_scheduled": null, "parent_account": null} | Must be valid JSON. Required fields: account_id, status, current_tier. Check for downgrade_scheduled date to avoid gap flags during grace periods. Null parent_account allowed for non-hierarchy accounts. |
[PRODUCT_CATALOG] | Current product feature definitions, tier mappings, and add-on availability. Used to determine if the request maps to an existing product capability. | {"features": {"siem_export": {"tiers": ["enterprise"], "addon_available": false}, "audit_logs": {"tiers": ["pro", "enterprise"], "retention_days": {"pro": 30, "enterprise": 90}}} | Must be valid JSON. Keep current; stale catalog causes false gaps for newly launched features. Validate feature names match contract entitlement keys exactly. |
[REQUEST_CATEGORY] | Pre-classified category of the customer request from upstream intent detection or ticket routing. | data_export | Must match an enum from the routing taxonomy. Allowed values defined in system config. Unknown or null category triggers fallback to general gap detection with lower confidence threshold. |
[HISTORICAL_EXCEPTIONS] | Record of prior exception approvals, one-time grants, or override decisions for this account that may apply to the current request. | [{"exception_id": "exc_456", "feature": "siem_export", "granted_date": "2025-01-15", "expiry_date": "2025-07-15", "approved_by": "cs_manager"}] | Optional. Empty array allowed. Each record must have exception_id, feature, and expiry_date. Expired exceptions must be filtered before prompt assembly to avoid stale entitlement assumptions. |
[OUTPUT_SCHEMA] | The exact JSON schema the model must return, including gap_detected, gap_type, contract_citation, recommended_path, and confidence fields. | {"type": "object", "properties": {"gap_detected": {"type": "boolean"}, "gap_type": {"enum": ["feature_missing", "limit_exceeded", "channel_mismatch", "sla_breach_risk", "none"]}, "confidence": {"type": "number", "minimum": 0, "maximum": 1}}} | Must be valid JSON Schema. Insert as stringified schema in system instructions. Validate output against this schema post-generation. Schema drift between prompt and validator causes retry loops. |
[ESCALATION_POLICY] | Rules for what happens when a gap is detected: who to notify, which queue to route to, and whether to block or warn. | {"on_gap_detected": "route_to_cs_review", "block_fulfillment": false, "notify_roles": ["account_manager", "entitlement_admin"], "auto_approve_below_confidence": 0.3} | Must be valid JSON. Required field: on_gap_detected. Validate enum values against workflow dispatch config. Missing escalation policy causes gaps to be detected but never actioned. |
Implementation Harness Notes
How to wire the Contract Entitlement Gap Detection Prompt into a production application with validation, retries, logging, and human review.
This prompt is designed to sit inside a compliance or revenue operations workflow where a customer request has already been classified and the system must verify whether the request falls within the customer's contracted entitlements. The harness should treat this prompt as a decision point, not a final action. The model's output is a structured gap assessment that downstream systems use to route the request to fulfillment, upsell, or exception handling. Because false negatives (missing a real gap) create revenue leakage and false positives (flagging an entitled request as a gap) degrade customer trust, the implementation must include validation, confidence thresholds, and human review for ambiguous cases.
Integration pattern: Call this prompt after you have resolved the customer's effective contract terms and the specific feature, service, or support level being requested. The application layer should assemble the [CONTRACT_ENTITLEMENTS] and [REQUEST_DETAILS] inputs from your contract store and ticketing system, not from raw user text. Use a structured output schema that requires the model to return a gap_detected boolean, a gap_type enum (e.g., feature_not_entitled, tier_mismatch, volume_exceeded, sla_not_covered), a confidence_score between 0 and 1, the specific contract_clause_reference, and a recommended_handling_path (e.g., fulfill, upsell_required, exception_review, escalate_to_account_manager). Validate the response against this schema before allowing any downstream routing decision. If confidence_score is below 0.85 or the gap_type is ambiguous, route to a human review queue with the full context attached.
Model selection and tool use: This is a reasoning-heavy classification task that benefits from models with strong instruction-following and structured output capabilities. GPT-4o, Claude 3.5 Sonnet, or equivalent models are appropriate. The prompt does not require tool calls or retrieval-augmented generation because the contract terms and request details are provided inline. However, if your contract store is large, consider a pre-retrieval step that pulls only the relevant entitlement clauses before assembling the prompt context. This reduces token usage and prevents the model from reasoning over irrelevant contract sections. Log every invocation with the prompt version, model, inputs, output, confidence score, and final routing decision for auditability. For high-volume production use, implement a retry with fallback pattern: if the model returns malformed JSON or a confidence score below 0.7, retry once with a simplified prompt variant, and if that fails, escalate to human review.
Failure modes to monitor: The most common production failure is the model flagging a gap when the customer actually has entitlement through an addendum, a parent account, or a bundled plan that wasn't fully represented in the [CONTRACT_ENTITLEMENTS] input. Mitigate this by ensuring your contract resolution layer handles inheritance, bundles, and addenda before calling this prompt. A second failure mode is the model failing to detect a gap when the request uses terminology that doesn't match the contract language. Include a [TERMINOLOGY_MAPPING] input field that maps common customer-facing feature names to contract clause names. Finally, monitor for confidence-score inflation: if the model consistently returns high confidence on incorrect gap flags, add eval checks that compare model decisions against a golden dataset of known entitlement cases and adjust the confidence threshold upward.
Next steps after implementation: Once the harness is in place, build a dashboard that tracks gap detection rates by customer tier, gap type, and handling path. This data feeds directly into product and pricing decisions. If a specific gap type appears frequently, it may indicate that your packaging needs adjustment or that customers consistently misunderstand what's included. Wire the recommended_handling_path output into your CRM or ticketing system so that upsell opportunities are routed to the sales team and exception reviews go to the appropriate approver. Avoid the temptation to automate fulfillment or denial based solely on this prompt's output without human review for high-value accounts or ambiguous cases.
Expected Output Contract
Defines the structured output schema for the Contract Entitlement Gap Detection Prompt. Each field must be validated before the routing decision is applied to prevent false-positive gap flags and incorrect handling paths.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
gap_detected | boolean | Must be true or false. If true, gap_fields array must contain at least one entry. If false, gap_fields must be empty. | |
gap_fields | array of strings | Each string must match a field name from [REQUESTED_ENTITLEMENTS]. Empty array is valid only when gap_detected is false. No duplicate entries allowed. | |
gap_severity | string (enum) | Must be one of: critical, high, medium, low. Critical reserved for regulatory or contractual breach risk. Low reserved for cosmetic or non-material gaps. | |
contractual_basis | string | Must cite a specific clause, section, or field from [CONTRACT_ENTITLEMENTS]. Cannot be generic placeholder like 'per contract terms'. Must be verifiable against input. | |
requested_item | string | Must exactly match one entry from [REQUESTED_ENTITLEMENTS] list. Null not allowed when gap_detected is true. Case-sensitive match required. | |
handling_path | string (enum) | Must be one of: escalate_to_review, notify_customer, block_with_reason, route_to_sales, allow_with_warning. Selection must align with gap_severity and [ROUTING_POLICY]. | |
gap_explanation | string | Must be 1-3 sentences explaining the mismatch. Must reference both the requested item and the contractual limitation. Cannot exceed 500 characters. | |
confidence_score | number (0.0-1.0) | Must be between 0.0 and 1.0. Scores below [CONFIDENCE_THRESHOLD] must trigger human review regardless of gap_detected value. Default threshold is 0.85 unless overridden. |
Common Failure Modes
Contract entitlement gap detection is a high-stakes classification task where false positives erode trust and false negatives create revenue leakage. These are the most common failure modes and the practical guardrails to prevent them.
False-Positive Gap Flags on Standard Requests
What to watch: The prompt flags a legitimate, in-scope request as out-of-entitlement because the contract language is vague or the request uses non-standard terminology. This blocks valid work and frustrates customers. Guardrail: Require the model to cite the specific contract clause or entitlement field that is violated. If no clause can be cited, default to 'in-scope' and log for human review.
Missing Gaps Due to Implicit Entitlements
What to watch: The model assumes a feature or service level is included because it is 'standard' or 'typical,' ignoring the actual contract terms. This is common with bundled services or legacy contracts. Guardrail: Provide a structured entitlement manifest as input, not free-text contract excerpts. Instruct the model to treat anything not explicitly listed as out-of-scope.
Inconsistent Handling of Custom and Bespoke Contracts
What to watch: Non-standard contracts with custom clauses, addendums, or negotiated terms cause the model to fall back to a generic tier logic, producing incorrect gap decisions. Guardrail: Implement a pre-processing step that extracts custom terms into the same structured entitlement schema. If extraction confidence is low, route to a human reviewer before gap detection runs.
Hallucinated Entitlement Denials with Confident Language
What to watch: The model invents a policy limitation or contract restriction that does not exist, often phrased with high confidence. This is dangerous in customer-facing or revenue workflows. Guardrail: Add a strict output constraint requiring a direct quote or reference ID from the source contract for every denial reason. Implement a post-generation validator that rejects denials without source grounding.
Misclassification During Account State Transitions
What to watch: Accounts in upgrade, downgrade, trial expiration, or grace periods have ambiguous entitlements. The model applies the wrong state's rules, causing premature feature revocation or unauthorized access. Guardrail: Include an explicit 'account state' field in the input with a defined effective date. Add a rule that grace-period logic always takes precedence over standard tier logic.
Parent-Child Account Inheritance Errors
What to watch: A request from a child account is evaluated against its own entitlements instead of the parent's, or vice versa, when the contract specifies inheritance. This breaks multi-tenant routing. Guardrail: Resolve the effective account tier before gap detection by traversing the hierarchy. Pass the resolved tier and the inheritance chain as explicit input fields. Test with orphan accounts and circular references.
Evaluation Rubric
Criteria for evaluating the quality and safety of the Contract Entitlement Gap Detection Prompt before deployment. Use these standards to build automated tests, human review checklists, and acceptance gates.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Gap Identification Accuracy | All requested items correctly flagged as in-scope or out-of-scope per the provided [CONTRACT_ENTITLEMENTS] snippet. | A requested item explicitly listed in the contract is flagged as a gap, or an item clearly absent is marked as covered. | Golden dataset of 20 contract-request pairs with known gap labels; require ≥95% accuracy. |
Evidence Citation | Every gap flag includes a direct quote or specific clause reference from [CONTRACT_ENTITLEMENTS] as the [EVIDENCE] field. | Gap flag contains a hallucinated clause reference, cites a non-existent section, or provides no evidence. | Automated check: [EVIDENCE] string must be a substring match or high-similarity match to the provided [CONTRACT_ENTITLEMENTS] text. |
Handling Path Validity | The [RECOMMENDED_HANDLING] field is one of the allowed enum values: 'approve', 'deny', 'escalate_to_account_manager', 'request_legal_review'. | Output contains a handling path outside the allowed enum, or a path that contradicts company policy for the gap type. | Schema validation against allowed enum. Policy alignment spot-check on 10 diverse gap scenarios by a revenue operations reviewer. |
False-Positive Gap Rate | Zero false-positive gap flags on requests fully covered by standard entitlements. | A standard, in-scope request is flagged as a gap, triggering an unnecessary escalation or denial. | Run prompt against a dataset of 50 clearly in-scope requests; require 0 false-positive gap flags. |
Output Schema Compliance | Output is valid JSON matching the [OUTPUT_SCHEMA] with all required fields present and correctly typed. | Missing required field, incorrect data type (e.g., string for boolean), or unparseable JSON. | Automated JSON Schema validation in CI pipeline on every prompt change. |
Ambiguity Handling | When contract language is ambiguous for a requested item, [CONFIDENCE_SCORE] is ≤0.7 and [RECOMMENDED_HANDLING] is 'escalate_to_account_manager' or 'request_legal_review'. | Ambiguous request is assigned a high confidence score and an automated 'approve' or 'deny' decision. | Curated set of 10 requests with intentionally ambiguous contract language; verify confidence ≤0.7 and handling path is not 'approve' or 'deny'. |
Multi-Item Request Handling | Each item in a multi-item [CUSTOMER_REQUEST] is evaluated independently in the [GAPS] array with its own gap status, evidence, and handling path. | A multi-item request returns a single gap assessment for the whole request, or items are conflated. | Test with 5 multi-item requests; verify [GAPS] array length equals the number of distinct requested items. |
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 contract snippet and a single request description. Skip structured output enforcement initially—just ask for a gap flag and a one-sentence reason. Test with 10–15 known entitlement pairs before adding schema validation.
Watch for
- Over-flagging: the model treats any unmentioned feature as a gap
- Missing null handling when contract fields are absent
- Treating vague contract language as definitive denial

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