> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kubiya.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Agent Communication Skill

> Enable hierarchical agent orchestration by allowing agents to call other agents or teams with configurable depth limits and access controls.

<CardGroup cols={2}>
  <Card title="Type" icon="tag">
    `agent_communication`
  </Card>

  <Card title="Variants" icon="code-branch">
    Read Only, Limited, Full Orchestration
  </Card>
</CardGroup>

**Purpose:** The Agent Communication skill enables hierarchical agent orchestration, allowing agents to delegate tasks to specialist agents or coordinate multi-agent workflows.

***

## Common Use Cases

<CardGroup cols={2}>
  <Card icon="user-robot">
    **Delegating to specialist agents**

    Route tasks to agents with specific expertise or capabilities
  </Card>

  <Card icon="diagram-project">
    **Orchestrating multi-agent workflows**

    Coordinate complex workflows across multiple specialized agents
  </Card>

  <Card icon="users">
    **Calling team-based executions**

    Execute tasks using team agents with shared capabilities
  </Card>

  <Card icon="arrows-rotate">
    **Session continuation**

    Resume or extend existing agent sessions
  </Card>
</CardGroup>

***

## Variants Overview

| Variant                   | Security     | Key Permissions              | Best For               | Create Command                 |
| ------------------------- | ------------ | ---------------------------- | ---------------------- | ------------------------------ |
| **Read Only** 🟢          | Safe         | Status monitoring only       | Observability, audit   | `--variant read_only`          |
| **Limited** 🟡            | Recommended  | Whitelisted agents, depth=2  | Standard orchestration | `--variant limited`            |
| **Full Orchestration** 🔴 | Unrestricted | Any agent, any team, depth=5 | Complex workflows      | `--variant full_orchestration` |

<Tip>
  **Choosing a variant:** Use Limited for most scenarios with whitelist-based control. Only upgrade to Full Orchestration when unrestricted delegation is required. See [Variant Configuration](/core-concepts/skills/variant-configuration) for detailed differences.
</Tip>

***

## Configuration

**Example Configuration:**

```json theme={null}
{
  "allowed_operations": ["execute_agent", "get_execution_status"],
  "allowed_agents": ["deploy-agent", "test-agent"],
  "max_execution_depth": 2,
  "timeout": 600,
  "max_concurrent_calls": 3
}
```

<AccordionGroup>
  <Accordion title="📋 Full Configuration Reference" icon="gear">
    | Parameter                     | Type    | Default          | Description                 |
    | ----------------------------- | ------- | ---------------- | --------------------------- |
    | `allowed_operations`          | array   | variant-specific | Permitted operations        |
    | `allowed_agents`              | array   | \["\*"]          | Whitelisted agent IDs       |
    | `allowed_teams`               | array   | \[]              | Whitelisted team IDs        |
    | `max_execution_depth`         | number  | variant-specific | Maximum delegation depth    |
    | `timeout`                     | number  | 600              | Execution timeout (seconds) |
    | `max_concurrent_calls`        | number  | 3                | Concurrent agent executions |
    | `enable_session_continuation` | boolean | true             | Allow resuming sessions     |
    | `session_timeout`             | number  | 1800             | Session expiry (seconds)    |
  </Accordion>

  <Accordion title="⚙️ Variant-Specific Defaults" icon="code-branch">
    **Read Only:**

    * `allowed_operations`: \["get\_execution\_status"] (locked)
    * No execution capability

    **Limited:**

    * `max_execution_depth`: 2 (recommended)
    * Requires whitelist configuration
    * `max_concurrent_calls`: 3

    **Full Orchestration:**

    * `allowed_operations`: \["\*"] (all operations)
    * `allowed_agents`: \["\*"] (all agents)
    * `max_execution_depth`: 5
    * `max_concurrent_calls`: 10

    **See:** [Variant Configuration Guide](/core-concepts/skills/variant-configuration)
  </Accordion>
</AccordionGroup>

***

## Quick Start

```bash theme={null}
# Create skill with variant
kubiya skill create --name "Orchestrator" --type agent_communication --variant limited --enabled

# Associate with agent
kubiya skill associate agent <agent-id> <skill-id>
```

<Card title="View Complete Examples" icon="lightbulb" href="/core-concepts/skills/examples#agent-orchestration">
  See full orchestration patterns, deployment workflows, and multi-agent coordination examples
</Card>

***

## Agent Execution Examples

### Single Agent Call

**Orchestrator Request:**

```
"Deploy the backend service to production"
```

**Orchestrator Action:**

```python theme={null}
result = execute_agent(
    agent_id="backend-deploy-agent",
    input={
        "environment": "production",
        "service": "api-backend",
        "version": "v1.2.3"
    }
)
```

### Sequential Execution

**Orchestrator Request:**

```
"Run tests, then deploy if they pass"
```

**Orchestrator Actions:**

```python theme={null}
# Step 1: Run tests
test_result = execute_agent(agent_id="test-agent", input={"test_suite": "integration"})

# Step 2: Deploy if tests passed
if test_result["status"] == "success":
    execute_agent(agent_id="deploy-agent", input={"version": test_result["version"]})
```

### Team Execution

**Orchestrator Request:**

```
"Have the SRE team investigate the latency issue"
```

**Orchestrator Action:**

```python theme={null}
result = execute_team(
    team_id="sre-team",
    task="Investigate API latency spike in production",
    context={"service": "payment-api", "latency_p99": "2500ms"}
)
```

***

## Security Features

<CardGroup cols={2}>
  <Card icon="circle-xmark">
    **Circular Call Detection**

    Prevents infinite loops where agents call each other recursively
  </Card>

  <Card icon="layer-group">
    **Execution Depth Limiting**

    Limits how deep agent call chains can go
  </Card>

  <Card icon="list-check">
    **Whitelist-based Access**

    Only allows calling explicitly permitted agents and teams
  </Card>

  <Card icon="gauge-high">
    **Concurrent Limits**

    Prevents resource exhaustion by limiting parallel calls
  </Card>
</CardGroup>

***

## Best Practices

<AccordionGroup>
  <Accordion title="Use Whitelisting" icon="list-check">
    Always specify `allowed_agents` rather than using "\*" wildcards.

    ```json theme={null}
    "allowed_agents": ["agent-1", "agent-2"]  # Explicit whitelist
    # NOT: allowed_agents: ["*"]
    ```
  </Accordion>

  <Accordion title="Set Reasonable Depth Limits" icon="layer-group">
    Keep `max_execution_depth` low (2-3) to prevent complex call chains.

    ```json theme={null}
    "max_execution_depth": 2  # Sufficient for most orchestration
    ```
  </Accordion>

  <Accordion title="Limit Concurrent Calls" icon="gauge-high">
    Configure `max_concurrent_calls` to prevent resource exhaustion.

    ```json theme={null}
    "max_concurrent_calls": 3  # Balance parallelism and resources
    ```
  </Accordion>
</AccordionGroup>

<Tip>
  **Best Practice:** Set `max_execution_depth` to prevent infinite loops. A depth of 2-3 is sufficient for most orchestration scenarios.
</Tip>

***

## Troubleshooting & Related Skills

<AccordionGroup>
  <Accordion title="Agent Execution Blocked" icon="ban">
    **Solutions:**

    * Verify agent ID is in `allowed_agents` list
    * Check `execute_agent` is in `allowed_operations`
    * Confirm target agent exists and is enabled
  </Accordion>

  <Accordion title="Execution Depth Exceeded" icon="layer-group">
    **Solutions:**

    * Increase `max_execution_depth` if appropriate
    * Restructure orchestration to reduce call chain depth
    * Consider using workflow executor for complex chains
  </Accordion>

  <Accordion title="Circular Dependency Detected" icon="arrows-rotate">
    **Solutions:**

    * Review agent call chain for circular references
    * Restructure orchestration logic to avoid loops
    * Use different agents for different stages
  </Accordion>
</AccordionGroup>

### Related Skills

<CardGroup cols={2}>
  <Card title="Workflow Executor" icon="diagram-project" href="/core-concepts/skills/workflow-executor">
    Alternative for complex multi-step workflows
  </Card>

  <Card title="Contextual Awareness" icon="sitemap" href="/core-concepts/skills/contextual-awareness">
    Share context between orchestrated agents
  </Card>

  <Card title="Knowledge API" icon="brain" href="/core-concepts/skills/knowledge-api">
    Agents can share knowledge base access
  </Card>

  <Card title="View All Skills" icon="layer-group" href="/core-concepts/skills/built-in-skills">
    Return to built-in skills overview
  </Card>
</CardGroup>
