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. Use selfManagedAgents in production. For local development, use agents__unsafe_dev_only in React or agents in Angular.

Production: self-managed agents

selfManagedAgents is the supported configuration option for connecting agents you manage yourself, for example an HttpAgent 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.

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.

Part of CopilotKit Intelligence

selfManagedAgents is part of the CopilotKit Intelligence Enterprise plan. Talk to an engineer about licensing for production use.

You can combine selfManagedAgents with runtimeUrl. Runtime-discovered agents and self-managed agents coexist; address each by its agentId.

Development: local agents

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.

selfManagedAgentsLocal agents
Intended forProduction, agents you manageLocal dev / prototyping
AuthYour responsibilityYour responsibility
Runtime middleware / routingNot appliedNot applied
Precedence on collisionWinsOverridden by selfManagedAgents

How is this guide?