Skip to content
Agentic Control Plane

Agent-to-Agent Governance

When one agent hands work to another, ACP passes along who the human is, what the child agent may do, and how much it may spend. Each hop can only narrow those things. Every call is logged with the whole chain and the person at the root.

This page covers agents you run through ACP’s agent API. It is about how that chain works. Coding agents governed by harness hooks (Claude Code, Codex and the rest) are covered in the harness pages, and the difference is spelled out where it matters below.

The problem

A user asks an AI assistant to onboard a new hire. The assistant delegates to a provisioning agent, which creates accounts in GitHub and Jira. That agent delegates to a notification agent, which posts a welcome message in Slack.

Three agents, four systems, one human at the root. Every action needs to be authorized, attributed and logged.

In most agent frameworks the delegation happens through shared credentials. The provisioning agent has the same access as the original assistant. The notification agent can read things it was never meant to see. The audit trail, if there is one, says “the AI did it” and does not name the person who started the chain.

ACP uses delegation chains to fix this. A chain carries identity, permissions, tools and budget through every hop, and each hop gets less than the one before.

New to the concept? Start with What is an Agent Delegation Chain? for the definition, or the ADCS open specification for the normative rules. This page covers how ACP implements chains.


How delegation chains work

A delegation chain is a linked list of agent hops. Each link records which agent is acting, what permissions and tools it has, and what budget remains. The chain starts with a human and grows with each delegation.

interface DelegationChain {
  /** The human at the root. Never changes. */
  originSub: string;
  originClaims: any;
  links: DelegationLink[];  // [0] = first agent, [last] = current
  depth: number;
}

interface DelegationLink {
  agentProfileId: string;
  agentRunId: string;
  agentName: string;
  effectiveScopes: string[];     // narrowed via intersection
  effectiveTools: string[];      // narrowed via intersection
  remainingBudgetCents: number;
  delegatedAt: string;           // ISO timestamp
}

Two things are always true:

  1. originSub never changes. However deep the chain goes, the human at the root is recorded, so you can trace any action back to the person who started it.
  2. Permissions only narrow. A link’s effective scopes and tools are the intersection of its own permissions and its parent’s. A child never has more access than its parent.
Alice JWT verified scopes: github.*, slack.*, jira.* delegates Planning Agent scopes: github.*, jira.* budget: $5.00 delegates Provisioning Agent scopes: github.repos.create budget: $2.00 (narrowed) calls GitHub API Identity verified x-user-uid: Alice Audit trail: Alice → Planning Agent → Provisioning Agent → github.repos.create | scopes narrowed at each hop | budget: $2.00 remaining Permissions can only narrow through a delegation chain, never widen

In the diagram, Alice has GitHub, Slack and Jira. The Planning Agent gets GitHub and Jira, but not Slack. The Provisioning Agent gets only github.repos.create. The audit trail records the full chain with Alice at the root.


Scope narrowing: the intersection algorithm

When an agent delegates, the child’s effective permissions are the intersection of the parent’s effective permissions and the child’s profile permissions.

/**
 * Intersect two scope arrays. Returns only scopes present in both.
 * Supports wildcard prefixes: "github.*" matches "github.repos.list".
 */
export function intersectScopes(
  parentScopes: string[],
  childProfileScopes: string[]
): string[] {
  if (parentScopes.length === 0 || childProfileScopes.length === 0) return [];

  const result: string[] = [];
  for (const childScope of childProfileScopes) {
    if (matchesAny(childScope, parentScopes)) {
      result.push(childScope);
    }
  }
  return result;
}

function matchesAny(value: string, patterns: string[]): boolean {
  for (const pattern of patterns) {
    if (pattern === value) return true;
    if (pattern.endsWith(".*")) {
      const prefix = pattern.slice(0, -1); // "github."
      if (value.startsWith(prefix)) return true;
    }
  }
  return false;
}

If a parent has github.* and the child profile asks for github.repos.create, the child gets github.repos.create. If the parent only has github.repos.read, the child cannot get write access, even if its profile says it should.

Tools follow the same rule:

export function intersectTools(
  parentTools: string[],
  childProfileTools: string[]
): string[] {
  // Empty parent means unrestricted: child gets their full set
  if (parentTools.length === 0) return [...childProfileTools];
  // Empty child means nothing requested
  if (childProfileTools.length === 0) return [];

  const result: string[] = [];
  for (const childTool of childProfileTools) {
    if (matchesAny(childTool, parentTools)) {
      result.push(childTool);
    }
  }
  return result;
}

An empty parent tool list means “unrestricted” (the root agent can use every tool in the workspace). An empty child tool list means “no tools”. The child asked for nothing, so it gets nothing. That stops a misconfigured profile from escalating by accident.


The delegation flow

When Agent A invokes Agent B, this happens.

1. Validation checks

✓ Chain required   Can only delegate from within an existing agent run
✓ Profile exists   Target agent profile must exist in the workspace
✓ Delegatable flag Target profile must have delegatable: true
✓ Cycle detection  Target profile must not already be in the chain
✓ Depth limit      Chain depth must not exceed the plan or workspace limit (see Depth limits)
✓ Budget check     Parent must have remaining budget > 0
✓ Model valid      Target's model must be enabled in workspace config
✓ API key          Workspace or platform must have key for the model's provider

2. Chain building

export function buildChildChain(
  parentChain: DelegationChain,
  targetProfile: {
    id: string;
    name: string;
    scopes: string[];
    enabledTools: string[];
    maxBudgetCents: number;
  },
  childRunId: string,
): DelegationChain {
  const parentLink = parentChain.links[parentChain.links.length - 1];

  const effectiveScopes = intersectScopes(
    parentLink.effectiveScopes, targetProfile.scopes);
  const effectiveTools = intersectTools(
    parentLink.effectiveTools, targetProfile.enabledTools);
  const remainingBudgetCents = Math.min(
    parentLink.remainingBudgetCents, targetProfile.maxBudgetCents);

  return {
    originSub: parentChain.originSub,      // Alice, never changes
    originClaims: parentChain.originClaims, // preserved
    links: [...parentChain.links, {
      agentProfileId: targetProfile.id,
      agentRunId: childRunId,
      agentName: targetProfile.name,
      effectiveScopes,
      effectiveTools,
      remainingBudgetCents,
      delegatedAt: new Date().toISOString(),
    }],
    depth: parentChain.depth + 1,
  };
}

Three things narrow at each hop:

  • Scopes: the intersection of the parent’s effective scopes and the child’s profile scopes.
  • Tools: the intersection of the parent’s effective tools and the child’s profile tools.
  • Budget: the smaller of the parent’s remaining budget and the child’s max budget.

3. Child execution

The child runs with the narrowed chain. Every tool call it makes goes through the gateway’s checks, and the delegation layer compares the call against the child’s effectiveTools and effectiveScopes:

// In governToolCall():
if (delegationChain && delegationChain.links.length > 0) {
  const currentLink = delegationChain.links[delegationChain.links.length - 1];

  // Verify tool is in current link's effective tools
  const toolAllowed = currentLink.effectiveTools.some((pattern) => {
    if (pattern === toolName) return true;
    if (pattern.endsWith(".*") && toolName.startsWith(pattern.slice(0, -1)))
      return true;
    return false;
  });

  if (!toolAllowed) {
    return {
      allowed: false,
      error: "Tool not permitted in delegation chain",
      code: -32004,
      data: { tool: toolName, effectiveTools: currentLink.effectiveTools },
    };
  }

  // Override scopes for downstream checks
  auth.scopes = currentLink.effectiveScopes;
}

This runs on the server for every tool call made by an agent running through ACP’s agent API. The child cannot get around it by shaping its tool calls differently, because the check reads the chain, not the model’s output.

It applies to agents run through the agent API and delegation chains. Coding-agent subagents governed by harness hooks inherit the parent session’s policy. Task-scoped narrowing for them is not built yet; it is the one scenario we fail on the benchmark (scope_inheritance.04).

4. Result propagation

When the child finishes, its result goes back to the parent. The parent’s run record gets the child run ID, and the child’s execution is fully recorded:

{
  output: "Created GitHub repo 'acme/new-hire-onboarding'...",
  childRunId: "run_abc123",
  conversationId: "conv_def456",
  usage: {
    promptTokens: 1240,
    completionTokens: 380,
    toolCallCount: 3,
  },
  delegation: {
    originSub: "auth0|alice",
    depth: 2,
    chain: ["planning-agent", "provisioning-agent"],
    runChain: ["run_parent", "run_abc123"],
  }
}

Safety mechanisms

Cycle detection

If Agent A delegates to B and B delegates back to A, you get a loop that burns budget and does no work. ACP checks for it:

export function detectCycle(chain: DelegationChain, targetProfileId: string): boolean {
  return chain.links.some((link) => link.agentProfileId === targetProfileId);
}

If the target’s profile ID is already anywhere in the chain, the delegation is rejected with a CYCLE error.

Depth limits

Even without cycles, deep chains add latency and cost at every hop. The limit depends on the plan:

Plan Max chain depth
Free 2
Pro 3
Team 5
Scale 8
Enterprise 10

A workspace policy can set its own cap. Child API keys minted through /api/v1/keys are capped at 5 hops whatever the plan.

Budget propagation

Budget flows down the chain and can only shrink. If the parent has $5.00 left and the child profile has a max of $2.00, the child gets $2.00. If the parent has $1.50 left, the child gets $1.50.

export function computeChildBudget(
  parentRemainingBudgetCents: number,
  childProfileMaxBudgetCents: number,
): number {
  return Math.min(parentRemainingBudgetCents, childProfileMaxBudgetCents);
}

When the child’s budget hits zero, its tool calls are rejected. The parent gets the result or the error and decides what to do: retry another way, report failure, or carry on with partial results.

Budget is tracked against real model pricing. ACP keeps a per-model price table covering OpenAI, Anthropic, Google and Groq models, and works out the cost in cents after every LLM call:

export function calculateCostCents(
  model: string,
  promptTokens: number,
  completionTokens: number,
): number {
  const pricing = MODEL_PRICING[model] ?? DEFAULT_PRICING;
  const inputCost = (promptTokens / 1_000_000) * pricing.inputPer1M;
  const outputCost = (completionTokens / 1_000_000) * pricing.outputPer1M;
  return Math.round((inputCost + outputCost) * 100 * 100) / 100;
}

The child’s running cost is tracked in the completion loop. If it hits its ceiling, the next tool call is rejected with a BUDGET error. The child stops and returns what it has, and the parent continues with its remaining budget minus what the child used.

Delegation permissions

Two flags on the agent profile control delegation:

  • delegatable: boolean: can other agents invoke this one? When false, no agent can call it via agents.invoke, and it is hidden from agents.list and the A2A agent card.
  • canDelegate: boolean: can this agent invoke others? When false, it can run tools but cannot start sub-agent chains. The agents.invoke and agents.list tools are removed from its toolset.

With these you can build orchestrators that delegate but cannot be called directly, workers that can be called but cannot delegate, and hybrids.


Immutable platform rules

Before any workspace policy runs, the gateway applies a few immutable platform rules that no tenant setting can turn off. They run on tool calls the gateway executes or proxies.

  • SSN and card numbers. Patterns for Social Security and credit card numbers are checked on action input. Model-call and file-authoring tools are exempt, so a pasted number cannot wedge a session.
  • Private-network requests. For requests the platform itself makes, calls to private-range addresses (localhost, 10.x, 172.16.x, 192.168.x and similar) are blocked.
  • Cloud metadata. Tool calls that run on the user’s machine get only the cloud-metadata block: 169.254.x addresses and metadata.google.internal.

Coding-agent calls reported by harness hooks do not go through these rules. They go through the risk classifier and the safety floor instead, so a curl to localhost from Claude Code is not blocked by the rules above.

Why this matters for delegation: an agent three levels deep can be pushed by prompt injection to put a card number in a tool call. The immutable rules are a backstop for the calls the gateway runs, whatever the workspace policy says.


The control stack

For agents run through the gateway, a tool call in a delegation chain passes these layers in order:

Layer 0a: Immutable platform rules (SSN and card patterns; private-range SSRF for platform-made requests)
Layer 0b: Delegation chain enforcement (scope/tool intersection)
Layer 1:  Scope enforcement (OAuth scopes vs tool requirements)
Layer 2:  ABAC policy rules (attribute-based access control)
Layer 3:  Rate limit + budget preflight (per-user, per-tenant)
Layer 4:  Plan limit check (subscription feature gates)
Layer 5:  Content scanning + PII redaction (transformabl-core)

Layer 0b is what makes the rest delegation-aware. It replaces the auth scopes with the chain’s effective scopes:

// Override auth scopes to the chain's effective scopes for downstream checks
auth.scopes = currentLink.effectiveScopes;

After that line, scope enforcement (layer 1) checks the child’s scopes, not the parent’s, and ABAC rules (layer 2) see the narrowed identity. Rate limits (layer 3) still key off the original user, because the human at the root answers for all downstream usage.


Hooks: approve, deny, or modify tool calls

Tenant-configurable webhooks can fire before or after a tool runs. Use them to connect a compliance system, an approval workflow or a monitoring pipeline.

Pre-hooks

A pre-hook fires before a tool runs. Your webhook receives the tool name, input, user identity and timestamp, and returns one of three actions:

interface PreHookResult {
  action: "approve" | "deny" | "modify";
  input?: any;      // Modified input (only when action === "modify")
  reason?: string;  // Denial reason (only when action === "deny")
}

Approve lets the call go ahead. Deny blocks it and returns the reason to the agent. Modify lets it go ahead with the input your webhook returned, so you can sanitize or redact before it reaches the backend.

Pre-hooks are signed with HMAC-SHA256 so your webhook can check the request came from ACP:

POST https://your-compliance-system.example.com/hook
Content-Type: application/json
X-Hook-Signature: <HMAC-SHA256(body, secret)>
X-Hook-Event: pre

{
  "event": "pre",
  "tool": "salesforce.query",
  "input": {"query": "SELECT * FROM Account"},
  "tenantId": "acme-corp",
  "sub": "auth0|alice",
  "timestamp": "2026-04-01T14:23:09Z"
}

Pre-hooks fail open. If your webhook times out (default 5s) or returns a non-2xx status, the tool call goes ahead, so a broken webhook cannot stop all agent activity. If you need fail-closed behavior, configure a policy instead.

Post-hooks

Post-hooks fire after a tool runs and do not wait for a reply. They get the same payload plus the result and success status. Use them for notifications, external logging or downstream workflows.

Pattern matching

Hooks match tool names with glob patterns:

  • "*" matches all tools
  • "github.*" matches all GitHub tools
  • "salesforce.query" matches exactly one tool

Matching works across chains. If a parent calls a child that calls github.repos.create, a hook on "github.*" fires however deep the call started.


Creating agents programmatically

You can create, manage and invoke agents through the public REST API, with no dashboard needed.

API key authentication

API keys look like gsk_{slug}_{random}. The slug identifies the tenant, so requests need no tenant parameter.

POST /api/v1/agents
Authorization: Bearer gsk_acmecorp_k8f7a2b1c9d4e5f6
Content-Type: application/json

{
  "name": "Onboarding Agent",
  "model": "gpt-4o",
  "systemPrompt": "You onboard new hires by creating accounts and notifying the team.",
  "enabledTools": ["github.*", "jira.*", "slack.postMessage"],
  "scopes": ["github.*", "jira.*", "slack.post"],
  "maxBudgetCents": 500,
  "maxToolCalls": 50,
  "delegatable": true,
  "canDelegate": true,
  "maxDelegationDepth": 3
}

The API supports full CRUD: POST /api/v1/agents (create), GET /api/v1/agents (list), GET /api/v1/agents/:id (get), PUT /api/v1/agents/:id (update), DELETE /api/v1/agents/:id (delete).

Triggering a run

POST /api/v1/agents/{profileId}/run
Authorization: Bearer gsk_acmecorp_k8f7a2b1c9d4e5f6

{
  "goal": "Onboard new hire Jamie Chen: create GitHub account, Jira access, send Slack welcome"
}

The agent runs on its own with the tools and scopes in its profile. If canDelegate is true it can hand sub-tasks to other agents, and each handoff adds a link with narrowed permissions.

The creating principal is recorded on the profile (createdBy). When the agent runs, the audit trail records both the agent and the human or API key that created it.


MCP client: using external tools

ACP can also use tools from external MCP servers. An agent in your workspace can call a tool hosted elsewhere, and the same checks apply.

External MCP servers are configured per tenant in Firestore: a URL, a transport (Streamable HTTP or SSE), optional auth headers and an enabled flag. When a call comes in, ACP connects, discovers the server’s tools and namespaces them:

mcp.{serverId}.{toolName}

A server called analytics that exposes runQuery shows up to agents as mcp.analytics.runQuery. The prefix avoids collisions with built-in tools and shows where each tool came from in the audit log.

Connections have a 5-minute TTL, reconnect on failure, and are capped per workspace. External tool calls go through the same layers as built-in ones.

MCP server URLs get an SSRF check too. Servers with private or internal addresses are rejected before ACP connects.


Discovery via well-known endpoints

Agents find each other the same way OIDC providers and OAuth servers do:

GET /.well-known/agent-card.json

The response follows the A2A protocol:

{
  "name": "ACP Agent Gateway (acme-corp)",
  "description": "Agentic Control Plane gateway for acme-corp workspace",
  "version": "1.0.0",
  "url": "https://api.agenticcontrolplane.com/acme-corp",
  "provider": {
    "organization": "Agentic Control Plane",
    "url": "https://agenticcontrolplane.com"
  },
  "capabilities": {
    "streaming": true,
    "pushNotifications": false
  },
  "securitySchemes": {
    "oauth2": { ... },
    "bearer": { ... }
  },
  "skills": [
    {
      "id": "crm-researcher",
      "name": "CRM Researcher",
      "description": "Queries Salesforce for account and contact data",
      "tags": ["salesforce.*"],
      "input_modes": ["text", "application/json"],
      "output_modes": ["text", "application/json"]
    },
    {
      "id": "ticket-creator",
      "name": "Ticket Creator",
      "description": "Creates and manages Jira tickets",
      "tags": ["jira.*"],
      "input_modes": ["text", "application/json"],
      "output_modes": ["text", "application/json"]
    }
  ]
}

Each skill in the card is a delegatable agent profile. An outside orchestrator can read the card, see which agents are available and invoke them over MCP or A2A, with the same checks on every call.

Only agents with delegatable !== false appear in the card. Internal-only agents stay hidden.


Auditing across agent hops

Every tool call in a delegation chain produces an audit record with full provenance:

{
  ts: "2026-04-01T14:23:09.412Z",
  tenantId: "acme-corp",
  requestId: "req_8c9d0e1f",
  tool: "github.createRepo",
  sub: "auth0|alice",               // always the human at the root
  ok: true,
  latencyMs: 847,
  agentProfileId: "provisioning-agent",
  agentRunId: "run_abc123",
  delegation: {
    originSub: "auth0|alice",       // the human who started everything
    depth: 2,
    chain: ["planning-agent", "provisioning-agent"],
    runChain: ["run_parent", "run_abc123"],
    parentProfileId: "planning-agent"
  },
  contentScan: {
    piiDetected: false,
    piiTypes: [],
    riskScore: 8
  }
}

From one record you can answer:

  • Who started it? Alice (originSub)
  • Which agents were involved? Planning Agent, then Provisioning Agent (chain)
  • What was done? github.createRepo
  • Was it allowed? Yes (ok: true)
  • Was there sensitive data? No PII detected, risk score 8/100
  • How long did it take? 847ms
  • Can I trace the full run? Yes. runChain links to both run records, which hold conversation history, tool call logs and token usage.

The delegation field is the difference from ordinary request logging. Each entry says who made this call and also the whole chain of agents back to the human.

CSV export

Audit events, including the full delegation.chain on every entry, can be queried in the dashboard’s Activity/Logs view and exported as CSV.


How this differs from orchestration frameworks and LLM gateways

Agent frameworks decide which agent runs next. LLM gateways pick which model provider to call. Neither answers: who is this agent, what can it do, who delegated to it, and who is accountable?

ACP’s answer for agents run through its API:

  • Delegation chains are a core data structure, not something bolted onto an orchestration framework.
  • Scope narrowing is checked on the server at every tool call. Permissions only narrow along a chain.
  • Immutable platform rules block SSN and card patterns in action input and private-range requests the platform makes, whatever the tenant configuration.
  • Layered checks run on each tool call: immutable rules, delegation, scopes, ABAC, rate limits, plan limits and content scanning.
  • Budget propagation tracks cost against real model prices and stops runaway spend.
  • Pre and post hooks let you add your own approval workflows and monitoring.
  • MCP client support lets agents use external tools under the same checks.
  • A public API lets you create, manage and run agents in code, with the API key’s identity tracked through the chain.

That lets a team running multi-agent systems on real data answer the question a compliance officer will ask: “Who did what, through which agents, and was it allowed?”


Get started → · Agent identity → · Architecture deep dive → · View on GitHub →

Running coding agents? ACP records each tool call its hook sees and makes the dangerous shell commands (a force-push, destructive SQL, curl | sh) wait for you. One command, free up to 5 agents:

macOS · Linux · WSL
curl -fsSL https://agenticcontrolplane.com/install.sh | bash
Windows · PowerShell
irm https://agenticcontrolplane.com/install.ps1 | iex

What the installer writes  ·  Getting started