Inferensys

Prompt

Role-Based Approval Routing Prompt Template

A practical prompt playbook for using the Role-Based Approval Routing Prompt Template in production AI workflows. Determines which roles or individuals must approve an action before execution, producing a structured routing list with justification.
Wide-angle shot of a modern WeWork open floor plan with creative walls covered in AI system architecture diagrams, product team collaborating in standing desk area with industrial lighting.
PROMPT PLAYBOOK

When to Use This Prompt

Defines the job-to-be-done, ideal user, required context, and clear boundaries for the Role-Based Approval Routing Prompt Template.

This prompt is for enterprise product teams building AI agents that must route high-stakes actions to the correct human approvers before execution. Instead of hardcoding approval paths in application code—which becomes brittle as organizational structures, policies, and risk tolerances change—this prompt encodes organizational policy into the AI workflow. It takes a proposed action, its context, and a role directory, then determines which specific roles or individuals must approve. The output is a structured routing list with justification, ready for consumption by an approval orchestration system. The ideal user is an engineering lead or platform architect who maintains a machine-readable role directory and needs the AI layer to reason over it rather than requiring developers to manually update routing logic for every new action type.

Use this prompt when your organization has a defined role directory but approval paths vary by action type, risk level, or domain. It is particularly effective for internal tools, operational workflows, and enterprise automation where the set of possible actions is known but the routing logic depends on contextual factors like dollar amounts, data sensitivity, environment targets, or cross-team impact. The prompt requires three inputs: a description of the proposed action, relevant context (risk tier, affected systems, change size), and a role directory mapping roles to their approval scope. Without a well-maintained role directory, the prompt will hallucinate plausible-sounding but incorrect approval paths. Before deploying, validate the role directory against your identity provider or HR system of record to ensure role names and scopes match reality.

Do not use this prompt for real-time safety-critical systems where deterministic rule engines are required by regulation. If an incorrect routing decision could cause physical harm, irreversible financial loss, or regulatory violation without a human-in-the-loop safety net, the approval logic belongs in application code with auditable, tested rule evaluation—not in a model's probabilistic reasoning. Similarly, avoid this prompt when the action space is unbounded or poorly defined; the model needs a concrete action description to reason about routing. For workflows where approval paths are completely static, a simple lookup table is cheaper, faster, and more reliable. The next section provides the copy-ready prompt template you can adapt to your organization's role directory and approval policies.

PRACTICAL GUARDRAILS

Use Case Fit

Where this prompt works and where it does not. Use these cards to decide if the Role-Based Approval Routing Prompt Template fits your workflow before you integrate it.

01

Good Fit: Structured Role Directory Available

Use when: your organization maintains a machine-readable role directory (JSON, database, or API) with defined scopes, departments, and authority levels. The prompt needs concrete role definitions to produce accurate routing. Avoid when: roles are informal, undocumented, or defined only in prose documents without clear boundaries.

02

Bad Fit: Ad-Hoc or Political Approval Paths

Avoid when: approval routing depends on unwritten organizational politics, personal relationships, or case-by-case negotiation. The prompt cannot infer informal power structures. Guardrail: if routing rules are undocumented, invest in policy extraction (see Approval Matrix Extraction Prompt) before attempting automated routing.

03

Required Input: Action Context and Risk Signals

What to watch: the prompt needs more than an action name. It requires risk tier, data sensitivity, dollar amount, environment, and affected systems to route correctly. Guardrail: build a pre-processing step that enriches the action with structured metadata before calling the routing prompt. Incomplete context produces incorrect routing.

04

Operational Risk: Role Ambiguity and Overlap

What to watch: when multiple roles could reasonably own an approval, the prompt may produce inconsistent routing or default to the broadest role. Guardrail: implement a confidence check on the routing output. If the prompt flags ambiguity or multiple roles with overlapping scope, escalate to a human routing administrator rather than guessing.

05

Operational Risk: Stale Role Definitions

What to watch: organizational changes, reorgs, and title changes can make the role directory stale. The prompt will route to non-existent or wrong roles. Guardrail: version your role directory, add last-updated timestamps, and implement a pre-check that validates role existence against the current directory before returning the routing list.

06

Not a Replacement: Human Judgment on Edge Cases

What to watch: the prompt cannot determine if an action is ethically questionable, strategically unwise, or politically sensitive. It routes based on defined policy, not wisdom. Guardrail: always include an escalation path for actions that match no clear policy or sit at the boundary of multiple policies. Flag these for human review with the routing ambiguity documented.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A copy-ready prompt that routes an action to the correct human approvers based on role definitions, risk context, and organizational policy.

This prompt template is the core engine for role-based approval routing. It takes a proposed action, its operational context, and a structured directory of organizational roles, then determines which specific roles or individuals must approve before the action can proceed. The output is a machine-readable routing list with justification for each required approver, designed to be consumed by a downstream workflow engine or a human review queue. Use this template when you need to encode organizational policy into an AI workflow without hardcoding every approval path in application code.

text
You are an approval routing specialist for a regulated enterprise environment. Your job is to determine which roles or individuals must approve a proposed action before it can be executed. You will receive an action description, contextual metadata, and a role directory. You must output a structured routing list with justification for each required approver.

## INPUT

### Proposed Action
[ACTION_DESCRIPTION]

### Action Context
- Risk Tier: [RISK_TIER]
- Affected Systems: [AFFECTED_SYSTEMS]
- Data Sensitivity: [DATA_SENSITIVITY]
- Dollar Amount (if applicable): [DOLLAR_AMOUNT]
- Environment: [ENVIRONMENT]
- Requester Role: [REQUESTER_ROLE]
- Regulatory Frameworks: [REGULATORY_FRAMEWORKS]

### Role Directory
[ROLE_DIRECTORY]

## CONSTRAINTS
- Do not invent roles not present in the Role Directory.
- If no single role clearly owns the decision, escalate to a default authority specified in [ESCALATION_ROLE].
- If the action spans multiple domains, sequence approvals logically (e.g., security before legal before executive).
- If the action is reversible and low-risk, a single approver may suffice. If irreversible or high-risk, require multi-stakeholder signoff.
- For any action involving PII, financial commitments, or production changes, require at least one senior reviewer.

## OUTPUT SCHEMA
Return a JSON object with the following structure:
{
  "routing_decision": {
    "approval_type": "single_approver | multi_stakeholder | executive_signoff | auto_approve",
    "approvers": [
      {
        "role": "string",
        "individual": "string | null",
        "sequence": "integer",
        "justification": "string explaining why this role is required",
        "condition": "string describing the triggering condition",
        "timeout_hours": "integer"
      }
    ],
    "escalation": {
      "role": "string | null",
      "trigger": "string explaining when escalation occurs"
    },
    "blocking_conditions": ["string describing any conditions that block execution entirely"],
    "confidence": "high | medium | low",
    "uncertainty_notes": "string explaining any ambiguity in the routing decision"
  }
}

Adaptation guidance: Replace the square-bracket placeholders with live data before sending to the model. The [ROLE_DIRECTORY] should be a structured list of roles, their authorities, and any constraints (e.g., "Security Officer: can approve access changes up to Tier 3; requires CISO co-approval for Tier 4+"). The [ESCALATION_ROLE] is a fallback when no role clearly owns the decision—typically a department head or compliance officer. Use Structured Outputs or JSON mode in your model API to enforce the schema. For high-risk domains (finance, healthcare, critical infrastructure), always route the output to a human review queue rather than executing automatically, even if the model returns auto_approve.

IMPLEMENTATION TABLE

Prompt Variables

Every placeholder the Role-Based Approval Routing prompt expects, why it matters, and how to validate it before sending. Use this table to ensure your application layer provides complete, well-formed inputs.

PlaceholderPurposeExampleValidation Notes

[ACTION_DESCRIPTION]

The specific action requiring approval, described in operational terms.

Delete production database records for user ID 58291.

Must be non-empty. Check for vague verbs like 'handle' or 'manage'. Reject if action is not a discrete, executable step.

[ACTION_CONTEXT]

Surrounding circumstances: who initiated it, why, and any relevant history.

Initiated by on-call engineer via incident #INC-421. User requested data purge under GDPR Article 17.

Must include initiator role and trigger reason. Validate that context does not contain contradictory statements about urgency or scope.

[ROLE_DIRECTORY]

A structured list of available roles, their responsibilities, and current assignees.

{"roles": [{"id": "dpo", "title": "Data Protection Officer", "assignee": "jane.smith"}]}

Parse as valid JSON. Confirm each role object has 'id', 'title', and 'assignee' fields. Reject if directory is empty or contains duplicate role IDs.

[ORGANIZATIONAL_POLICY]

Rules defining who must approve what, including thresholds and conditions.

Any action involving PII deletion requires sequential approval from DPO and VP Engineering.

Must be a non-empty string or structured object. Validate that policy statements reference roles present in [ROLE_DIRECTORY]. Flag policies with unresolvable conditions.

[RISK_ASSESSMENT]

Pre-computed risk tier or score for the action, if available.

{"risk_tier": "high", "score": 85, "factors": ["data_destruction", "regulatory_impact"]}

If provided, parse as valid JSON. Validate that 'risk_tier' maps to a known enum value. Allow null if risk is not pre-assessed, but log a warning.

[OUTPUT_SCHEMA]

The exact JSON schema the routing list must conform to.

{"type": "object", "properties": {"approval_sequence": {"type": "array"}}, "required": ["approval_sequence", "justification"]}

Must be a valid JSON Schema object. Confirm 'approval_sequence' is a required array property. Reject schemas that permit empty sequences without an explicit 'auto_approved' flag.

[CONSTRAINTS]

Hard limits on the routing decision, such as maximum approvers or required quorum.

Maximum 3 approvers. At least one approver must have 'security' in their role title. No self-approval.

Parse as a list of constraint strings. Validate that constraints do not conflict with each other or with [ORGANIZATIONAL_POLICY]. Flag constraints that reference roles not in [ROLE_DIRECTORY].

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the role-based approval routing prompt into an application or agent workflow with validation, logging, and escalation handling.

The prompt is one component in a larger approval orchestration system. Before calling the model, assemble the role directory from your identity provider or HR system. Validate that every role referenced in the directory exists and has a defined scope. This prevents the model from hallucinating roles that don't exist in your organization. The directory should be a structured object mapping role identifiers to display names, scope descriptions, and any conditional constraints (e.g., 'VP of Engineering' only approves infrastructure changes above $50k). Pass this directory into the prompt's [ROLE_DIRECTORY] placeholder as a JSON array of role objects with id, name, scope, and constraints fields.

After receiving the model output, validate the JSON structure against the output contract before acting on it. The expected schema is an object with an approvers array, where each element contains role_id, justification, sequence_order, and optional escalation_to and timeout_minutes fields. Use a JSON Schema validator in your application layer to catch malformed responses. If validation fails, re-invoke the prompt with the error details appended to [CONSTRAINTS] rather than silently falling back to a default routing. For each approver in the routing list, resolve the role_id to actual user identities using your directory service—this is a deterministic lookup that should never rely on the model. If the model returns an escalation_to path, log it and notify the escalation target immediately rather than waiting for the timeout to expire.

Always log the full prompt, response, and resolved approver list for audit purposes. This is critical for regulated workflows where you must demonstrate who approved what and why. Store these logs in an append-only audit store with timestamps and request IDs. Implement a timeout mechanism: if an approver does not respond within the configured SLA window, re-invoke the prompt with the updated state (including which approvers have and haven't responded) to determine the next escalation step. Never execute the action until all required approvals are collected and verified. For model choice, prefer a model with strong JSON-following behavior (GPT-4o, Claude 3.5 Sonnet, or equivalent) and set temperature=0 to minimize routing variability. If your approval policies change frequently, consider implementing a RAG retrieval step that pulls the latest policy documents into [CONTEXT] before each invocation rather than hardcoding policy into the prompt itself.

IMPLEMENTATION TABLE

Expected Output Contract

The exact fields, types, and validation rules the model output must satisfy before the approval workflow proceeds. Use this contract to build a post-processing validator that rejects non-conforming outputs and triggers retry or human review.

Field or ElementType or FormatRequiredValidation Rule

approval_routing

Array of objects

Array length >= 1. Reject if empty when action requires approval.

approval_routing[].role

String matching [ROLE_DIRECTORY] key

Must exist in provided role directory. Reject unknown roles; escalate for human role mapping.

approval_routing[].individual_id

String or null

If provided, must match [USER_ID] format. Null allowed when role-based routing is sufficient.

approval_routing[].sequence_order

Integer >= 1

Must be unique and sequential starting from 1. Reject gaps or duplicates.

approval_routing[].is_parallel

Boolean

Must be true or false. If true, all approvers at this sequence order can approve concurrently.

approval_routing[].justification

String

Must be 1-3 sentences referencing the action type, risk factor, or policy clause that triggered this routing. Reject empty or generic justifications.

escalation_path

Object

Must contain fallback_role and timeout_hours. Reject if missing when no single role clearly owns the decision.

escalation_path.fallback_role

String matching [ROLE_DIRECTORY] key

Must be a valid role. Reject if same as any primary routing role without explicit justification.

escalation_path.timeout_hours

Integer >= 1

Must be a positive integer. Reject if 0 or negative. Default to 24 if not specified in policy.

ambiguity_flag

Boolean

Must be true if multiple roles could reasonably own the decision and the model is uncertain. Triggers human review of the routing itself.

ambiguity_notes

String or null

Required when ambiguity_flag is true. Must describe the conflicting role claims. Reject if ambiguity_flag is true and this is null or empty.

PRACTICAL GUARDRAILS

Common Failure Modes

Role-based approval routing fails silently when role definitions are ambiguous, organizational context is missing, or the model guesses instead of escalating. These are the most common production failure patterns and how to guard against them.

01

Role Ambiguity Leads to No Routing

What to watch: The model encounters an action that could map to multiple roles (e.g., 'Admin' vs 'System Admin' vs 'Platform Admin') and either picks one arbitrarily or returns an empty routing list. This happens when the role directory uses overlapping or poorly differentiated titles. Guardrail: Require the prompt to output a confidence score per role match. If no role scores above a defined threshold, force escalation to a default 'unresolved' queue with the ambiguous candidates listed for human triage.

02

Missing Role Definitions Cause Silent Defaults

What to watch: A new action type or team is introduced, but the role directory hasn't been updated. The model maps the action to a generic catch-all role like 'Manager' or fabricates a plausible-sounding role that doesn't exist. Guardrail: Include a strict instruction that the model must only select from the provided role directory. If no role matches, it must output a structured 'ROLE_NOT_FOUND' error with the action context, never a guess. Validate the output against the directory schema before routing.

03

Escalation Bypass on Low-Risk Actions

What to watch: The model classifies a genuinely risky action as low-risk due to missing context (e.g., a 'config change' that actually modifies a security group) and routes it for auto-approval instead of human review. Guardrail: Pair the routing prompt with a separate risk-classification step that runs first. The routing prompt must receive a pre-computed risk score as input and use it as a hard constraint—any action above a risk threshold must include a human approver regardless of role mapping.

04

Stale Organizational Context Produces Wrong Approvers

What to watch: The role directory is cached or hardcoded in the prompt and becomes stale. People change roles, teams reorganize, and the model routes to approvers who no longer own the decision. Guardrail: Treat the role directory as a dynamic retrieval artifact, not a static prompt prefix. Fetch the current directory at inference time and inject it into the prompt. Add a 'last_updated' timestamp to the directory and instruct the model to refuse routing if the data is older than a configurable threshold.

05

Multi-Stakeholder Deadlocks Without Resolution Rules

What to watch: The model correctly identifies that multiple roles must approve, but the approval sequence has no tiebreaker, timeout, or escalation path. The workflow stalls indefinitely. Guardrail: The prompt must generate not just the approver list but also sequencing rules, timeout durations, and an escalation role for unresolved blocks. Include a 'deadlock_escalation' field in the output schema that names who decides when consensus fails.

06

Over-Confident Justifications Mask Errors

What to watch: The model generates fluent, authoritative-sounding justifications for its routing decisions even when the underlying mapping is wrong. Reviewers trust the prose and approve incorrect routings. Guardrail: Require the justification to cite specific fields from the role directory and action context. If the model cannot cite a matching field, it must output 'INSUFFICIENT_EVIDENCE' instead of a rhetorical justification. Log all justifications for audit sampling.

IMPLEMENTATION TABLE

Evaluation Rubric

Run these checks against a golden dataset of 50 or more action-role directory pairs to validate output quality before shipping.

CriterionPass StandardFailure SignalTest Method

Role Resolution Accuracy

Every approver role in the output matches a role defined in [ROLE_DIRECTORY] for the given [ACTION_CONTEXT]

Output contains a role title not present in the provided directory or hallucinates a department name

Schema check: extract all role strings from output, assert each is a substring match or exact match against [ROLE_DIRECTORY] entries

Routing Justification Grounding

Every justification sentence references a specific field from [ACTION_CONTEXT] or a specific rule from [APPROVAL_POLICY]

Justification contains generic reasoning with no source anchor, or cites a policy rule not provided in the prompt

LLM-as-judge: for each justification, check if it contains a direct quote or paraphrase of a provided input field; flag if absent

Approval Sequence Ordering

When [APPROVAL_POLICY] specifies sequential approval, the output list order matches the required sequence with no skipped stages

Output reorders approvers contrary to policy, or inserts an approver between two that must be consecutive

Deterministic comparator: parse output approver list, compare index positions against expected sequence from policy; fail if any position mismatch

Conditional Rule Application

For actions with risk tier, dollar amount, or data sensitivity conditions, the output includes only approvers whose triggering conditions are met

Output includes an approver whose condition is not satisfied by [ACTION_CONTEXT], or omits one whose condition is met

Unit test: for each test case with known conditions, assert the set of output approvers exactly matches the expected set derived from policy rules

Escalation Trigger Correctness

When no single role clearly owns the decision, output includes an escalation path with a specific fallback role or review queue

Output assigns a single approver with low confidence or returns an empty list without escalation when ownership is ambiguous

Confidence threshold check: if model confidence score in output is below 0.8, assert escalation field is populated with a valid role from [ROLE_DIRECTORY]

Output Schema Compliance

Output is valid JSON matching the [OUTPUT_SCHEMA] with all required fields present and no extra top-level keys

Output is missing required fields, contains malformed JSON, or includes fields not defined in the schema

Schema validator: parse output as JSON, validate against [OUTPUT_SCHEMA] using a JSON Schema validator; fail on any validation error

Conflict of Interest Detection

When [APPROVAL_POLICY] specifies separation-of-duty constraints, no single approver appears in conflicting roles in the same routing list

The same individual or role appears as both requester and approver, or holds two mutually exclusive approval roles

Rule-based check: extract all approver identifiers, cross-reference against separation-of-duty pairs in policy; fail if any conflict detected

Timeout and SLA Inclusion

When [ACTION_CONTEXT] includes urgency or SLA metadata, output includes escalation timeout or expected response window per approver

Output omits timeout values for time-sensitive actions, or assigns the same timeout to all approvers regardless of policy

Field presence check: if [ACTION_CONTEXT] contains urgency or SLA fields, assert output contains timeout or response_window per approver; fail if absent

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Use the base prompt with a static role directory passed inline. Replace the [ROLE_DIRECTORY] placeholder with a hardcoded JSON list of 5-10 roles. Skip schema validation and logging. Focus on getting correct routing for 3-5 test actions.

Watch for

  • Role name typos causing missed matches
  • Overly broad instructions that route everything to "manager"
  • No handling when no role matches
Prasad Kumkar

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.