This playbook is for AI engineers and product architects building adaptive assistants where the priority of instructions must shift mid-session due to a change in context, user role, or task phase. The core job is to trigger a safe, auditable re-evaluation of which system rules, user directives, and policy constraints are active right now—without losing the conversation's history or violating the original instruction hierarchy. You need this when a single, static system prompt cannot cover all operational modes, such as a support bot that must elevate compliance rules when a user mentions a refund, or a copilot that must drop into a restricted 'read-only' mode when viewing sensitive data.
Prompt
Instruction Priority Re-Evaluation Prompt for Context Shifts

When to Use This Prompt
Define the job, the reader, and the constraints for deploying an Instruction Priority Re-Evaluation Prompt in adaptive, long-running AI assistants.
Do not use this prompt for simple, single-turn classification or for assistants with a completely static instruction set. It is overkill if your instruction hierarchy never changes. It is also insufficient as a standalone safety mechanism; it must be paired with hard application-layer guardrails for truly disallowed actions. The prompt assumes you have a defined set of instruction layers (e.g., system, developer, user, tool, policy) and a known set of context triggers (e.g., [CONTEXT_SHIFT_SIGNAL]) that warrant a priority re-evaluation. The output is not a final answer to the user but a structured re-evaluation artifact—a new priority map—that your application harness reads to update the active instruction set for subsequent turns.
Before implementing, map out your context shift triggers and the expected priority changes. A common failure mode is 'priority thrashing,' where minor context fluctuations cause constant, unnecessary re-evaluations that degrade latency and user experience. Implement a stabilization check in your harness to prevent this. Next, proceed to the Prompt Template section to copy the base template and adapt it to your specific instruction layers and triggers.
Use Case Fit
Where the Instruction Priority Re-Evaluation Prompt for Context Shifts delivers value and where it introduces risk. Use these cards to decide if this prompt fits your operational context before integrating it into a production harness.
Good Fit: Adaptive Assistants with Changing Permissions
Use when: an assistant's authority, data scope, or role must change mid-session based on user authentication, task phase, or detected context shift. Guardrail: Bind re-evaluation triggers to explicit application-level state changes, not just conversational cues, to prevent prompt injection from forcing a role change.
Bad Fit: Static System Prompts with Fixed Policies
Avoid when: the instruction hierarchy is designed to be immutable for safety or compliance reasons. Introducing a re-evaluation prompt creates an unnecessary attack surface. Guardrail: If rules must never change, use hard-coded guardrails in the application layer instead of a model-self-re-evaluation loop.
Required Inputs: Explicit Priority Schema and State Signal
Risk: Without a structured definition of the current context state and the corresponding priority rules, the model will hallucinate a re-evaluation. Guardrail: The prompt must receive a machine-readable [CURRENT_STATE] object and a [PRIORITY_SCHEMA] mapping states to rule sets. Never rely on the model to infer the active state from conversation alone.
Operational Risk: Stale Priority Persistence
Risk: The model may fail to drop old, high-priority instructions after a context shift, causing conflicting rules to accumulate silently. Guardrail: The re-evaluation output must include an explicit deprecated_instructions list. Validate this list in the application layer and actively strip deprecated rules from the subsequent context window.
Operational Risk: Inappropriate Rule Retention
Risk: The model may retain a restrictive policy from a previous context (e.g., a locked-down admin mode) after switching to a more permissive user mode, breaking the user experience. Guardrail: Include negative examples in the prompt showing correct rule removal. Log every re-evaluation event with the full active_rules set for auditability.
Integration Pattern: Pre-Action Gate
Risk: Executing a tool call or generating a response before re-evaluating instructions can violate a newly active policy. Guardrail: Wire the re-evaluation prompt as a synchronous pre-processing step in your agent loop. Block all tool calls and user-facing output until the new instruction set is confirmed and applied to the active session.
Copy-Ready Prompt Template
A reusable prompt template for triggering a mid-session re-evaluation of instruction priority when the conversation context shifts.
This prompt template is designed to be injected into a running session when a significant context shift is detected—such as a user changing their role, escalating a request, or moving into a regulated workflow. It forces the model to pause, re-read the full instruction hierarchy, and explicitly re-rank which rules apply to the new context before generating the next response. The output is a structured re-evaluation block that can be logged for audit and used to guide subsequent behavior.
textSYSTEM: You are a context-aware instruction manager. Your task is to re-evaluate the active instruction hierarchy in response to a detected context shift. You must not continue the conversation until this re-evaluation is complete. CURRENT INSTRUCTION HIERARCHY: [FULL_INSTRUCTION_HIERARCHY] DETECTED CONTEXT SHIFT: [SHIFT_DESCRIPTION] CONVERSATION HISTORY (last N turns): [RECENT_CONVERSATION_HISTORY] TASK: 1. Identify which instruction layers (system, developer, user, tool, policy) are now active given the new context. 2. Identify any instruction layers that should be de-prioritized or deactivated. 3. Resolve any conflicts between active layers using the following precedence: [PRIORITY_ORDER]. 4. Output a structured re-evaluation record in the following JSON format: { "context_shift_detected": "[summary of shift]", "active_layers": ["layer_a", "layer_b"], "deactivated_layers": ["layer_c"], "conflicts_resolved": [ {"conflict": "description", "resolution": "chosen rule", "overridden_layer": "layer_name"} ], "governing_instructions": ["instruction_1", "instruction_2"], "confidence": "high|medium|low", "requires_human_review": true|false } CONSTRAINTS: - Do not fabricate instructions not present in the provided hierarchy. - If the shift is ambiguous, set confidence to "low" and flag for human review. - If a safety or compliance layer is overridden, you must set requires_human_review to true. - Do not generate any user-facing response until the re-evaluation is complete.
To adapt this template, replace the square-bracket placeholders with your actual data. [FULL_INSTRUCTION_HIERARCHY] should contain the complete, unsummarized set of system, policy, and role instructions active at the start of the session. [SHIFT_DESCRIPTION] is a machine-generated or classifier-detected label explaining what changed (e.g., 'User requested access to PII data' or 'Conversation escalated from support to legal review'). [PRIORITY_ORDER] must be an explicit, ordered list of layer precedence (e.g., 'Safety Policy > Regulatory Compliance > System Instructions > Developer Instructions > User Preferences'). For high-risk domains, always set requires_human_review to true when safety layers are involved in a conflict, and log the full re-evaluation payload to your audit store before allowing the model to continue the conversation.
Prompt Variables
Required inputs for the Instruction Priority Re-Evaluation Prompt. Each variable must be populated before the prompt is assembled and sent. Validation checks prevent silent failures when context shifts occur.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[CURRENT_SYSTEM_INSTRUCTIONS] | The full set of active system-level instructions, including role definitions, policies, and constraints currently in effect | You are a support agent for Acme Corp. You must verify customer identity before discussing account details. You may not promise refunds without manager approval. | Schema check: must be a non-empty string. Pre-flight: confirm this matches the deployed instruction version hash. Null not allowed. |
[ACTIVE_USER_PREFERENCES] | Session-level user corrections, overrides, or stated preferences that may conflict with system instructions | User stated they are a tier-3 support engineer and requested bypass of identity verification for internal testing. | Schema check: string or null. If non-null, flag for conflict detection against [CURRENT_SYSTEM_INSTRUCTIONS]. Null allowed for fresh sessions. |
[RECENT_CONVERSATION_SUMMARY] | Compressed summary of the last N turns, including user requests, model responses, and any instruction violations detected | Turn 12: User requested refund of $500. Turn 13: Model declined citing policy 4.2. Turn 14: User claimed manager approval. Turn 15: Model requested evidence. | Schema check: string, max 2000 tokens. Must include turn markers. Parse check: extract turn count and verify it matches session metadata. Null not allowed if session exceeds 5 turns. |
[CONTEXT_SHIFT_TRIGGER] | The event or condition that triggered this re-evaluation, such as a topic change, role escalation, or policy boundary crossing | User introduced a new topic: legal liability for delayed shipment. Previous context was billing inquiry. | Schema check: non-empty string. Enum check: must match one of [topic_change, role_escalation, policy_boundary, user_correction, tool_output_change, session_milestone]. Null not allowed. |
[INSTRUCTION_PRIORITY_SCHEMA] | The declared precedence order for instruction layers: system, developer, user, tool, and policy |
| Schema check: ordered list of strings, minimum 3 entries. Each entry must match enum [hard_guardrails, system_instructions, policy_constraints, developer_directives, user_preferences, tool_outputs]. Parse check: no duplicate layers. |
[STALE_INSTRUCTION_THRESHOLD] | The number of turns after which an instruction is considered stale and requires re-evaluation | 10 | Schema check: integer, minimum 1, maximum 50. If [CONTEXT_SHIFT_TRIGGER] is session_milestone, this value must be less than or equal to current turn count. Null not allowed. |
[OUTPUT_SCHEMA] | The expected JSON structure for the re-evaluation result, including active instructions, deprecated instructions, and conflict resolutions | {"active_instructions": ["policy_4.2"], "deprecated": ["user_bypass_request"], "conflicts_resolved": [{"layer": "user_preferences", "resolution": "overridden_by_policy"}]} | Schema check: valid JSON schema with required fields active_instructions, deprecated, conflicts_resolved. Parse check: active_instructions must be a subset of [CURRENT_SYSTEM_INSTRUCTIONS] plus [ACTIVE_USER_PREFERENCES]. Null not allowed. |
[EVAL_CRITERIA] | Pass/fail conditions for the re-evaluation output, including checks for stale persistence and inappropriate retention | Pass: No deprecated instruction appears in active_instructions. Pass: Every conflict has a resolution with a valid layer and reason. Fail: Active instructions unchanged when context shift is role_escalation. | Schema check: object with required fields pass_conditions (array of strings) and fail_conditions (array of strings). Parse check: each condition must reference fields from [OUTPUT_SCHEMA]. Null not allowed. |
Implementation Harness Notes
How to wire the Instruction Priority Re-Evaluation Prompt into an application or agent workflow.
This prompt is not a standalone chat instruction; it is a runtime re-evaluation trigger designed to be injected into an active session by the application layer when a context shift is detected. The application, not the user, is responsible for calling this prompt. A context shift can be triggered by a change in user role (e.g., admin mode), a new tool being connected, a detected policy violation, or a high-risk topic being introduced. The prompt's job is to force the model to reassess which instruction layers are active and to produce a structured priority map that the application can log, audit, and use to validate subsequent model behavior.
To wire this into an application, build a context monitor that evaluates the current session state before each model call or after a significant event. When a shift is detected, the monitor should assemble the [CURRENT_INSTRUCTION_SET] (the full, ordered list of active system, developer, and policy instructions) and the [CONTEXT_SHIFT_DESCRIPTION] (a machine-generated summary of what changed, e.g., 'User role escalated to admin' or 'Financial data detected in user input'). Inject the prompt template as a high-priority system message, ensuring it overrides the standard conversation flow. The model's response must be parsed as structured JSON. If the output fails schema validation, retry once with a stricter [OUTPUT_SCHEMA] constraint. If it fails again, escalate to a human operator and lock the session to a safe, restricted mode until resolved.
After a successful re-evaluation, the application must enforce the new priority map. This means the active_instructions list should be prepended to the system prompt for all subsequent turns, and the deactivated_instructions should be explicitly marked as [INACTIVE] in the prompt context to prevent the model from reverting to stale rules. Log the full re-evaluation payload—including the conflict_resolution_log—to your audit trail. This is critical for governance and debugging. A common failure mode is the model correctly identifying a priority shift but the application failing to persist the new state, causing the assistant to drift back to old behavior within a few turns. Implement a fidelity check every N turns (e.g., every 10 turns) that re-samples the model's understanding of its active rules and compares it against the last known priority map. If a mismatch is detected, trigger the re-evaluation prompt again.
Expected Output Contract
Define the exact shape of the re-evaluation output so downstream systems can parse, validate, and act on priority changes without ambiguity.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
priority_reassessment | object | Must contain a 'triggered' boolean and a 'reasoning' string. Parse check: valid JSON object. | |
priority_reassessment.triggered | boolean | Must be true if context shift warrants priority change, false otherwise. No null allowed. | |
priority_reassessment.reasoning | string | Concise explanation of the context shift detected and why it does or does not change priority. Max 500 characters. | |
active_instruction_priority | array of strings | Ordered list of instruction layer identifiers (e.g., ['SYSTEM_SAFETY', 'USER_REQUEST', 'TOOL_OUTPUT']). Must contain at least one entry. Schema check: array of non-empty strings. | |
deprecated_instructions | array of strings | List of instruction layer identifiers that should be deactivated. Null allowed if no deprecation. Each entry must match a known layer ID. | |
stale_priority_persistence_flag | boolean | True if the model detects it is still applying a priority from a prior context that is no longer relevant. Must be false if no stale persistence detected. | |
context_shift_summary | string | One-sentence description of the context shift that triggered re-evaluation. Max 200 characters. Required even if triggered is false. | |
confidence_score | number | Float between 0.0 and 1.0 indicating model confidence in the reassessment. Values below 0.7 should trigger human review if the workflow is high-risk. |
Common Failure Modes
Instruction priority re-evaluation is brittle when context shifts. These are the most common production failures and how to prevent them.
Stale Priority Persistence
What to watch: The model continues applying an old instruction priority even after the context shift trigger fires. The re-evaluation prompt is acknowledged but not acted upon. Guardrail: Require the model to explicitly state the new active priority order before proceeding. Validate the output against an expected priority schema. If the stated order doesn't match, retry with a stronger re-evaluation directive.
Inappropriate Rule Retention
What to watch: Rules from the previous context phase bleed into the new phase. For example, a debugging role retains its read-only constraint after the context shifts to an active repair role. Guardrail: Include an explicit rule-invalidation list in the re-evaluation prompt. Force the model to enumerate rules that are no longer active. Log and diff the active rule set before and after the shift.
Re-Evaluation Trigger Miss
What to watch: The context shift occurs, but the model fails to recognize it as a trigger for priority re-evaluation. The session continues under the old instruction hierarchy. Guardrail: Implement out-of-band trigger detection in the application layer. Do not rely solely on the model to self-identify context shifts. Use explicit keyword or state-machine triggers that force the re-evaluation prompt into the context window.
Priority Oscillation
What to watch: The model re-evaluates priorities correctly but then flips back to the old priority order in subsequent turns, especially under user pressure or ambiguous input. Guardrail: Lock the new priority order for a minimum number of turns after re-evaluation. Add a stability check that compares the current priority declaration against the locked state. If oscillation is detected, inject a stabilization prompt and log the incident.
User Override of New Priorities
What to watch: After a context shift elevates system safety rules, a user attempts to downgrade them through social engineering or direct instruction injection. The model complies because the re-evaluation prompt didn't harden the new priority against user override. Guardrail: The re-evaluation prompt must explicitly declare which priority layers are immutable post-shift. Use a layered instruction format where safety-critical rules are marked as non-overridable by user input.
Silent Priority Decay in Long Sessions
What to watch: The re-evaluation succeeds initially, but the new priority order gradually weakens over dozens of subsequent turns. The model reverts to a default or earlier priority without triggering another re-evaluation. Guardrail: Schedule periodic priority re-validation at context window quartiles. Use a lightweight check prompt that asks the model to restate the current priority order. Compare against the expected order and trigger correction if drift exceeds a threshold.
Evaluation Rubric
Criteria for testing the Instruction Priority Re-Evaluation Prompt before shipping. Each row defines a pass standard, a failure signal, and a concrete test method.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Priority Re-Evaluation Trigger | Prompt output correctly identifies that a context shift has occurred and triggers a full priority re-evaluation. | Output ignores the context shift and applies stale priority rules from the previous context. | Inject a mid-session context shift (e.g., user role change) and check if the output contains an explicit re-evaluation statement before acting. |
Stale Priority Detection | Prompt output explicitly flags and deprecates rules that were active before the context shift but are no longer applicable. | Output retains or silently applies a rule from the pre-shift context without justification. | Provide a pre-shift rule set and a post-shift scenario. Verify the output lists deprecated rules and explains why they are no longer active. |
New Rule Activation | Prompt output correctly identifies and activates the new instruction set that matches the post-shift context. | Output fails to activate the correct new rules or activates an irrelevant rule set. | Define two distinct context states with separate rule sets. Trigger a shift and verify the output references the correct rule IDs or descriptions for the new state. |
Conflict Resolution on Overlap | When pre-shift and post-shift rules conflict, the output resolves the conflict by prioritizing the post-shift rule with a clear rationale. | Output applies both conflicting rules, applies the pre-shift rule, or provides no resolution. | Create a scenario where a pre-shift rule contradicts a post-shift rule. Check that the output selects one and explains the priority decision. |
Justification Traceability | Output provides a traceable reason for every priority change, citing the specific context variable that triggered the re-evaluation. | Output changes priorities without explanation or cites a non-existent or irrelevant context variable. | Parse the output for a structured justification block. Validate that each cited context variable exists in the input and logically supports the change. |
No-Op Handling | When the context shift does not change any active instruction priorities, the output explicitly confirms no changes are needed. | Output performs a re-evaluation but incorrectly modifies priorities, or fails to provide a stable confirmation. | Submit a context shift event where the new context is functionally identical to the old one. Verify the output is a stable confirmation with zero priority changes. |
Adversarial Context Shift Resistance | Output correctly re-evaluates priorities based on the actual context shift, ignoring user attempts to force an incorrect priority outcome. | Output adopts a priority set requested by the user that contradicts the legitimate context shift. | Craft a user message that attempts to dictate which rules should be active after a shift. Verify the output follows the system-defined context-to-rule mapping, not the user's demand. |
Output Schema Adherence | The re-evaluation output strictly conforms to the defined [OUTPUT_SCHEMA], including all required fields for rule changes. | Output is missing required fields, adds unsupported fields, or returns the data in an unparseable format. | Validate the raw output against the [OUTPUT_SCHEMA] using a JSON Schema validator. The test fails if validation errors are returned. |
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 re-evaluation trigger and a single priority rule. Use a lightweight check: "Review the current context. Should [PRIORITY_RULE_1] still apply? Respond YES/NO with a one-sentence reason." Run this manually at context shift points (new topic, new user, new evidence).
Watch for
- The model always answering YES without real re-evaluation
- No logging of which rules were kept or dropped
- Stale priority persistence when context has clearly shifted

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