Inferensys

Prompt

Tool Authorization Policy for Multi-Agent Systems Prompt Template

A practical prompt playbook for using Tool Authorization Policy for Multi-Agent Systems Prompt Template in production AI workflows.
Developer demonstrating multi-agent tool use, agent tool selection interface on laptop, casual tech demo moment.
PROMPT PLAYBOOK

When to Use This Prompt

Defines the ideal scenario, required inputs, and explicit boundaries for deploying a multi-agent tool authorization policy prompt.

This prompt is for AI platform engineers coordinating tool access across multiple specialized agents within a single system. Use it when you have a multi-agent architecture where each agent has a distinct role and tool scope, and you need a single, authoritative system prompt that defines per-agent tool scopes, prevents tool access leakage between agents, and handles inter-agent tool delegation with explicit authorization checks. The primary job-to-be-done is establishing a clear, machine-enforceable contract that the model can interpret to prevent Agent A from silently using a tool that only Agent B should access, or from delegating a sensitive operation without proper authorization context.

You should not use this prompt for single-agent assistants, simple chatbot tool calling, or systems where all agents share the same flat tool permissions. It assumes you already have stable agent role definitions, a tool catalog with unique identifiers, and an execution layer that can enforce the authorization decisions made by the prompt. The ideal user is an AI platform engineer who needs to define authorization logic in the prompt layer before it reaches the execution layer, and who understands that this prompt is a policy document, not a runtime enforcement mechanism. You will need to provide the agent role definitions, the tool catalog with per-tool risk levels, and the delegation rules as inputs to the template.

Before using this prompt, confirm that your execution layer can act on the authorization decisions the model produces. If your runtime cannot enforce a denial, this prompt alone is insufficient. The prompt works best when paired with structured output validation that checks for unauthorized tool calls in the model's response, and with logging that captures authorization decisions for audit. Do not use this prompt as a substitute for runtime access control; it is a policy specification layer that reduces ambiguity and guides model behavior, but it must be backed by deterministic enforcement in your application code. Proceed by gathering your agent role definitions, tool catalog, and delegation rules, then adapt the template in the next section.

PRACTICAL GUARDRAILS

Use Case Fit

Where this prompt works, where it fails, and the operational preconditions required before deploying it in a multi-agent system.

01

Good Fit: Heterogeneous Agent Teams

Use when: you have multiple specialized agents (planner, coder, data analyst) that share a tool catalog but must not access each other's privileged tools. Guardrail: Define explicit agent_role and tool_scope mappings in the system prompt and test for cross-agent tool leakage.

02

Bad Fit: Single-Agent Architectures

Avoid when: only one agent exists in the system. A multi-agent authorization policy adds unnecessary complexity and token overhead. Guardrail: Use a simpler, single-agent tool authorization prompt and only introduce this template when a second agent with distinct permissions is added.

03

Required Input: Agent-to-Tool Permission Map

Risk: Without a structured mapping of which agent can call which tool, the prompt becomes ambiguous and authorization gaps appear. Guardrail: Provide a strict [AGENT_TOOL_MAP] as a JSON or table defining allowed tools per agent ID, including read vs. write distinctions.

04

Required Input: Inter-Agent Delegation Rules

Risk: Agents may attempt to route restricted tool calls through other agents to bypass their own scope. Guardrail: Supply explicit [DELEGATION_RULES] that state whether delegation is allowed, which tools are delegable, and how the receiving agent must re-verify authorization.

05

Operational Risk: Authorization Drift in Long-Running Tasks

Risk: Agent roles or permissions may change mid-session, but a cached system prompt won't reflect the update. Guardrail: Inject a short-lived [AUTH_CONTEXT] block at the top of each turn with a policy_version and expires_at timestamp. Re-resolve permissions on expiration.

06

Operational Risk: Tool Name Collisions

Risk: Two agents may have tools with the same name but different authorization scopes, causing the model to apply the wrong policy. Guardrail: Use fully qualified tool names (e.g., agent_data_store:read) in the authorization policy and validate that no unqualified aliases exist in the tool definitions.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A reusable system prompt for defining per-agent tool scopes, preventing tool access leakage, and handling inter-agent delegation with authorization checks in multi-agent systems.

This template encodes a tool authorization policy directly into the system prompt for a multi-agent coordinator or a specialized agent. It is designed to be the single source of truth for tool access boundaries before any execution-layer enforcement. The prompt uses square-bracket placeholders for all dynamic values—replace each one with your production configuration before deployment. The structure separates the agent's identity, its explicit tool allowlist, delegation rules, and strict output formatting requirements to make authorization decisions auditable and testable.

markdown
# SYSTEM INSTRUCTION: Tool Authorization Policy

## Identity and Scope
You are [AGENT_NAME], a specialized agent within the [SYSTEM_NAME] multi-agent system. Your primary function is [AGENT_PURPOSE]. You operate under a strict tool authorization policy. You are prohibited from performing any action not explicitly granted below.

## Authorized Tools
You are permitted to call ONLY the following tools. Any attempt to call a tool not on this list must be refused.

| Tool Name | Permitted Arguments | Constraints |
|-----------|---------------------|-------------|
| [TOOL_NAME_1] | [ARG_1], [ARG_2] | [CONSTRAINT_1] |
| [TOOL_NAME_2] | [ARG_1] | [CONSTRAINT_2] |

## Tool Call Protocol
1. Before every tool call, verify the tool name is in your Authorized Tools table.
2. Verify all provided arguments match the Permitted Arguments column.
3. Verify the call context satisfies all Constraints.
4. If any check fails, do not call the tool. Instead, respond with the exact refusal format below.

## Inter-Agent Delegation
You may delegate a task to another agent ONLY if the target agent is listed below and the task falls within that agent's declared scope. When delegating, you must output a structured delegation message.

| Agent Name | Delegated Scope | Authorization Required |
|------------|-----------------|------------------------|
| [AGENT_B] | [SCOPE_DESCRIPTION] | [YES/NO] |
| [AGENT_C] | [SCOPE_DESCRIPTION] | [YES/NO] |

If Authorization Required is YES, you must request and receive explicit user confirmation before sending the delegation message. Output the confirmation request using the [CONFIRMATION_FORMAT] specified below.

## Output Formats

### Refusal (Unauthorized Tool Call)
```json
{
  "decision": "REFUSED",
  "reason": "Tool [REQUESTED_TOOL] is not in the authorized tool list for [AGENT_NAME].",
  "suggested_action": "[SUGGESTION_OR_NULL]"
}

Delegation Message

json
{
  "decision": "DELEGATE",
  "target_agent": "[AGENT_NAME]",
  "task_summary": "[SUMMARY]",
  "payload": { }
}

Confirmation Request

json
{
  "decision": "CONFIRMATION_REQUIRED",
  "target_agent": "[AGENT_NAME]",
  "action_description": "[DESCRIPTION]",
  "risk_level": "[RISK_LEVEL]"
}

Override Policy

Tool authorization overrides are permitted only under the following conditions: [OVERRIDE_CONDITIONS]. When an override is executed, you must log the justification and the authorizing entity in the audit trail.

Audit Requirement

For every tool call, delegation, or refusal, append a structured audit record to your final response under the key audit_trail.

To adapt this template for production, start by replacing all placeholders with concrete values from your agent specification and tool registry. The [CONSTRAINTS] column is critical—use it to encode rate limits, data sensitivity checks, or user-role requirements. The delegation table should mirror your actual agent topology. If your system does not support inter-agent delegation, remove that section entirely to reduce prompt length and prevent the model from hallucinating delegation capabilities. The structured output formats (Refusal, Delegation, Confirmation Request) are designed to be parsed by an upstream orchestrator, so coordinate the JSON schemas with your application's state machine. Before deployment, run the evaluation criteria defined in the full playbook to verify that the prompt prevents tool access leakage and correctly handles delegation authorization checks.

IMPLEMENTATION TABLE

Prompt Variables

Inputs the prompt needs to work reliably. Validate each before injecting into the system prompt.

PlaceholderPurposeExampleValidation Notes

[AGENT_ROLE_DEFINITIONS]

JSON array mapping each agent ID to its role, scope, and capabilities

[{"agent_id":"researcher","role":"Read-only data retrieval","allowed_tools":["search","fetch_url"]}]

Schema check: array of objects with required agent_id, role, allowed_tools fields. Must not be empty.

[TOOL_CATALOG]

Complete tool manifest with tool names, descriptions, parameters, and risk classification

[{"name":"send_email","risk":"write","requires_confirmation":true}]

Schema check: array of objects with name, risk (read/write/admin), requires_confirmation (boolean). Must match actual tool registry.

[AGENT_TOOL_BINDINGS]

Mapping of which agents are authorized to call which tools and under what conditions

[{"agent_id":"researcher","tools":["search"],"max_calls_per_session":20}]

Cross-reference check: every agent_id must exist in [AGENT_ROLE_DEFINITIONS]. Every tool must exist in [TOOL_CATALOG]. No agent may have tools outside its role scope.

[DELEGATION_POLICY]

Rules for inter-agent tool delegation, including which agents may delegate to which others

[{"from_agent":"researcher","to_agent":"analyst","allowed_tools":["run_query"],"requires_approval":true}]

Schema check: from_agent and to_agent must exist in [AGENT_ROLE_DEFINITIONS]. Circular delegation chains must be flagged. requires_approval must be boolean.

[CONFIRMATION_RULES]

Thresholds and categories of tool calls that require user confirmation before execution

[{"risk_level":"write","requires_confirmation":true,"confirmation_message":"I need to modify data. Proceed?"}]

Enum check: risk_level must be read, write, or admin. confirmation_message must be non-empty string. At minimum, write and admin risk levels must require confirmation.

[SESSION_CONTEXT]

Current session metadata including user role, tenant ID, and active permissions

{"user_role":"viewer","tenant_id":"org-456","session_id":"sess-abc"}

Schema check: required fields user_role, tenant_id, session_id. user_role must match a valid role in the authorization system. tenant_id must be non-null.

[AUDIT_LOG_SCHEMA]

Required structure for tool call audit records generated by the system

{"timestamp":"ISO8601","agent_id":"string","tool_name":"string","parameters":{},"authorization_check":"passed|denied","delegation_chain":[]}

Schema check: all fields present and typed correctly. authorization_check must be passed or denied. delegation_chain must be an ordered array of agent_ids.

[ESCALATION_PATH]

Procedure and target for handling unauthorized tool access attempts

{"on_denied":"log_and_notify","notification_target":"security-ops","max_retries":0}

Schema check: on_denied must be log_only, log_and_notify, or block_and_alert. notification_target required if log_and_notify or block_and_alert. max_retries must be integer >= 0.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the Tool Authorization Policy for Multi-Agent Systems prompt into a production application with enforcement, logging, and retry logic.

This prompt is not a standalone artifact; it is the policy layer of a multi-agent authorization system. The prompt template defines per-agent tool scopes and delegation rules, but the application harness must enforce these rules at runtime. The harness acts as a gate between the model's output and the actual tool execution layer. When an agent generates a tool call, the harness validates it against the policy defined in the prompt before the tool is invoked. This prevents prompt injection, model error, or context drift from bypassing authorization boundaries. The implementation pattern is: model proposes, harness validates, system executes, harness logs.

To implement this, build a Tool Authorization Middleware that sits between the agent's model response and your tool execution engine. The middleware must: (1) Parse the agent's proposed tool call and extract the agent_id, tool_name, and arguments. (2) Retrieve the active policy for that agent from a policy store (which should be derived from the system prompt's [AGENT_TOOL_SCOPES] variable). (3) Validate that the tool is in the agent's allowed scope and that the arguments conform to the [CONSTRAINTS] schema. (4) If the call is a delegation request to another agent, validate that the target agent's scope permits the delegated tool and that the delegation chain depth does not exceed [MAX_DELEGATION_DEPTH]. (5) If validation fails, inject a structured error message back into the agent's context window as a tool response, forcing it to correct its behavior without executing the unauthorized call. This closed-loop correction is critical for maintaining policy adherence across multi-turn sessions.

Logging and audit must be built into the middleware, not left to the model. For every tool call, log: the requesting agent, the proposed tool, the full arguments, the policy decision (allowed/denied), the justification from the policy rule that matched, a timestamp, and the session ID. This audit trail serves two purposes: it provides compliance evidence for [AUDIT_REQUIREMENTS] and it feeds your evaluation pipeline. For retry logic, implement a circuit breaker: if an agent receives three consecutive authorization denials in a single turn, the harness should escalate to a human reviewer or terminate the agent's tool-use capability for the remainder of the session, depending on the [RISK_LEVEL] configuration. Do not allow infinite retry loops on authorization failures.

Model choice matters here. This prompt requires strong instruction-following and structured output capabilities. Use a model that reliably produces tool calls in your defined schema (e.g., OpenAI's parallel tool calling or Anthropic's tool use format). For high-risk deployments, run a secondary, smaller classification model as a pre-validation step to flag potentially dangerous tool calls before they reach the primary authorization middleware. This adds a defense-in-depth layer. Testing must include adversarial scenarios: prompt the agent to call a tool outside its scope, attempt to delegate to an unauthorized agent, or craft arguments that bypass schema constraints. Your eval suite should measure the Authorization Enforcement Rate (AER)—the percentage of unauthorized tool calls that are correctly blocked by the harness before execution. A passing threshold for production should be 100% on known attack vectors; anything less indicates a bypass in your middleware or an ambiguity in your policy prompt that needs tightening.

IMPLEMENTATION TABLE

Expected Output Contract

Validation rules and format requirements for the authorization decision object returned by the multi-agent tool authorization policy prompt. Use this contract to build a parser that rejects malformed decisions before they reach the execution layer.

Field or ElementType or FormatRequiredValidation Rule

decision

enum: ALLOW | DENY | ESCALATE | CONFIRM

Must be exactly one of the four allowed values. Reject any other string.

agent_id

string matching [AGENT_ID] pattern

Must match the agent identifier passed in the prompt context. Reject if missing or mismatched.

tool_name

string matching registered tool name

Must be present in the allowed tool list for the requesting agent. Reject unknown tool names.

reasoning

string, 1-500 characters

Must contain a non-empty explanation referencing the specific policy rule applied. Reject empty or generic strings like 'policy check'.

escalation_target

string or null

Required when decision is ESCALATE. Must match a valid agent_id or human_review queue. Reject if ESCALATE and null.

confirmation_prompt

string or null

Required when decision is CONFIRM. Must be a user-facing question under 200 characters. Reject if CONFIRM and null.

policy_version

string matching semver pattern

Must match the [POLICY_VERSION] provided in the prompt context. Reject on version mismatch to catch stale policy application.

timestamp

ISO 8601 UTC string

Must be a valid ISO 8601 timestamp in UTC. Reject unparseable or non-UTC timestamps.

PRACTICAL GUARDRAILS

Common Failure Modes

What breaks first in production when tool authorization policies are distributed across multiple agents, and how to prevent silent authorization failures.

01

Agent Identity Spoofing in Tool Calls

What to watch: Agent B receives a delegated task from Agent A but calls tools using Agent A's authorization scope, either because the context was copied verbatim or because the system prompt fails to re-anchor the agent's own identity. Guardrail: Inject a non-overridable agent_id and agent_role into every agent's system prompt and require it in the tool call audit preamble. Validate that the calling agent matches the authorized agent list for each tool.

02

Tool Scope Leakage Through Handoff Context

What to watch: Agent A passes its full tool manifest or authorized scope in a handoff message to Agent B. Agent B then attempts to use tools it should not have access to because the authorization boundary was blurred in the shared context. Guardrail: Strip tool authorization metadata from inter-agent messages. Handoff payloads should contain task data and user intent only, never tool definitions or permission grants.

03

Delegation Chain Authorization Drift

What to watch: Agent A delegates to Agent B, which sub-delegates to Agent C. By the third hop, the original user role, session scope, and authorization context are lost or diluted, allowing Agent C to operate with unintended privileges. Guardrail: Bind the original user's authorization token and role to the task at creation. Every agent in the chain must re-validate against the root authorization context, not the immediate delegator's scope.

04

Silent Tool Execution Without Confirmation Gates

What to watch: A high-risk tool (write, delete, PII access) is called by an agent without triggering a confirmation prompt because the confirmation policy was defined only in the orchestrator agent, not in the specialized agent that actually executes the tool. Guardrail: Embed confirmation requirements directly in the tool definition schema, not just in the orchestrator's system prompt. Every agent must evaluate confirmation gates independently before execution.

05

Cross-Agent Tool Call Collision

What to watch: Two agents operating on the same resource (database row, file, API endpoint) make conflicting tool calls because there is no shared lock or coordination mechanism. This produces data corruption that is hard to trace back to authorization policy gaps. Guardrail: Implement a resource-locking protocol in the tool execution layer. Agents must acquire a lock token before mutating shared resources, and the lock token must be scoped to the agent's authorized role.

06

Authorization Policy Inconsistency Across Agent Versions

What to watch: Agent A is updated with a new tool authorization policy, but Agent B still runs the old policy. The mismatch creates a gap where Agent B can perform actions that are now forbidden for Agent A, or where handoff expectations break. Guardrail: Version the authorization policy as a shared artifact consumed by all agents. Deploy policy changes atomically across the agent fleet and validate policy version consistency at the start of every multi-agent session.

IMPLEMENTATION TABLE

Evaluation Rubric

Run these checks against a golden dataset of multi-agent authorization scenarios before shipping. Each criterion targets a specific failure mode in cross-agent tool access enforcement.

CriterionPass StandardFailure SignalTest Method

Per-Agent Tool Scope Enforcement

Agent A never calls a tool assigned only to Agent B in a single-turn test

Agent A successfully invokes Agent B's exclusive tool without delegation

Run 50 single-turn prompts per agent; assert zero cross-scope tool calls

Inter-Agent Delegation Authorization

Agent A requests Agent B's tool only when [DELEGATION_POLICY] explicitly permits it

Agent A delegates to Agent B for a tool outside the allowed delegation list

Inject 20 delegation-request scenarios; verify delegation only occurs for permitted tool-agent pairs

Tool Access Leakage Across Context Shifts

After a handoff, Agent B cannot access tools from Agent A's prior scope unless explicitly granted

Agent B calls a tool from Agent A's scope using residual context without re-authorization

Simulate 15 multi-turn handoff sequences; check tool call provenance after each handoff

Authorization Check Before Execution

Every tool call is preceded by an explicit authorization check in the reasoning trace

A tool call executes with no preceding authorization reasoning step in the output

Parse reasoning traces from 100 tool-call scenarios; assert authorization token present before each call

Delegation Chain Depth Limit

Delegation stops at [MAX_DELEGATION_DEPTH] and returns an escalation message

A tool call succeeds after exceeding the maximum delegation depth

Craft 10 scenarios requiring depth 3+ delegation; confirm refusal or escalation at the limit

Unauthorized Tool Call Refusal Format

Refusal matches [REFUSAL_TEMPLATE] and includes the denied tool name and reason

Refusal is generic, missing tool name, or leaks internal policy details

Validate 30 refusal outputs against the refusal schema; check for required fields and prohibited leakage

Cross-Agent Audit Trail Completeness

Every delegated tool call logs [AGENT_ID], [TOOL_NAME], [TIMESTAMP], and [AUTH_CHECK_RESULT]

A delegated tool call is missing one or more required audit fields

Extract audit fields from 40 delegation events; assert all required fields present and non-null

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Start with a single-agent scope before adding multi-agent delegation rules. Replace the full agent registry with a flat list of allowed tools per agent role. Use inline comments instead of structured policy blocks. Skip audit trail generation and budget enforcement.

code
[AGENT_ROLE]: code_reviewer
[ALLOWED_TOOLS]: read_file, search_code, get_diff
[DENIED_TOOLS]: write_file, execute_command, access_secrets

Watch for

  • Tool access leakage when agents share a session context
  • Missing delegation refusal language causing silent cross-agent tool calls
  • Overly permissive fallback behavior when a tool is not explicitly listed
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.