Skip to content
1Claw Academy
Curriculum/Agents & Access Control2 minIntermediate · Lesson 11 of 15

Sub-agents and delegation

Let one agent hand work to another under a human-authored delegation, with tool allowlists, depth limits, and daily caps.

Agents can delegate tasks to other agents. The authorization for that is never something the agents arrange between themselves: a human creates an explicit delegation record, and agents cannot create, modify, or revoke their own (403).

  • allowed_tools / blocked_tools: exactly which tools the delegate may use.
  • max_daily_delegations: a rate limit counted from real invocations.
  • max_depth (1-10): stops recursive chains of agents calling agents.
  • delegation_mode: caller (delegate uses its own credentials, the default), target (uses the target agent's config), or both.
  • expires_at: delegations can be temporary.
Watch out

Self-delegation is blocked with a 400, and an agent in one org can never delegate to an agent in another.

  1. 1

    As a human, authorize agent A to delegate to agent B, limited to two tools and ten calls a day.

    bash
    curl -s -X POST https://api.1claw.co/v1/agents/$AGENT_A/delegations \
      -H "Authorization: Bearer $ONECLAW_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
        "delegate_id": "'$AGENT_B'",
        "allowed_tools": ["search_agent_directory", "get_memory"],
        "max_daily_delegations": 10,
        "max_depth": 2,
        "delegation_mode": "caller"
      }'
  2. 2

    The delegating agent discovers what it is actually allowed to do at runtime.

    bash
    curl -s https://api.1claw.co/v1/agents/$AGENT_A/delegations/effective \
      -H "Authorization: Bearer $AGENT_TOKEN"
  3. 3

    Delegate a task. The X-Delegation-Depth header is tracked and enforced against max_depth.

    bash
    1claw agent delegation list
    # via MCP the agent calls: delegate_task
  4. 4

    Revoke it. Human-only, effective immediately, and it takes both the delegating agent's id and the delegation id.

    bash
    1claw agent delegation revoke $AGENT_A $DELEGATION_ID
Tip

Every delegation emits audit events: agent.delegation.created, .updated, .revoked, .invoked, and .blocked. A blocked event is the one to alert on; it means an agent tried something outside its grant.

Decide

A research agent delegates summarisation to a second agent. The delegation is human-created, scoped to two tools, and rate limited. The research agent reads public web pages; the summariser has vault access to internal notes.

Where is the exposure?

Check your understanding

3 questions
1

Who can create a delegation between two agents?

2

What does max_depth protect against?

3

In the default "caller" delegation mode, whose credentials does the delegate use?