This prompt is designed for compliance engineers, platform teams, and operations leads who manage time-bounded approvals in automated workflows. Its job is to evaluate a previously granted approval against expiry conditions—such as elapsed time, changes in the target environment, new risk factors, or policy updates—and output a structured decision on whether the approval is still valid, has expired, or requires re-approval. The ideal user is someone integrating AI into a system of record where stale permissions create a compliance or security risk, and where the logic for expiry is too dynamic to hardcode.
Prompt
Conditional Approval Expiry and Re-Approval Prompt

When to Use This Prompt
Defines the job-to-be-done, ideal user, required context, and limitations for the Conditional Approval Expiry and Re-Approval Prompt.
To use this prompt effectively, you must provide the original approval record (including its timestamp, scope, and conditions), the current state of the target environment, and any relevant policy documents that define expiry rules. The prompt expects these as structured inputs, not as a conversational history. It is not designed for initial approval routing—use a sibling prompt like Role-Based Approval Routing for first-time decisions. It also should not be used as a real-time authorization engine; its output is a recommendation that should be logged, reviewed, and then enforced by an application-layer gate.
A concrete implementation would wire this prompt into a scheduled job or an event-driven hook that fires before a gated action executes. For example, a deployment pipeline might call this prompt with the original change advisory board (CAB) approval and the current deployment window. The prompt would return an EXPIRED status if the window has shifted, along with the re-approval routing path. Always validate the output against a schema that requires an explicit status field (VALID, EXPIRED, RE_APPROVAL_REQUIRED) and a routing array. In high-risk domains, the prompt's decision should be treated as a recommendation that a human reviews before the system blocks or allows the action.
Do not use this prompt when the expiry logic is purely deterministic and can be expressed as a simple timestamp comparison in application code. Its value is in handling conditional expiry where the rules are nuanced, policy-driven, or require reasoning about environmental changes. Before putting this into production, build a test suite with cases for: an approval that is clearly expired by time, one that is still valid, one where the environment has changed in a way that should trigger re-approval, and one where the policy itself has been updated. These tests will catch the most common failure mode: the model missing a subtle environmental change that should invalidate the approval.
Use Case Fit
Where the Conditional Approval Expiry and Re-Approval Prompt works, where it fails, and the operational prerequisites for safe deployment.
Good Fit: Time-Bound Regulatory Approvals
Use when: compliance policies mandate that approvals automatically expire after a fixed window (e.g., 72 hours for a security exception, 30 days for a data access grant). The prompt reliably compares the elapsed time against a hard deadline and flags expiry. Guardrail: always pass the server-generated current timestamp as a non-negotiable input; never rely on the model's internal date knowledge.
Good Fit: Environment Change Detection
Use when: a previously approved action must be re-evaluated because the target environment, data sensitivity, or risk score has changed. The prompt compares the original approval context with the current state. Guardrail: provide a structured diff of changed conditions rather than raw logs, so the model compares explicit fields instead of hallucinating differences.
Bad Fit: Real-Time Transaction Authorization
Avoid when: sub-second latency is required for payment or access control decisions. This prompt is designed for asynchronous review queues, not inline authorization. Guardrail: use hard-coded policy evaluation in the application layer for real-time gates; reserve this prompt for post-hoc audit or batch re-approval workflows.
Required Input: Immutable Approval Record
Risk: without a structured record of the original approval (who, what, when, conditions, expiry policy), the model cannot reliably determine expiry. Guardrail: require a machine-readable approval object as input, including approved_at, expiry_policy, conditions_snapshot, and approved_by. Never pass only free-text notes.
Operational Risk: Unchanged-Condition Re-Approval Loops
Risk: if the prompt flags expiry but conditions haven't changed, re-approval may be granted again without scrutiny, creating a loop. Guardrail: include a re_approval_count and last_re_approval_reason in the input. If the count exceeds a threshold without material change, escalate to a human reviewer instead of routing for automated re-approval.
Operational Risk: Missed Expiry Triggers
Risk: the prompt may fail to detect expiry if the expiry policy is complex (e.g., business hours only, multi-condition dependencies). Guardrail: implement a deterministic pre-check in application code for simple time-based expiry. Use the prompt only for conditional or context-dependent expiry evaluation, and log every negative expiry decision for audit sampling.
Copy-Ready Prompt Template
A copy-ready prompt that evaluates whether a previously granted approval is still valid or requires re-approval based on time, environmental changes, and policy conditions.
This prompt template is designed to be the core decision engine for time-bounded and condition-bounded approvals. It takes a previously granted approval, its original context, and the current state, then produces a structured JSON decision. The prompt is built to be wired into an application harness that supplies the dynamic context, parses the output, and routes the result to either an automated continuation path or a human re-approval queue. The primary goal is to prevent stale or invalid approvals from silently authorizing high-risk actions.
codeYou are an approval validity evaluator for a compliance-critical system. Your task is to determine if a previously granted approval remains valid or has expired and requires re-approval. Evaluate the [ORIGINAL_APPROVAL] against the [CURRENT_CONTEXT] using the [EXPIRY_POLICY]. [ORIGINAL_APPROVAL]: { "approval_id": "[APPROVAL_ID]", "action_type": "[ACTION_TYPE]", "requestor": "[REQUESTOR]", "approver": "[APPROVER]", "granted_timestamp": "[GRANTED_TIMESTAMP]", "original_conditions": { "environment": "[ORIGINAL_ENVIRONMENT]", "risk_score": [ORIGINAL_RISK_SCORE], "data_scope": "[ORIGINAL_DATA_SCOPE]", "justification": "[ORIGINAL_JUSTIFICATION]" }, "approval_type": "[APPROVAL_TYPE]" } [CURRENT_CONTEXT]: { "evaluation_timestamp": "[EVALUATION_TIMESTAMP]", "current_environment": "[CURRENT_ENVIRONMENT]", "current_risk_score": [CURRENT_RISK_SCORE], "current_data_scope": "[CURRENT_DATA_SCOPE]", "environmental_changes": [ "[CHANGE_DESCRIPTION_1]", "[CHANGE_DESCRIPTION_2]" ], "new_risk_factors": [ "[NEW_RISK_FACTOR_1]" ] } [EXPIRY_POLICY]: { "max_age_hours": [MAX_AGE_HOURS], "risk_score_tolerance": [RISK_SCORE_TOLERANCE], "environment_change_triggers_expiry": [true/false], "data_scope_change_triggers_expiry": [true/false], "new_risk_factor_triggers_expiry": [true/false] } [OUTPUT_SCHEMA]: { "approval_id": "string", "is_valid": boolean, "expiry_reason": "string | null", "re_approval_required": boolean, "re_approval_routing": { "required_approver_role": "string | null", "escalation_reason": "string | null", "priority": "low | medium | high | critical" }, "evaluation_summary": "string" } [CONSTRAINTS]: 1. If the time elapsed since `granted_timestamp` exceeds `max_age_hours`, the approval is invalid and re-approval is required. Set `expiry_reason` to "TIME_EXPIRED". 2. If `environmental_changes` is not empty and `environment_change_triggers_expiry` is true, the approval is invalid. Set `expiry_reason` to "ENVIRONMENT_CHANGED". 3. If the `current_risk_score` exceeds `original_risk_score` by more than `risk_score_tolerance`, the approval is invalid. Set `expiry_reason` to "RISK_INCREASED". 4. If `current_data_scope` differs from `original_data_scope` and `data_scope_change_triggers_expiry` is true, the approval is invalid. Set `expiry_reason` to "DATA_SCOPE_CHANGED". 5. If `new_risk_factors` is not empty and `new_risk_factor_triggers_expiry` is true, the approval is invalid. Set `expiry_reason` to "NEW_RISK_FACTOR". 6. If multiple conditions trigger expiry, list the primary reason in `expiry_reason` and summarize all in `evaluation_summary`. 7. If re-approval is required, determine the `required_approver_role` based on the `action_type` and the highest severity trigger. For "TIME_EXPIRED", route to the original approver's role. For "RISK_INCREASED" or "NEW_RISK_FACTOR", route to a Security Officer. For environment or data scope changes, route to a Change Advisory Board. 8. Set `priority` to "critical" if a new risk factor or a risk score increase above tolerance is detected. Set to "high" for environment or data scope changes. Set to "medium" for time expiry. 9. Output only the valid JSON object specified in [OUTPUT_SCHEMA]. Do not include any other text or markdown fences.
To adapt this template, replace the square-bracket placeholders with actual values from your application's state. The [EXPIRY_POLICY] object should be sourced from a configuration service or policy document, not hardcoded, as these thresholds will change over time. The [ORIGINAL_APPROVAL] should be fetched from an audit log or approvals database, and the [CURRENT_CONTEXT] must be assembled by querying your live infrastructure, risk scoring engine, and change management system. The final paragraph of the prompt enforces strict JSON-only output, which is critical for reliable parsing in a production pipeline. Before deploying, test this prompt with a golden dataset that includes cases where no conditions have changed, where only time has elapsed, and where multiple expiry triggers fire simultaneously to ensure the routing logic behaves as expected.
Prompt Variables
Required and optional inputs for the Conditional Approval Expiry and Re-Approval Prompt. Validate each variable before assembly to prevent false expiry triggers and re-approval loops.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[APPROVAL_RECORD] | The original approval decision, including the timestamp, approver, scope, and any conditions attached. | {"approval_id": "APR-9921", "granted_at": "2025-03-15T10:00:00Z", "approver": "alice.chen@corp.com", "scope": "deploy v2.4.1 to us-east-1", "conditions": ["all integration tests pass", "deploy window: weekdays 10:00-14:00 UTC"]} | Must be a valid JSON object. Check that |
[CURRENT_TIMESTAMP] | The moment the expiry check is being performed. Used to calculate elapsed time since approval. | 2025-03-22T14:30:00Z | Must be an ISO 8601 timestamp. Must be later than |
[EXPIRY_POLICY] | The rules that define when an approval expires. Can be time-based, event-based, or condition-based. | {"max_age_hours": 168, "require_reapproval_on": ["scope_change", "failed_deployment", "security_incident"], "grace_period_minutes": 30} | Must be a valid JSON object. At least one expiry trigger must be defined. If |
[ENVIRONMENTAL_STATE] | The current state of the system or environment relevant to the approval scope. Used to detect changes that invalidate the original approval. | {"deployment_status": "failed", "active_incidents": ["INC-4412"], "config_hash": "a3f2b1c"} | Must be a valid JSON object. Compare against the state captured in |
[RE_APPROVAL_ROUTING_RULES] | The rules for determining who must re-approve if the original approval has expired. Maps conditions to roles or individuals. | {"scope_change": ["release-manager@corp.com"], "failed_deployment": ["sre-lead@corp.com", "alice.chen@corp.com"], "default": ["original_approver"]} | Must be a valid JSON object. A |
[ORIGINAL_APPROVER_AVAILABILITY] | Indicates whether the original approver is available to re-approve. Used to trigger delegation if the original approver is out of office. | {"alice.chen@corp.com": "unavailable", "delegate": "bob.smith@corp.com"} | Optional. If null, assume the original approver is available. If provided, must map to a valid delegate in |
[PREVIOUS_EXPIRY_CHECKS] | A log of prior expiry evaluations for this approval. Used to detect re-approval loops where the same approval is repeatedly re-granted without material change. | [{"checked_at": "2025-03-20T10:00:00Z", "result": "expired", "re_approval_granted": true}, {"checked_at": "2025-03-21T10:00:00Z", "result": "expired", "re_approval_granted": true}] | Optional. If provided, count consecutive |
Implementation Harness Notes
How to wire the conditional approval expiry prompt into a production application with validation, retries, and human review.
This prompt is designed to be called as a policy evaluation step within a larger approval workflow, not as a standalone chatbot. It should sit between an action's execution request and the approval routing logic. When a previously approved action is re-submitted—whether due to a delayed execution, a retry, or a periodic review—the application calls this prompt to determine if the original approval is still valid. The prompt's output is a structured decision that downstream code uses to either proceed, block, or re-route for re-approval. Treat this as a deterministic policy gate with an AI reasoning layer, not as an advisory suggestion.
Integration pattern: The application should maintain a record of the original approval event, including a timestamp, the approving parties, the approved action payload, and a snapshot of the conditions at the time of approval (e.g., risk score, environment, data sensitivity). When re-evaluation is triggered, assemble these fields into the [PREVIOUS_APPROVAL] and [CURRENT_CONDITIONS] placeholders. The [EXPIRY_POLICY] placeholder should be injected from a configuration store, not hardcoded in the prompt, so that policy changes (e.g., shortening the approval window from 72 to 24 hours) take effect immediately without a prompt update. After receiving the model's output, validate the JSON schema strictly: expiry_status must be one of VALID, EXPIRED, or CONDITION_CHANGED. If re_approval_required is true, the re_approval_routing array must contain at least one role object with a role and reason field. Reject and retry any response that fails schema validation.
Retry and fallback logic: If the model returns malformed JSON after two retries, or if the confidence score (if your model provides token-level logprobs) falls below a defined threshold, do not guess. Escalate to a human operator with the full context packaged by the prompt's output schema. Log every evaluation—including the model's raw response, the validated output, and any override decisions—to an audit table. This is critical for compliance use cases where you must prove that expiry checks occurred and were acted upon correctly. For high-risk domains (finance, healthcare, access control), always require a human to confirm any EXPIRED or CONDITION_CHANGED determination before blocking an action, unless the system is explicitly designed for fully automated gating with a documented risk acceptance.
Avoiding re-approval loops: A common failure mode is a re-approval loop where the same unchanged conditions trigger repeated expiry. To prevent this, your application should compare the [CURRENT_CONDITIONS] snapshot against the conditions that existed when the most recent re-approval was granted, not just the original approval. If the conditions are identical and the time window has not elapsed, suppress the re-evaluation call entirely and treat the approval as valid. The prompt itself can help detect this by including an unchanged_condition_loop flag in the output schema, but the primary defense should be in the application's state machine. Wire this prompt into a workflow engine that tracks approval lineage, not just a single approval record.
Expected Output Contract
Defines the shape, types, and validation rules for the conditional approval expiry and re-approval prompt output. Use this contract to build a parser, validator, or structured output schema before integrating the prompt into a production workflow.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
approval_id | string (UUID v4) | Must match the input [APPROVAL_ID] exactly; reject on mismatch or missing field. | |
expiry_status | enum: EXPIRED | VALID | EXPIRING_SOON | Must be one of the three allowed values; reject any other string or null. | |
expiry_reason | string (max 500 chars) | Must be non-empty if expiry_status is EXPIRED or EXPIRING_SOON; null allowed only when VALID. | |
time_elapsed_days | number (integer >= 0) | Must be a non-negative integer; reject negative values or non-numeric types. | |
environmental_change_detected | boolean | Must be strictly true or false; reject string representations like 'yes' or 'no'. | |
new_risk_factors | array of strings | If present, each element must be a non-empty string; reject arrays containing empty strings or non-string elements. | |
re_approval_required | boolean | Must be true if expiry_status is EXPIRED and environmental_change_detected is true; false otherwise. Reject contradictions. | |
re_approval_routing | array of objects with role (string) and justification (string) | Required when re_approval_required is true; each role must be non-empty, each justification must be non-empty and under 300 chars. Reject missing justifications. |
Common Failure Modes
What breaks first when using prompts for conditional approval expiry and re-approval, and how to guard against it.
Missed Expiry Due to Ambiguous Timestamps
What to watch: The model misinterprets relative dates ('last quarter'), timezone-less timestamps, or approval records with missing approved_at fields, causing it to skip expiry checks entirely. Guardrail: Pre-process all inputs into an ISO 8601 format with a timezone before the prompt. Explicitly instruct the model to treat any unparseable date as expired and escalate.
Unchanged-Condition Re-Approval Loop
What to watch: The model triggers re-approval because the expiry window elapsed, but the environmental factors (risk score, data sensitivity, policy version) are identical to the original approval. This creates a pointless loop. Guardrail: Add a conditional check: if current_risk_context equals original_approval_context, output expiry_status: 'GRACE_PERIOD' and extend the window once rather than routing for re-approval.
Ignoring Silent Policy Changes
What to watch: An approval is technically still within its time window, but the underlying policy or regulation has changed, making the original approval non-compliant. The model focuses only on the clock and misses the policy delta. Guardrail: Always provide a current_policy_hash or policy_version alongside the original approval record. Instruct the model to force expiry if the hashes don't match, regardless of elapsed time.
Over-Confidence on Partial Context
What to watch: The model confidently declares an approval 'valid' when critical context like 'current risk tier' or 'data classification' is missing from the input, defaulting to a safe assumption. Guardrail: Define a strict required_inputs schema. If any field is null or missing, the prompt must short-circuit to an ESCALATE_TO_HUMAN status with a specific missing-field error, rather than attempting a guess.
Re-Approval Routing to Deprecated Roles
What to watch: The original approval was granted by 'Director of Engineering', but a re-org has renamed or removed that role. The model hallucinates a person or defaults to a generic 'manager' role, breaking the routing. Guardrail: Always pass a fresh organizational_role_directory as input. Instruct the model to match roles by a persistent role_id, not by title string. If the role_id is missing, escalate for manual routing.
Batch Expiry Cascade Failure
What to watch: When processing a batch of approvals, a single malformed record causes the model to fail the entire batch or, worse, silently skip the bad record and process the rest without alerting. Guardrail: Implement a per-record validation wrapper. The prompt should process items independently and return a results array with individual status fields, ensuring one corrupt record doesn't block the rest and errors are surfaced explicitly.
Evaluation Rubric
Criteria for testing the Conditional Approval Expiry and Re-Approval Prompt before production deployment. Each row defines a specific quality dimension, the standard for passing, signals that indicate failure, and a concrete test method.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Expiry Detection Accuracy | Correctly identifies expired approvals based on [ELAPSED_TIME] exceeding [EXPIRY_WINDOW] | Outputs | Run 20 timestamp boundary cases (1 second before/after expiry) and assert status matches ground truth |
Unchanged Condition Re-Approval Loop Prevention | Does not trigger re-approval when [ENVIRONMENTAL_CHANGES] is empty and [NEW_RISK_FACTORS] is null | Outputs | Inject identical approval context twice and assert second response is |
Environmental Change Sensitivity | Flags re-approval when [ENVIRONMENTAL_CHANGES] contains a relevant diff (e.g., system version, dependency update) | Misses a documented environmental change and returns | Provide 5 scenarios with known environmental diffs and verify re-approval trigger fires for each |
Risk Factor Escalation | Escalates re-approval routing when [NEW_RISK_FACTORS] includes a higher severity tier than the original approval | Routes re-approval to the same level as the original approval despite increased risk | Test with risk tier jumps (low→high, medium→critical) and assert routing target matches escalated tier |
Re-Approval Routing Correctness | Routes re-approval to the correct [APPROVAL_MATRIX] role based on current risk tier and change type | Routes to original approver when policy requires a higher authority due to cumulative changes | Validate routing output against a known approval matrix for 10 change-type/risk-tier combinations |
Expiry Reason Explainability | Outputs a specific, non-empty [EXPIRY_REASON] that cites the exceeded threshold or triggering change | Returns | Parse output and assert [EXPIRY_REASON] contains a reference to the specific field that triggered expiry |
Output Schema Compliance | Response validates against the defined [OUTPUT_SCHEMA] with all required fields present and correctly typed | Missing | Schema validation check on 50 varied test cases; 100% pass rate required |
Idempotency Under Static Conditions | Returns identical | Flips between | Run same input 5 times and assert all outputs match on expiry status and re-approval boolean |
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
Start with the base prompt and a simple JSON schema for the expiry decision. Use a single [APPROVAL_RECORD] input containing the original approval timestamp, conditions, and any known environmental changes. Skip the re-approval routing logic initially—just output expired: true/false and a reason string.
codeGiven this approval record, determine if it has expired: [APPROVAL_RECORD] Return JSON: {"expired": boolean, "reason": string}
Watch for
- Time arithmetic errors when calculating elapsed duration
- Treating all condition changes as expiry triggers without materiality checks
- Missing timezone handling in timestamp comparisons

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