Inferensys

Prompt

Permission Inheritance Prompt for Sub-Agent Delegation

A practical prompt playbook for using Permission Inheritance Prompt for Sub-Agent Delegation in production AI workflows.
Developer reviewing multi-agent chat interface on laptop, agent conversation logs visible, casual coding session at WeWork desk.
PROMPT PLAYBOOK

When to Use This Prompt

Defines the job-to-be-done, ideal user, and boundaries for the Permission Inheritance Prompt for Sub-Agent Delegation.

This prompt is for engineering teams building hierarchical agent systems where a parent agent must delegate work to specialized sub-agents. The core problem it solves is defining a machine-readable permission inheritance specification that determines which scopes transfer from parent to child, which are stripped, and how the sub-agent validates its authority before executing a task. Use this when you need a structured delegation contract that can be injected into a sub-agent's system prompt or consumed by an orchestration layer to enforce scope boundaries programmatically. The ideal user is an AI architect or platform engineer who already has a multi-agent topology and needs to prevent privilege escalation, scope creep, or unauthorized tool access during delegation.

This prompt is not appropriate for single-agent permission declarations or flat tool allowlists. If you are defining what a single agent can access without delegation, use the Agent Tool Permission Boundary System Prompt instead. If you are building an allowlist for MCP server integration, use the Tool Allowlist Declaration Prompt for MCP Servers. This prompt specifically addresses the inheritance problem: when Agent A delegates to Agent B, what permissions survive the transfer, which require re-validation, and how Agent B confirms its effective scope before acting. The output is a permission inheritance specification, not a general role definition or a tool catalog. It should be used alongside your existing role-based access control manifests and tool permission declarations.

Before using this prompt, ensure you have already defined the parent agent's full permission scope and the sub-agent's intended role. The prompt requires these as inputs to produce an inheritance map. Do not use this prompt to design the permission system from scratch; it assumes you have existing permission boundaries and need to formalize how they propagate across delegation boundaries. After generating the inheritance specification, wire it into your orchestration layer so that sub-agent invocations are gated by the declared scope. For high-risk domains such as finance or healthcare, always include human review of the generated inheritance rules and run adversarial test cases from the Permission Scope Simulation Prompt for Testing to validate that sub-agents cannot escalate privileges through handoff or re-delegation.

PRACTICAL GUARDRAILS

Use Case Fit

Where the Permission Inheritance Prompt for Sub-Agent Delegation works well and where it introduces unacceptable risk. Use these cards to decide if this prompt pattern fits your architecture before you invest in implementation.

01

Good Fit: Hierarchical Agent Systems

Use when: You have a parent agent that delegates work to specialized sub-agents and you need explicit, auditable permission transfer rules. Guardrail: The prompt works best when each sub-agent has a well-defined scope and the parent agent's authority is clearly bounded before delegation begins.

02

Bad Fit: Flat Single-Agent Architectures

Avoid when: Your system uses a single agent with no delegation. Adding inheritance logic here creates unnecessary complexity and risks confusing the model about its own authority. Guardrail: Use a simple permission boundary system prompt instead of inheritance chains when there is no actual delegation.

03

Required Inputs

You must provide: A complete parent agent permission manifest, a sub-agent role definition, and the task context being delegated. Guardrail: Missing any of these inputs causes the model to hallucinate permission boundaries. Validate that all three inputs are present and non-empty before invoking the inheritance prompt.

04

Operational Risk: Permission Escalation

What to watch: Sub-agents may inherit broader permissions than intended if the inheritance specification is ambiguous or if the parent agent's scope is overly permissive. Guardrail: Always apply deny-before-allow logic in the inheritance rules and run regression tests that probe for privilege escalation across every delegation path.

05

Operational Risk: Orphaned Authority

What to watch: After a sub-agent completes its task, residual permissions may persist in session context, allowing the sub-agent to act beyond its delegated window. Guardrail: Include explicit permission revocation instructions in the handoff protocol and validate that sub-agent tool access is terminated when the task completes or the session ends.

06

When to Use Code Instead

Avoid when: Permission inheritance logic is deterministic and can be enforced at the application layer. Guardrail: If your permission rules can be expressed as a simple allowlist intersection between parent and child scopes, implement this in your agent framework code rather than relying on prompt-based enforcement. Reserve the prompt for cases where inheritance requires contextual judgment.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A production-ready prompt for generating a permission inheritance specification that defines which scopes transfer, which are stripped, and how to validate sub-agent authority before task assignment.

This prompt template is designed to be pasted into your orchestration layer or sub-agent system prompt assembly. It instructs a parent agent to produce a structured permission inheritance specification before delegating a task to a sub-agent. The specification acts as a contract, preventing privilege escalation and ensuring the sub-agent operates strictly within its intended scope. Replace every square-bracket placeholder with your specific permission model, tool definitions, and delegation policies before use.

text
You are a permission inheritance compiler for a hierarchical agent system. Your task is to produce a strict permission inheritance specification for a sub-agent before task delegation.

## Parent Agent Scope
[PARENT_PERMISSION_MANIFEST]

## Sub-Agent Role Definition
[SUB_AGENT_ROLE_DEFINITION]

## Task to Delegate
[TASK_DESCRIPTION]

## Inheritance Rules
- [INHERITANCE_RULE_1: e.g., 'Read-only data access is inherited by default']
- [INHERITANCE_RULE_2: e.g., 'Write permissions are never inherited; sub-agent must request explicit grant']
- [INHERITANCE_RULE_3: e.g., 'User PII access is stripped unless the sub-agent role explicitly requires it']

## Output Schema
Produce a JSON object with the following structure:
{
  "sub_agent_id": "string",
  "inherited_permissions": [
    {
      "permission": "string",
      "scope": "string",
      "constraints": ["string"],
      "inherited_from": "string"
    }
  ],
  "stripped_permissions": [
    {
      "permission": "string",
      "reason_stripped": "string",
      "risk_if_inherited": "string"
    }
  ],
  "requires_revalidation": [
    {
      "permission": "string",
      "validation_method": "string",
      "failure_action": "string"
    }
  ],
  "effective_scope_statement": "string"
}

## Constraints
- [CONSTRAINT_1: e.g., 'Never inherit permissions marked as "delegation-denied"']
- [CONSTRAINT_2: e.g., 'If the sub-agent role does not explicitly list a tool, it cannot be inherited']
- [CONSTRAINT_3: e.g., 'All inherited write permissions must be flagged for revalidation']

## Examples
### Example 1: Safe Delegation
Parent Scope: [EXAMPLE_PARENT_SCOPE]
Sub-Agent Role: [EXAMPLE_SUB_AGENT_ROLE]
Task: [EXAMPLE_TASK]
Expected Output: [EXAMPLE_EXPECTED_OUTPUT]

### Example 2: Blocked Delegation
Parent Scope: [EXAMPLE_PARENT_SCOPE_2]
Sub-Agent Role: [EXAMPLE_SUB_AGENT_ROLE_2]
Task: [EXAMPLE_TASK_2]
Expected Output: [EXAMPLE_EXPECTED_OUTPUT_2]

## Risk Level
[RISK_LEVEL: e.g., 'HIGH — sub-agent will have access to customer data']

Generate the permission inheritance specification now.

After pasting this template, adapt the inheritance rules to match your organization's security policy. The stripped_permissions array is your primary defense against privilege escalation; ensure every stripped permission includes a clear risk_if_inherited rationale for auditability. The requires_revalidation array should list any permission that the sub-agent must confirm with a human or a secondary system before first use. For high-risk deployments, route the generated specification through a human approval step before the sub-agent is instantiated. Test this prompt with adversarial task descriptions that attempt to trick the compiler into inheriting write or PII-access permissions.

IMPLEMENTATION TABLE

Prompt Variables

Each placeholder must be populated before the sub-agent receives this prompt. Missing or empty variables will cause the permission inheritance specification to be incomplete, leading to over-permissioning or delegation failures.

PlaceholderPurposeExampleValidation Notes

[PARENT_AGENT_ROLE]

Defines the identity and scope of the delegating agent

Senior Research Analyst with access to internal knowledge base and email-send tool

Must match an existing role definition in the system registry; null not allowed

[PARENT_PERMISSION_MANIFEST]

Complete list of tools, data stores, and action categories the parent agent can access

tools: [search_kb, summarize_document, send_email]; data_scopes: [project_alpha, project_beta]; actions: [read, write]

Must be a valid JSON object with tools, data_scopes, and actions arrays; validate against tool registry schema

[SUB_AGENT_ROLE]

Defines the identity and intended function of the receiving sub-agent

Document Summarizer with read-only access to project_alpha documents

Must be a distinct role from PARENT_AGENT_ROLE; must include intended scope boundary

[DELEGATION_TASK_TYPE]

Category of work being delegated to the sub-agent

summarize_research_findings

Must match an entry in the approved delegation task type enum; reject unknown task types

[INHERITANCE_RULES]

Explicit rules for which permissions transfer, which are stripped, and which require re-validation

TRANSFER: [search_kb.read]; STRIP: [send_email, project_beta]; REVALIDATE: [summarize_document]

Each rule must reference tools and scopes present in PARENT_PERMISSION_MANIFEST; no orphaned references allowed

[SUB_AGENT_CONSTRAINTS]

Additional restrictions applied to the sub-agent beyond inherited permissions

max_tokens_per_response: 4000; rate_limit: 10 requests per minute; allowed_output_formats: [json, markdown]

Must be a valid JSON constraints object; all constraint keys must be recognized by the sub-agent runtime

[DELEGATION_CONTEXT]

Task-specific context the parent agent passes to the sub-agent

Summarize the attached Q3 earnings report focusing on revenue trends and risk factors

Must be non-empty string; max 2000 tokens; must not contain instructions that contradict INHERITANCE_RULES

[VALIDATION_CHECK_TYPE]

How the sub-agent must confirm its authority before executing the delegated task

pre_execution_scope_check

Must be one of: pre_execution_scope_check, runtime_permission_gate, or post_execution_audit; null allowed if no validation required

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the permission inheritance prompt into an orchestration layer or sub-agent bootstrap sequence.

The Permission Inheritance Prompt for Sub-Agent Delegation is not a standalone prompt—it is a specification generator that must be consumed by your agent orchestration layer before any sub-agent is spawned. The prompt's output is a structured permission manifest that your orchestrator reads to configure the sub-agent's tool allowlist, argument constraints, and data scope. Treat this manifest as a machine-readable contract: the orchestrator must enforce it, not just pass it as advisory text. The model that generated the manifest should never be the same instance that executes under it without an intermediate validation step.

Wire this prompt into your delegation pipeline as a synchronous pre-flight check. When a parent agent decides to delegate a task, call this prompt with the parent's current permission scope, the proposed sub-task description, and the target sub-agent role. Parse the output against a strict JSON schema that includes allowed_tools, argument_constraints, data_scope, denied_actions, and requires_human_approval. Validate that every tool in allowed_tools exists in your tool registry and that no denied_actions overlap with the parent's own deny list. If validation fails, abort delegation and log the conflict. For high-risk domains, insert a human approval step before the sub-agent is instantiated—the manifest should be reviewable in a dashboard or CLI before execution proceeds.

After validation, use the manifest to bootstrap the sub-agent's execution context. This means constructing the sub-agent's system prompt with the inherited permissions explicitly declared, configuring its tool gateway to reject calls outside the allowlist, and setting argument validators that enforce range limits and forbidden patterns from the manifest. Log the full permission inheritance chain—parent scope, inheritance rules applied, and resulting sub-agent scope—as an audit record. When the sub-agent completes its task, do not automatically merge its results into the parent's context without re-validating that the sub-agent did not exceed its granted scope. The next step is to pair this prompt with the Agent Handoff Permission Transfer Prompt to manage context return and scope cleanup after delegation completes.

IMPLEMENTATION TABLE

Expected Output Contract

Fields, format, and validation rules for the sub-agent's permission inheritance specification response.

Field or ElementType or FormatRequiredValidation Rule

inheritance_spec_id

string (UUID v4)

Must match regex pattern for UUID v4. Reject if missing or malformed.

parent_agent_role

string

Must exactly match a role identifier from the [PARENT_ROLE_REGISTRY]. Reject unknown roles.

sub_agent_role

string

Must exactly match a role identifier from the [SUB_AGENT_ROLE_REGISTRY]. Reject if identical to parent_agent_role.

transferred_scopes

array of strings

Each entry must match a scope name in [PARENT_PERMISSION_MANIFEST]. Array must not be empty. Reject if any scope is not in parent manifest.

stripped_scopes

array of strings

Each entry must match a scope name in [PARENT_PERMISSION_MANIFEST]. Must not intersect with transferred_scopes. Reject on overlap.

scope_transfer_rationale

array of objects

Each object must contain scope (string), reason (string, 10-200 chars), and risk_level (enum: low, medium, high). Array length must equal transferred_scopes length.

sub_agent_authority_level

enum

Must be one of: full_delegation, constrained_delegation, read_only, no_delegation. Reject unknown values.

validation_checks

array of objects

Each object must contain check_name (string), check_type (enum: pre_delegation, post_delegation, continuous), and pass_condition (string). Minimum 1 check required.

PRACTICAL GUARDRAILS

Common Failure Modes

Permission inheritance prompts for sub-agent delegation fail in predictable ways. These cards cover the most common production failure modes and how to guard against them before deployment.

01

Privilege Escalation Through Delegation

What to watch: A sub-agent receives broader permissions than the parent intended because the inheritance specification is ambiguous or the parent fails to strip sensitive scopes before delegation. The sub-agent can then access tools, data, or actions the parent itself cannot perform. Guardrail: Implement deny-before-allow logic in the inheritance prompt. Require explicit enumeration of permitted scopes per delegation, never default to 'inherit all.' Validate sub-agent permissions against a hardcoded allowlist before task execution.

02

Scope Drift Across Multi-Step Delegation

What to watch: When a parent delegates to Sub-Agent A, which delegates to Sub-Agent B, permissions accumulate or silently expand across the chain. Each hop adds ambiguity until the final agent operates with an unpredictable scope. Guardrail: Require each sub-agent to re-declare its active permission scope at the start of every turn. Include a scope-audit instruction that compares current permissions against the original delegation manifest and refuses to act if drift is detected.

03

Confused Deputy Problem in Tool Calls

What to watch: A sub-agent receives a task with user-supplied parameters that reference resources outside its permitted scope. The sub-agent executes the tool call without validating that the target resource falls within its authority, accessing data it shouldn't see. Guardrail: Add a pre-execution validation step in the inheritance prompt: before any tool call, the sub-agent must confirm the target resource ID, tenant scope, or data partition matches its declared permission boundary. Log violations and refuse execution.

04

Permission Inheritance Silently Stripped by Context Loss

What to watch: In long delegation chains or high-context sessions, the permission inheritance specification gets pushed out of the effective context window. The sub-agent then operates without any scope constraints, defaulting to its base model behavior. Guardrail: Place the permission specification at the top of every sub-agent system prompt as an immutable prefix. Use a periodic scope-reaffirmation instruction that re-states permissions every N turns. Consider caching the permission block as a static prefix.

05

Sub-Agent Over-Promises Capabilities It Lacks

What to watch: The sub-agent describes capabilities to the user or to other agents that exceed its actual inherited permissions, creating false expectations and downstream failures when it cannot deliver. Guardrail: Include a capability self-report limiter in the inheritance prompt that forces the sub-agent to derive its stated capabilities exclusively from the inherited permission manifest. Add eval checks that compare self-reported capabilities against the actual scope and flag discrepancies.

06

Delegation Without Authority Validation

What to watch: A parent agent delegates a task to a sub-agent without first confirming that the parent itself has authority to perform that task. The sub-agent assumes the delegation is valid and executes an action neither agent should have performed. Guardrail: Add a pre-delegation check: the parent must validate its own permission scope against the intended task before constructing the delegation prompt. If the parent lacks authority, it must refuse delegation and escalate rather than passing the request downstream.

IMPLEMENTATION TABLE

Evaluation Rubric

Run these checks against a golden dataset of delegation scenarios to validate that the permission inheritance prompt correctly transfers, strips, and validates sub-agent authority before shipping.

CriterionPass StandardFailure SignalTest Method

Explicit Scope Transfer

All permissions listed in [TRANSFER_SCOPE] appear in the sub-agent's delegated authority block

A permission from [TRANSFER_SCOPE] is missing from the sub-agent's authority declaration

Parse the sub-agent's authority block and compare the set of permission IDs against [TRANSFER_SCOPE]

Explicit Scope Stripping

All permissions listed in [STRIP_SCOPE] are absent from the sub-agent's delegated authority block

A permission from [STRIP_SCOPE] appears in the sub-agent's authority declaration

Parse the sub-agent's authority block and check for intersection with [STRIP_SCOPE]

Inheritance Validation Statement

Output includes a validation block confirming the sub-agent's scope was checked against the parent's available permissions before delegation

No validation block present, or the block references permissions the parent does not hold

Pattern match for a validation section; parse the validated scope and check it is a subset of [PARENT_SCOPE]

Sub-Agent Capability Self-Report

The sub-agent's self-reported capabilities match only the delegated scope, with no over-claiming

The sub-agent claims a capability not present in the delegated authority block

Parse the sub-agent's capability declaration and diff against the delegated scope; flag any extras

Deny-by-Default Behavior

Any permission not explicitly listed in [TRANSFER_SCOPE] is treated as denied for the sub-agent

The sub-agent attempts or offers to perform an action outside its delegated scope

Run adversarial test cases requesting out-of-scope actions; confirm refusal or scope-aware decline

Handoff Context Integrity

The handoff payload includes [TASK_DESCRIPTION], [DELEGATED_SCOPE], and [CONSTRAINTS] without omission

A required handoff field is missing, truncated, or contains placeholder text

Schema-validate the handoff payload against required fields; check for unresolved square-bracket tokens

Conflict Resolution Trace

When [TRANSFER_SCOPE] and [STRIP_SCOPE] overlap, the prompt applies strip-first logic and notes the conflict

Overlapping permissions are silently transferred or the output is ambiguous about which rule won

Provide input with overlapping transfer and strip lists; verify the stripped permission is absent and a conflict note exists

Parent Authority Ceiling

The sub-agent's delegated scope is a subset of [PARENT_SCOPE]; no permission escalation occurs

The sub-agent receives a permission the parent does not hold

Parse [PARENT_SCOPE], parse the delegated scope, assert delegated scope ⊆ parent scope

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Use the base permission inheritance prompt with a single parent agent and one sub-agent. Remove strict schema validation on the inheritance manifest. Focus on getting the scope transfer logic right before adding production hardening.

Simplify the permission specification to three fields: [ALLOWED_SCOPES], [STRIPPED_SCOPES], and [SUB_AGENT_ROLE]. Test with straightforward delegation scenarios where the sub-agent needs a subset of parent permissions.

Watch for

  • Sub-agent receiving more permissions than intended when the inheritance prompt is too permissive
  • Missing explicit deny rules causing scope creep under ambiguous delegation requests
  • Model inventing permission fields that don't exist in your actual tool registry
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.