# Self-managed agents

> Connect AG-UI agents that you host and secure yourself.

If you host and secure your own AG-UI agent, the frontend can call it directly,
without the CopilotKit [runtime](/vue/langgraph-python/backend/copilot-runtime). Use
`selfManagedAgents` in production. For local development, use
`agents__unsafe_dev_only` in React or `agents` in Angular.

## Production: self-managed agents [#production-self-managed-agents]

`selfManagedAgents` is the supported configuration option for connecting agents you manage
yourself, for example an [`HttpAgent`](/vue/langgraph-python/backend/ag-ui) pointing at an
AG-UI-compatible backend you own and have already secured:

Each key is the `agentId` that chat components and frontend agent APIs use to
address that agent. Self-managed agents use your transport and your security
model. Because the requests don't pass through the CopilotKit runtime, the
runtime's server-side auth, middleware, and routing do not apply. Your agent
endpoint must [authenticate and authorize every request](/auth).

Open a chat that uses the `support-agent` agent ID and send a message. The
endpoint at `https://agents.example.com/support` receives the run, and its reply
streams into the chat.

<Callout type="info" title="Part of CopilotKit Intelligence">
  `selfManagedAgents` is part of the CopilotKit Intelligence [Enterprise
  plan](/vue/langgraph-python/intelligence/intelligence-platform). [Talk to an
  engineer](https://copilotkit.ai/talk-to-an-engineer) about licensing for
  production use.
</Callout>

<Callout type="info">
You can combine `selfManagedAgents` with `runtimeUrl`. Runtime-discovered agents
and self-managed agents coexist; address each by its `agentId`.
</Callout>

## Development: local agents [#development-local-agents]

## How they relate [#how-they-relate]

Both sources feed the same client-side agent registry. When both are supplied
they are merged, and **`selfManagedAgents` wins on a key collision**:

If at least one agent is registered through either provider option, the
frontend configuration check passes.

| | `selfManagedAgents` | Local agents |
|---|---|---|
| **Intended for** | Production, agents you manage | Local dev / prototyping |
| **Auth** | Your responsibility | Your responsibility |
| **Runtime middleware / routing** | Not applied | Not applied |
| **Precedence on collision** | Wins | Overridden by `selfManagedAgents` |
