Depute Logo

Delegation Gate

Approval surface for spawning a new autonomous sub-agent.

Install

npx ax-depute@latest add delegation-gate
pnpm dlx ax-depute@latest add delegation-gate
yarn dlx ax-depute@latest add delegation-gate
bunx ax-depute@latest add delegation-gate

Overview

A specialized approval surface explicitly designed for the creation of new autonomous entities. It surfaces the proposed agent's mandate, tool constraints, and forecasted economic cost before the agent is allowed to execute.

Agent Spawn RequestRetrieval-Bot wants to delegate a task
Delegation Gate
RoleResearcher
MandateWrite and test a data migration script for the users table
Allowed Tools
bashwrite_filesend_emailquery_db
Max Depth2 levels
Est. Tokens15,007
Est. Cost$0.23
Interactive StorybookView all states, toggle props, and test edge cases.

Basic usage

import { DelegationGate } from '@/components/DelegationGate';

export function App() {
  const proposedAgent = {
    role: 'Financial Analyst',
    mandate: 'Read Q3 earnings reports and extract revenue metrics into a CSV.',
    allowedTools: ['read_file', 'write_csv'],
    maxDepth: 10,
    estimatedTokens: 15000,
    estimatedCost: '$0.25'
  };

  return (
    <div className="p-4 border border-zinc-200 dark:border-zinc-800 rounded-lg max-w-lg">
      <DelegationGate 
        requestingAgent="Main Orchestrator"
        proposedSubagent={proposedAgent}
        onApprove={() => console.log('Sub-agent authorized')}
        onDeny={() => console.log('Spawn request denied')}
      />
    </div>
  );
}

Props

PropTypeDefaultDescription
requestingAgentstringRequiredThe name or ID of the parent agent requesting to spawn the child.
proposedSubagentObjectRequiredDetails about the sub-agent being proposed (see Type below).
onApprove() => voidRequiredCallback fired when the user authorizes the creation of the sub-agent.
onDeny() => voidRequiredCallback fired when the user rejects the creation of the sub-agent.
classNamestringundefinedAdditional CSS class for the root element.

Types

ProposedSubagent

export interface ProposedSubagent {
  role: string;             // Display role, e.g., "Financial Analyst"
  mandate: string;          // The specific instructions given to the new agent
  allowedTools?: string[];  // Sandbox constraints: which tools it can access
  maxDepth?: number;        // Maximum number of reasoning steps before timeout
  estimatedTokens: number;  // Forecasted token burn
  estimatedCost: string;    // Forecasted USD cost, e.g., "$0.25"
}

Solution Patterns

Solution Patterns

Delegation Gate intercepts an orchestrator right before it spawns a new worker.

Authorization is not just approval. Because approving an agent is an authorization of autonomy (not just a single action), it represents a significantly higher-stakes decision. We strongly recommend wrapping this in AutomationBiasAlert to prevent "rubber-stamping" of agent authorizations:

Orchestrator View → [AutomationBiasAlert → Delegation Gate] → Subagent spawned

It ensures human oversight before compute is multiplied.

Design rationale

1. Intent vs. Autonomy
Approval Gate (v0) is used before an agent takes a specific, discrete action. Delegation Gate (v1) is used before an agent creates another agent. Approving an action validates intent; approving an agent authorizes capacity. The UI reflects this shift from operational to structural decision-making.

2. The "Box" Model (Sandboxing)
When humans manage humans, they create boundaries via job descriptions. When humans manage AI, they create boundaries via constraints. The allowedTools and maxDepth fields explicitly visualize the "sandbox" the new agent will be trapped in, increasing human trust that the sub-agent cannot escape its mandate.

3. Forecasted Economics
Agents aren't just code; they are active compute consumers. Displaying estimatedCost directly on the spawn request shifts the UI from purely operational to financial, preventing "infinite loop" surprises on the monthly bill.

On this page