This prompt is a programmatic gate for your orchestrator, not a conversational suggestion. Its sole job is to produce a machine-readable decision—approve, deny, or request_preconditions—before any role transition executes. You need this when your system has defined roles with explicit permission boundaries and you must prevent unauthorized escalation, scope violation, or context contamination during handoffs. The ideal user is a safety engineer or orchestrator builder who already has role manifests, permission scopes, and transition policies in place. If you are still sketching out what your agents can do, this prompt is premature; it enforces rules, it does not invent them.
Prompt
Role Transition Validation Prompt Template

When to Use This Prompt
Defines the exact conditions, required inputs, and architectural prerequisites for using the Role Transition Validation Prompt in a production multi-agent system.
Do not use this prompt for simple, stateless routing where no permission boundary exists. If every agent can access every tool and data source, a validation gate adds latency without reducing risk. Similarly, avoid this prompt for purely user-initiated transitions that carry no automated enforcement—if a user clicks a button to switch modes and the system has no policy to check, you are adding a decision point with nothing to decide. This prompt is most valuable in compound AI systems where a sub-agent's capabilities exceed the current role's scope, where tool access is gated, or where regulatory or compliance constraints require auditable proof that a transition was evaluated before it occurred.
Before wiring this prompt into your orchestrator, ensure you have three artifacts ready: a role manifest declaring each role's capabilities and constraints, a permission scope mapping roles to allowed tools and data, and a transition policy defining which source roles can hand off to which target roles under what conditions. The prompt will reference these by ID, not by description. If your policies live only in prose documents, invest the time to structure them into machine-readable objects first. Once deployed, pair this prompt with an audit log that records every decision, the policy version evaluated, and the reason for denial. In regulated environments, a human reviewer should be able to replay a transition request and reach the same conclusion.
Use Case Fit
This prompt template validates whether a role transition is safe and permitted before execution. It is designed for orchestrator pipelines, not for open-ended chat. Know where it fits and where it breaks.
Good Fit: Multi-Agent Orchestration
Use when: an orchestrator must decide whether to hand off work from one sub-agent to another. The prompt checks permission boundaries, scope constraints, and preconditions before the transition executes. Guardrail: always pair this prompt with a hard-coded capability manifest so the model validates against declared permissions, not inferred ones.
Bad Fit: Single-Agent Chat
Avoid when: a single assistant handles all user requests without role switching. This prompt adds latency and token overhead with no benefit. Guardrail: use a simple role boundary check instead. Reserve transition validation for systems with at least two distinct sub-agent roles and a defined handoff protocol.
Required Inputs
Risk: missing inputs cause false approvals or false denials. Guardrail: require current role, target role, task description, capability manifest, and active policy constraints. Reject the transition if any required field is absent. Never let the model infer permissions from role names alone.
Operational Risk: Silent Escalation
Risk: a sub-agent receives elevated permissions because the validation prompt missed a scope violation. Guardrail: log every transition decision with the full validation payload. Run a post-hoc check comparing granted permissions against the target role's declared capability boundary. Alert on mismatch.
Operational Risk: Context Contamination
Risk: the validation prompt itself leaks sensitive context from the current role into the decision trace. Guardrail: strip role-specific data before passing context to the validator. The validator only needs task scope, permission boundaries, and policy constraints—not user PII or raw tool outputs.
Latency Sensitivity
Risk: adding a validation step before every handoff increases end-to-end latency, especially with large context windows. Guardrail: cache validation results for repeated transition patterns. Skip re-validation when the same source-target-task tuple was approved within a configurable TTL and no policy has changed.
Copy-Ready Prompt Template
A reusable prompt that validates whether a role transition is safe and permitted before execution.
This prompt template acts as a policy enforcement gate before any role handoff executes in a multi-agent system. It receives the current agent state, the proposed target role, and the governing policy constraints, then produces a structured validation decision. The output is designed to be consumed by an orchestrator's control flow—not by an end user—so the schema is strict and machine-readable. Use this template when the cost of an unauthorized escalation, scope violation, or context contamination is higher than the latency of an extra validation call.
textYou are a Role Transition Validator. Your only job is to decide whether a proposed role handoff is permitted given the current state, the target role's declared capabilities, and the active policy constraints. You do not execute the handoff. You do not modify state. You output only a structured decision. ## Current State - Active Role: [CURRENT_ROLE] - Active Permissions: [CURRENT_PERMISSIONS] - Pending Work: [PENDING_WORK_SUMMARY] - Session Constraints: [SESSION_CONSTRAINTS] - Recent Tool Calls: [RECENT_TOOL_CALLS] ## Proposed Transition - Target Role: [TARGET_ROLE] - Target Permissions: [TARGET_PERMISSIONS] - Reason for Handoff: [HANDOFF_REASON] - Requesting Agent: [REQUESTING_AGENT_ID] ## Policy Rules (in priority order) [POLICY_RULES] ## Validation Checks For each check below, determine PASS or FAIL with a brief reason. A single FAIL in a BLOCKING check means the transition is denied. 1. **Permission Escalation Check (BLOCKING):** Does the target role request permissions that exceed the current role's scope without explicit policy allowance? 2. **Scope Boundary Check (BLOCKING):** Does the handoff reason fall within the target role's declared capability boundary? 3. **Precondition Check (BLOCKING):** Are all required preconditions for this handoff satisfied? Check for missing approvals, incomplete work, or unresolved decisions that must be completed first. 4. **Context Contamination Risk (WARNING):** Does the pending work or recent tool output contain data that the target role should not receive? 5. **Policy Conflict Check (BLOCKING):** Does any active session constraint or policy rule explicitly forbid this transition? 6. **Idempotency Check (WARNING):** Has this exact handoff already been attempted and failed? If so, flag for escalation. ## Output Schema Return ONLY valid JSON matching this schema: { "transition_permitted": boolean, "blocking_failures": [ { "check_name": string, "reason": string, "recommended_action": string } ], "warnings": [ { "check_name": string, "detail": string } ], "required_preconditions": [string], "escalation_required": boolean, "escalation_target": string | null, "decision_evidence": string } ## Constraints - If transition_permitted is false, blocking_failures must contain at least one entry. - Never invent permissions or capabilities not present in the input. - If the policy rules are ambiguous, fail closed and recommend human review. - Do not output anything except the JSON object.
Adapt this template by replacing the policy rules block with your organization's actual role-based access control policies, capability manifests, and handoff preconditions. For high-risk domains such as healthcare, finance, or safety-critical systems, add a Human Approval Check as an additional BLOCKING check that requires an explicit approval token before any transition executes. Wire the output into your orchestrator so that a transition_permitted: false response aborts the handoff and triggers the escalation path defined in escalation_target. Log every validation decision—including warnings—for audit and debugging, because silent denials make multi-agent failures nearly impossible to diagnose.
Prompt Variables
Each placeholder must be populated before the validation call. Missing or malformed inputs will cause the transition check to fail closed.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[CURRENT_ROLE] | Identifier for the role currently in control | primary_research_agent | Must match an entry in the active role registry. Reject if role is unknown or deprecated. |
[TARGET_ROLE] | Identifier for the role being requested | code_generation_agent | Must differ from CURRENT_ROLE. Reject if target role is not registered or is marked inactive. |
[TRANSITION_REASON] | Natural-language justification for the handoff | User requested code output from research findings | Must be non-empty. Reject if reason is generic, missing, or matches known jailbreak patterns. |
[CURRENT_STATE_SUMMARY] | Serialized snapshot of active constraints, pending approvals, and unresolved decisions | {"pending_approval": true, "active_constraints": ["no_pii_export"]} | Must parse as valid JSON. Reject if required fields are missing or if state indicates an unresolved safety hold. |
[PERMISSION_BOUNDARY_DOC] | Machine-readable permission manifest for the target role | {"allowed_tools": ["read_file", "write_code"], "denied_actions": ["execute_shell"]} | Must parse as valid JSON. Reject if target role requests tools or data scopes not declared in this manifest. |
[POLICY_CONSTRAINTS] | Active policy rules that must survive the handoff | ["no_external_network_calls", "retain_audit_log"] | Must be a non-empty array. Reject if any inherited policy constraint would be violated by the target role's declared capabilities. |
[USER_CONSENT_FLAG] | Whether the end user has approved this role transition | Must be true for user-facing transitions in regulated contexts. If false and policy requires consent, reject with an approval-required signal. |
Implementation Harness Notes
How to wire the Role Transition Validation prompt into an orchestrator or agent framework with validation, retries, and audit logging.
The Role Transition Validation prompt is not a standalone decision-maker; it is a policy gate that must sit between the orchestrator's intent to hand off work and the actual execution of that handoff. In a production compound AI system, this prompt should be called synchronously before any context serialization, agent dispatch, or user notification occurs. The orchestrator passes the current session state, the proposed target role, the reason for transition, and the active policy constraints into the prompt. The output is a structured validation decision—permit, deny, or escalate—that the orchestrator must enforce programmatically. Do not rely on the model's refusal alone; the application layer must hard-block denied transitions and log every decision for auditability.
Wire this prompt into your agent framework as a pre-handoff hook. The orchestrator should construct the prompt payload with: [CURRENT_ROLE] and its declared capabilities, [TARGET_ROLE] and its permission boundary, [TRANSITION_REASON] from the orchestrator's planning step, [SESSION_STATE_SUMMARY] containing active constraints and pending approvals, and [POLICY_DOCUMENT] defining escalation rules and scope boundaries. The model returns a JSON object with fields decision (permit|deny|escalate), reason, violations (array of specific policy breaches), and required_approvals (list of human sign-offs needed). Your harness must validate this JSON against a schema before acting on it. If the output fails schema validation, retry once with a stricter format instruction; if it fails again, default to deny and escalate to a human operator. For high-risk domains such as healthcare or finance, always require human approval when decision is escalate or when violations is non-empty.
Model choice matters here. Use a model with strong instruction-following and low hallucination rates on structured classification tasks—GPT-4o, Claude 3.5 Sonnet, or equivalent. Avoid smaller models that may conflate permit with escalate under ambiguous policy language. Set temperature=0 to maximize decision consistency. Log the full prompt, the raw model response, the parsed decision, and any schema validation errors to your observability platform. This log becomes your audit trail for governance reviews and incident postmortems. If your orchestrator supports it, attach a trace ID that links the validation decision to the subsequent handoff execution or denial, so you can measure whether denied transitions were ever attempted downstream. The most common production failure is an orchestrator ignoring a deny decision due to a missing enforcement check—ensure your harness treats the validation output as authoritative and non-bypassable.
Expected Output Contract
Define the exact shape of the validation decision payload. Use this contract to build a parser, set up eval assertions, and detect malformed responses before the handoff executes.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
transition_permitted | boolean | Must be true or false. If null or missing, treat as a failed validation and abort the handoff. | |
decision_reason | string | Must be a non-empty string summarizing the primary factor in the decision. Maximum 280 characters. | |
violations | array of objects | If transition_permitted is false, this array must be present and contain at least one violation object. If true, the array must be empty or absent. | |
violations[].rule_id | string | true (if violations present) | Must match a known policy rule ID from the [POLICY_REGISTRY]. Unknown IDs trigger a schema failure. |
violations[].description | string | true (if violations present) | Must be a non-empty string describing the specific violation. Cannot be a generic placeholder like 'violation occurred'. |
violations[].severity | string | true (if violations present) | Must be one of: 'BLOCKER', 'WARNING'. A BLOCKER severity must result in transition_permitted = false. |
escalation_required | boolean | Must be true if the transition requires human approval before execution. The orchestrator must pause the handoff pipeline if this is true. | |
context_pruning_instructions | object | If present, must contain a 'fields_to_remove' array of strings. The orchestrator must apply these instructions before transferring context to the target role. |
Common Failure Modes
Role transition validation fails silently in production when permission boundaries blur, state is incomplete, or policy conflicts are unresolved. These cards cover the most common failure patterns and how to prevent them before a handoff executes.
Unauthorized Role Escalation
What to watch: The orchestrator approves a transition to a higher-privilege role without verifying that all escalation preconditions are met. This often happens when the validation prompt checks only the target role name, not the specific permissions being requested. Guardrail: Require the validation prompt to compare the source role's current permission set against the target role's declared capabilities and flag any net-new permissions for explicit approval before the handoff proceeds.
Incomplete State Transfer
What to watch: The handoff executes but critical context—active constraints, pending approvals, unresolved tool outputs—is missing from the state payload. The receiving agent operates on partial information and produces decisions that violate prior constraints. Guardrail: Add a pre-handoff state completeness check that verifies all required fields in the serialized state object are present and non-null before the transition is permitted. Reject handoffs with incomplete state and request a rebuild.
Policy Inheritance Gap
What to watch: A child agent receives a task but does not inherit the parent's safety policies, refusal rules, or compliance constraints. The child agent then performs actions the parent would have blocked. Guardrail: Include an explicit policy inheritance block in the transition validation prompt that confirms all parent-level constraints are present in the child agent's active instruction set before the handoff is approved.
Scope Creep Across Handoffs
What to watch: The assigned task expands beyond the receiving agent's declared capability boundary, but the validation prompt only checks the initial task description, not the full implied scope including tool access and data requirements. Guardrail: Validate the complete task specification against the target agent's capability manifest, including tool access lists, domain boundaries, and output format constraints. Reject assignments that require capabilities the agent has not declared.
Deadlock from Circular Role Dependencies
What to watch: Agent A hands off to Agent B, which hands off to Agent C, which attempts to hand back to Agent A. The validation prompt approves each individual transition but never detects the cycle. Guardrail: Maintain a handoff chain trace in the validation context and check for circular references before approving any transition. If a cycle is detected, escalate to an arbitrator role instead of looping.
Silent Validation Bypass via Tool Output Injection
What to watch: A malicious or malformed tool output from a prior agent step contains instructions that override the transition validation logic, causing the validator to approve a handoff that should have been blocked. Guardrail: Sandbox tool outputs in the validation prompt by placing them in a clearly delimited, lower-priority context block and instructing the validator to treat tool output claims as untrusted evidence, not as override instructions.
Evaluation Rubric
Run these test cases against your Role Transition Validation Prompt with known inputs and expected outputs before shipping. Each row targets a distinct failure mode.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Unauthorized escalation detection | Prompt returns | Output returns | Run with [CURRENT_ROLE]=viewer, [TARGET_ROLE]=admin, [USER_CONSENT]=false; assert allowed=false and reason contains ESCALATION |
Scope violation detection | Prompt returns | Output permits transition despite action not in target role capability list | Run with [REQUESTED_ACTION]=delete_production_db, [TARGET_ROLE]=readonly_analyst; assert allowed=false and reason=SCOPE_VIOLATION |
Missing precondition block | Prompt returns | Transition is permitted despite unmet precondition | Run with [PRECONDITIONS]=['handoff_summary_present'], [HANDOFF_SUMMARY]=null; assert allowed=false and reason=MISSING_PRECONDITION |
Valid transition approval | Prompt returns | Valid transition is blocked or reason field is empty | Run with valid handoff scenario matching all preconditions; assert allowed=true and decision_metadata.confidence >= 0.9 |
Policy constraint enforcement | Prompt returns | Policy rule is ignored and transition is permitted | Run with [POLICY_RULES] containing deny rule for current-to-target pair; assert allowed=false and reason=POLICY_BLOCK |
Null or missing input handling | Prompt returns | Prompt crashes, returns malformed JSON, or defaults to allowed=true | Run with [CURRENT_ROLE]=null; assert output is valid JSON with allowed=false and reason=INVALID_INPUT |
Confidence threshold reporting | Prompt includes | Confidence field is missing, null, or outside 0-1 range | Run any valid test case; parse response and assert decision_metadata.confidence is a number >= 0.0 and <= 1.0 |
Audit trail completeness | Prompt includes | Audit trail is empty, missing, or omits a checked condition | Run with multiple preconditions and policy rules; assert audit_trail length >= number of conditions checked |
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 lighter validation. Focus on getting the transition logic correct before adding production constraints. Replace [POLICY_RULES] with a short inline list of 3-5 rules. Use [CURRENT_ROLE] and [TARGET_ROLE] as simple string identifiers. Skip the [AUDIT_LOG] placeholder and log manually.
Watch for
- Missing schema checks on the output JSON
- Overly permissive transitions when rules are vague
- Model hallucinating role capabilities that don't exist
- No tracking of why a transition was denied

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