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

# Sub-Agents

> Manage reusable sub-agents from the Sub Agents tab outside of any parent agent flow

## What the sub-agent library is

The **Sub Agents** tab on the **Agent Configurations** page lists every sub-agent your tenant can use. Sub-agents are reusable across parent agents, so editing one updates every flow that includes it. Use this view when you want to create a sub-agent up front, edit one that is shared across flows, or audit which parent agents and tools are attached to it.

<Note>
  For adding or editing a sub-agent inside a single parent agent flow, see [Sub-agents in Parent Agent Flows](/agents/parent-agent-sub-agents). Both entry points open the same dialog and expose the same fields.
</Note>

<Frame>
  <img src="https://mintcdn.com/maadify/X4aEKWAIWIr8YAhZ/images/sub-agents/sub_agents_page.png?fit=max&auto=format&n=X4aEKWAIWIr8YAhZ&q=85&s=8cb7d2977dd4cadc966e01c636192161" alt="Sub-agent library listing names, owners, and usage counts" width="1515" height="879" data-path="images/sub-agents/sub_agents_page.png" />
</Frame>

## Open the Sub Agents tab

<Steps>
  <Step title="Open Agent Configurations">
    Go to **Agent Configurations** from the sidebar.
  </Step>

  <Step title="Switch to the Sub Agents tab">
    At the top of the page, select **Sub Agents** in the segmented control next to the heading. The page heading changes to **Sub Agent Configurations** and the grid of sub-agents loads below.
  </Step>
</Steps>

<Note>
  The **Sub Agents** tab only appears if your role includes the **sub\_agents.read** permission. The **Add Sub Agent** button is gated on **sub\_agents.create**, and inline edits require **sub\_agents.update**.
</Note>

## Browse the sub-agent grid

The grid shows one card per sub-agent and supports search, filtering, and pagination.

* **Search Sub Agents**: type a name or keyword and press **Enter** or click **Search** to filter the list.
* **Show Shared Sub Agents**: toggle on to include sub-agents owned by other tenants that have been shared with you. Toggle off to see only sub-agents your tenant owns.
* **Pagination**: when there are more results than fit on one page, use the pager controls below the grid to move between pages.

### What each card shows

Each card summarizes a sub-agent at a glance so you can decide whether to open it.

* **Agent type badge**: **Assistant** (green), **Proxy** (purple), **User Proxy** (purple), or **Custom** (blue).
* **Owner badge**: the tenant that owns the sub-agent, or **System** for built-in sub-agents.
* **Name and icon**: the sub-agent display name with a bot icon for assistants and a code icon for proxies.
* **Description**: a short summary of what the sub-agent is for. Hover to see the full description.
* **System Prompt**: the prompt template attached to the sub-agent. Use **Add**, **Edit**, or **View** (depending on your permissions) to manage the template inline without leaving the grid.
* **Tools**: overlapping connector avatars for each tool the sub-agent can call. Hover an avatar to see the tool and connector name. A **+N** badge appears when there are more tools than fit; hover it to list the rest. Click any tool avatar to jump straight into editing that tool on the sub-agent.
* **Parent Agents**: avatars for every parent agent that uses this sub-agent. Hover for the parent agent name, action, tenant, and description, and click an avatar to open that parent agent in a new tab.

<Frame>
  <img src="https://mintcdn.com/maadify/X4aEKWAIWIr8YAhZ/images/sub-agents/sub_agent_card.png?fit=max&auto=format&n=X4aEKWAIWIr8YAhZ&q=85&s=72bd7b04d40fbc929faf938106c31bae" alt="Sub-agent card showing agent type badge, owner badge, description, system prompt, tools, and parent agents" width="470" height="640" data-path="images/sub-agents/sub_agent_card.png" />
</Frame>

## Create, edit, or copy a sub-agent

From the grid you can:

* **Add a new sub-agent** by selecting **Add Sub Agent** in the top-right of the grid. The dialog opens in create mode.
* **Edit an existing sub-agent** by clicking its card. If your tenant owns the sub-agent and you have **sub\_agents.update**, the dialog opens in edit mode; otherwise it opens in view-only mode.
* **Create a copy of a shared sub-agent** by opening it and toggling **Create a Copy of this Agent** before saving. Copies are owned by your tenant and can be edited without affecting the original.

<Tip>
  Copy a shared sub-agent when you need a tenant-specific change to its prompt, tools, or memory configuration. Edits made on the copy do not affect the parent agents that still use the original.
</Tip>

For details on every field in the dialog (identity, LLM, visibility, memory, structured output), see [Sub-agents in Parent Agent Flows](/agents/parent-agent-sub-agents#sub-agent-fields-you-can-edit).

<Tabs>
  <Tab title="Edit Agent View">
    <Frame>
      <img src="https://mintcdn.com/maadify/X4aEKWAIWIr8YAhZ/images/sub-agents/edit_agent_view.png?fit=max&auto=format&n=X4aEKWAIWIr8YAhZ&q=85&s=0bb711b252a1038898f5778bbc7221e6" alt="Create sub-agent dialog" width="1541" height="812" data-path="images/sub-agents/edit_agent_view.png" />
    </Frame>
  </Tab>

  <Tab title="Add Tools">
    <Frame>
      <img src="https://mintcdn.com/maadify/X4aEKWAIWIr8YAhZ/images/sub-agents/sub_agent_add_tools.png?fit=max&auto=format&n=X4aEKWAIWIr8YAhZ&q=85&s=dcbe389cc7cd3b48d1065ca4a36e9fce" alt="Edit sub-agent dialog" width="1535" height="669" data-path="images/sub-agents/sub_agent_add_tools.png" />
    </Frame>
  </Tab>

  <Tab title="Edit Tools">
    <Frame>
      <img src="https://mintcdn.com/maadify/X4aEKWAIWIr8YAhZ/images/sub-agents/sub_agent_edit_tools.png?fit=max&auto=format&n=X4aEKWAIWIr8YAhZ&q=85&s=65882bb9fe49826689db1c74be10ab0a" alt="Edit sub-agent dialog" width="1570" height="530" data-path="images/sub-agents/sub_agent_edit_tools.png" />
    </Frame>
  </Tab>

  <Tab title="Add/Edit System Prompt">
    <Frame>
      <img src="https://mintlify.s3.us-west-1.amazonaws.com/maadify/images/parent-agents/sub_agent_system_prompt.png" alt="Edit sub-agent dialog" />
    </Frame>
  </Tab>
</Tabs>

## Structure sub-agent outputs

Assistant sub-agents can return structured JSON instead of free-form text. Use structured output when you want the sub-agent to extract values, classify a request, summarize records into fields, or pass predictable data into a later workflow step.

The schema builder helps you define the shape of the response. You can:

* **Add fields manually** with names, display names, descriptions, and types.
* **Choose field types** such as string, integer, number, boolean, object, arrays, and object arrays.
* **Mark fields as required** so the agent must include them in the response.
* **Add options** when the agent should choose from a fixed list.
* **Set defaults, ranges, and length limits** for supported values.
* **Create nested properties** for objects and object arrays.
* **Generate fields** from a JSON schema or from an example JSON response.

Structured outputs are useful because later workflow steps can reference fields directly. For example, a sub-agent can return `priority`, `customer_name`, `line_items`, or `approval_summary`, and a parent agent can use those values in rule conditions, tool inputs, approvals, and notifications.

<Tabs>
  <Tab title="Add Schema with JSON">
    <Frame>
      <img src="https://mintcdn.com/maadify/X4aEKWAIWIr8YAhZ/images/sub-agents/structured_output_json.png?fit=max&auto=format&n=X4aEKWAIWIr8YAhZ&q=85&s=db33abb2210bb00215fb459f664338a1" alt="Sub-agent structured output fields with types and required flags" width="1560" height="760" data-path="images/sub-agents/structured_output_json.png" />
    </Frame>
  </Tab>

  <Tab title="Generated Fields from JSON Example">
    <Frame>
      <img src="https://mintcdn.com/maadify/X4aEKWAIWIr8YAhZ/images/sub-agents/structured_output_generated.png?fit=max&auto=format&n=X4aEKWAIWIr8YAhZ&q=85&s=16add1820152d899a505cda77dcc0017" alt="Generate structured output schema from a JSON example" width="1555" height="628" data-path="images/sub-agents/structured_output_generated.png" />
    </Frame>
  </Tab>
</Tabs>

<Warning>
  Changing a structured output schema can affect parent agents that map those fields into rules, tool inputs, approvals, or notifications.
</Warning>

## Edit impact

Editing a sub-agent updates every parent agent that uses it. Review dependent agents before saving changes.

<Warning>
  Changing prompts or tools can alter live workflows. Validate with a test run.
</Warning>
