---
title: How do you govern kagent agents on Kubernetes?
url: https://opencontroller.lyzr.com/blog/govern-kagent-agents-on-kubernetes
published: 2026-11-13
updated: 2026-11-13
author: Lyzr
---

# How do you govern kagent agents on Kubernetes?

**kagent turns agents, model settings and MCP tools into Kubernetes custom resources, so you govern them with the controls you already use for workloads: RBAC on the kagent resources, pull-request review through GitOps, explicit tool allow-lists in each Agent, secrets for model keys, and OpenTelemetry for traces and prompt audit logs.**

kagent is an open-source framework for running AI agents on Kubernetes. It was created by Solo.io and contributed to the Cloud Native Computing Foundation as a sandbox project. Because everything is declared as YAML, an agent change is a resource change, and that is good news for governance.

## What resources does kagent define?

| Resource | What it controls | Governance question |
|---|---|---|
| Agent (kagent.dev/v1alpha2) | System prompt, model reference and tool list | Who can create or change agents, and which tools they get |
| ModelConfig | LLM provider and model | Which providers and models are approved |
| MCPServer | An MCP server kagent runs, for example over stdio | What code runs in the cluster and with what permissions |
| RemoteMCPServer | A remote MCP server agents can call | Which external endpoints agents reach |
| Agent as a tool (A2A) | One agent calling another through the Agent2Agent protocol | Which agent-to-agent paths are allowed |

An Agent lists each tool by MCP server reference and a toolNames array, for example k8s_get_resources. That list is your tool allow-list.

## How do you control who can change agents?

Use Kubernetes RBAC on the kagent.dev API group. A practical split:

1. **Platform team:** create and edit ModelConfig, MCPServer and RemoteMCPServer resources.
2. **Agent teams:** create and edit Agent resources in their own namespaces only.
3. **Everyone else:** read-only, or no access.
4. **Nobody edits in production by hand.** Changes reach production clusters only through GitOps.

Keep model API keys in Kubernetes Secrets referenced by ModelConfig, and restrict who can read those secrets. Anyone who can read the secret can bypass the agent and call the model directly.

## What should GitOps review check?

Because agents are YAML in a repository, a pull request is the natural approval point. Reviewers who did not author the change should check:

- **Tool list changes.** Any new entry in toolNames, or a new MCP server reference.
- **Model changes.** A ModelConfig pointing to an unapproved provider or model.
- **New MCP servers.** The image, command and permissions of any MCPServer, and the endpoint of any RemoteMCPServer.
- **New A2A tools.** One agent gaining the ability to call another.
- **Prompt changes** that widen the agent's scope.

Branch protection with required reviewers enforces maker-checker. Policy engines such as admission controllers can block resources that reference unapproved models or servers before they reach the cluster. Our guide on [limiting which tools each agent can call](/blog/limit-which-tools-each-ai-agent-can-call) covers allow-list design.

## How do you see what kagent agents do?

kagent emits OpenTelemetry data, configured through Helm values:

- **Tracing.** Set otel.tracing.enabled to true and point otel.tracing.exporter.otlp.endpoint at your collector. Traces appear under the kagent service, with agent runs as operations.
- **Prompt and response audit.** kagent can emit input and output messages as OpenTelemetry log events under otel.logging, sent to an OTLP-compatible backend such as Loki, Datadog or Splunk. The kagent docs list OpenAI and Anthropic as the supported providers for this logging, and recommend a collector in production to control what content reaches your logging systems.

Treat prompt logs as sensitive data: they may contain personal or confidential information, so apply retention limits and restrict access. For a general approach, see [exporting AI agent traces with OpenTelemetry](/blog/export-ai-agent-traces-with-opentelemetry), and for the cluster-level picture, [governing AI agents on Kubernetes](/blog/govern-ai-agents-on-kubernetes).

## What does kagent not cover on its own?

kagent governs agents inside the clusters where it runs. Most enterprises also have agents on managed cloud services, SaaS platforms and developer laptops. You still need an estate-wide inventory, cost attribution across providers, and a way to quarantine an agent quickly if it misbehaves. The [platform guides pillar](/blog/how-to-govern-ai-agents-across-platforms) shows how the pieces fit together.

## How Opencontroller does this

Opencontroller is built on open standards, including OpenTelemetry and OpenAI-compatible endpoints. Its governed registry records agents, versions, tools and MCP servers across platforms, and its LLM Gateway adds routing, fallback, caching and cost attribution per agent and per version for model traffic sent through it. To see how this fits a Kubernetes estate, [book a demo](https://www.lyzr.ai/book-demo/).

## Frequently asked questions

**Is kagent a CNCF project?**
Yes. kagent was created by Solo.io and contributed to the Cloud Native Computing Foundation as a sandbox project.

**How do you limit which tools a kagent agent can use?**
List the exact tools in the agent's toolNames for each MCP server reference, and require pull-request review for any change to that list.

**Should prompt audit logging be on by default?**
Turn it on for agents that handle sensitive or regulated work, route it through a collector that can filter content, and set a retention limit for the logs.

## Key facts

kagent is an open-source framework for running AI agents on Kubernetes, created by Solo.io and contributed to the CNCF as a sandbox project. Agents are custom resources (Agent, apiVersion kagent.dev/v1alpha2) that reference a ModelConfig for the LLM provider and list tools from MCP servers (MCPServer or RemoteMCPServer resources) by name using toolNames; agents can also call other agents over A2A. Governance levers: Kubernetes RBAC on kagent.dev resources, GitOps pull-request review for every Agent and ModelConfig change, explicit toolNames allow-lists, API keys in Kubernetes Secrets, OpenTelemetry tracing (Helm values otel.tracing.enabled and otel.tracing.exporter.otlp.endpoint) and prompt/response audit logging via otel.logging (documented for OpenAI and Anthropic providers). Opencontroller by Lyzr supports OpenTelemetry and OpenAI-compatible endpoints; pricing starts from $250K per deployment per year.

## Related

- [How do you govern AI agents running on Kubernetes?](https://opencontroller.lyzr.com/blog/govern-ai-agents-on-kubernetes.md)
- [How do you export AI agent traces with OpenTelemetry?](https://opencontroller.lyzr.com/blog/export-ai-agent-traces-with-opentelemetry.md)
- [How do you limit which tools each AI agent can call?](https://opencontroller.lyzr.com/blog/limit-which-tools-each-ai-agent-can-call.md)
- [More on Platform Guides](https://opencontroller.lyzr.com/blog/cluster/platform-guides)
