For the complete documentation index, see llms.txt. Markdown versions of all docs pages are available by appending .md to any docs URL.
Agent harness
Configure a Harness, the resource that defines which runtime executes an agent and what infrastructure it runs on.
Review configuration guidelines and reference for the Harness resource: every field it takes, the four runtimes it can select, and what each runtime supports. To understand a Harness and why it is separate from an AgentTemplate, see the core concepts.
Configure a Harness
The following configuration is for a complete Harness resource. Only workload, substrate, and one runtime block are required.
kubectl apply -f - <<EOF
apiVersion: kagent.dev/v1alpha3
kind: Harness
metadata:
name: my-harness
namespace: kagent
spec:
# Exactly one runtime block: kagent, codex, claude, or byo.
kagent: {}
workload:
image: ghcr.io/kagent-dev/kagent/golang-adk@sha256:c8ab012e9774d50e20ffa8cd035ddebff69486a2843b3af281f5f6ebc67ab512
env:
- name: LOG_LEVEL
value: info
- name: MY_API_KEY
credentialRef:
name: my-secret
key: api-key
substrate:
workerPoolRef:
name: kagent-default
snapshotPolicy:
location: gs://<your-bucket>/kagent/
allowedAgentTemplates:
selector:
matchLabels:
kagent.dev/harness: my-harness
EOFReview the following table to understand this configuration. For more information, see the API reference.
| Field | Required | Description |
|---|---|---|
One of kagent, codex, claude, byo | Yes | The runtime that executes the agent. Naming none, or more than one, is rejected. For the available runtimes, see Choose a runtime. |
workload.image | Yes | The runtime image, pinned by sha256 digest. A tag alone is rejected, because a revision must be reproducible. |
workload.command | For byo | Overrides the image entrypoint, up to 32 entries. Required for the byo runtime, optional otherwise. |
workload.args | No | Overrides the image arguments, up to 64 entries. |
env | No | Environment variables for the runtime, up to 100. Each entry sets either a literal value or a credentialRef naming a key in a same-namespace Secret, never both. |
substrate.workerPoolRef.name | Yes | The WorkerPoolWorkerPoolA Kubernetes custom resource declaring how many Workers to keep running and which sandbox class they use. An operator must provision one before any Harness can create AgentInstances.Learn more that this Harness’s Actors are scheduled onto. An operator must provision one before any agent can run. |
substrate.snapshotPolicy.location | Yes | The object storage location for Actor snapshotsSnapshotThe stored state that an Actor suspends to, held in object storage. Resuming restores the Actor from its most recent snapshot, which is what makes suspending idle agents cheap.Learn more. |
allowedAgentTemplates.selector | No | A label selector naming which AgentTemplates this Harness admits. Omitting it admits none, which makes the Harness unusable. Admission is a one-way match. An AgentTemplateAgentTemplateA Kubernetes custom resource defining what an agent does: its model, system prompt, tools, skills, and plugins. It runs only once a Harness accepts it.Learn more has no field naming a Harness, so whoever controls a Harness’s selector decides what it accepts. |
Choose a runtime
A Harness names exactly one of the following four runtimes, and that choice decides what executes an agent and how much of kagent’s feature set the agent can use.
| Runtime | What it runs | When to use it |
|---|---|---|
kagent | kagent’s own Go and Python engines | You want the full feature set: every model provider, agent-as-tool composition, skills, plugins, and long-term memory. |
codex | The Codex coding agent | You want Codex to do the work, and your model is OpenAI or an OpenAI-compatible Bedrock deployment. |
claude | The Claude coding agent | You want Claude to do the work, with Anthropic, Bedrock, or Anthropic on Vertex AI as the model. |
byo | Any container image of your own that implements kagent’s A2A contract | You have an agent framework kagent does not adapt, and you would rather bring the image than the integration. For more information, see Bring your own agent. |
The kagent and byo runtimes compile through the same path, so they accept the same model providers and the same AgentTemplate features. The codex and claude runtimes are purpose-built adapters, and each accepts a narrower slice.
Runtime-specific settings
spec.kagent is the only runtime block that takes settings of its own. The rest are empty.
spec:
kagent:
memory:
modelConfigRef:
name: embedding-model-config
ttlDays: 30| Field | Description |
|---|---|
memory.modelConfigRef.name | The ModelConfig supplying the embedding model, in the Harness’s namespace. Required when memory is set. |
memory.ttlDays | How many days a stored memory entry stays valid. Minimum 1. When omitted, the server applies a default of 15 days. |
Setting memory gives every agent on this Harness memory that persists across conversations. For how agents store and retrieve it, see Agent memory.
Model provider support
The runtime that a Harness selects decides which ModelConfig its AgentTemplates can use.
| Provider | kagent | byo | codex | claude |
|---|---|---|---|---|
OpenAI | ✅ | ✅ | ✅ | ❌ |
Anthropic | ✅ | ✅ | ❌ | ✅ |
Bedrock | ✅ | ✅ | ✅ | ✅ |
AnthropicVertexAI | ❌ | ❌ | ❌ | ✅ |
GeminiVertexAI | ❌ | ❌ | ❌ | ❌ |
AzureOpenAI | ✅ | ✅ | ❌ | ❌ |
Gemini | ✅ | ✅ | ❌ | ❌ |
Ollama | ✅ | ✅ | ❌ | ❌ |
SAPAICore | ✅ | ✅ | ❌ | ❌ |
Foundry | ✅ | ✅ | ❌ | ❌ |
Some supported combinations still carry restrictions.
| Combination | Restriction |
|---|---|
codex with OpenAI | Requires openAI.apiFormat: responses, and accepts no other openAI settings beyond baseUrl. |
codex with Bedrock | Accepts only OpenAI gpt-* model IDs, and no bedrock settings beyond region. |
claude with Anthropic | Accepts no anthropic settings beyond baseUrl. |
claude with Bedrock | Accepts no bedrock settings beyond region. |
claude with AnthropicVertexAI | Accepts only projectID and location. The Secret must hold a service_account key whose project_id matches and whose token_uri is https://oauth2.googleapis.com. |
Important
Neither codex nor claude accepts a ModelConfig that sets defaultHeaders, tls, or apiKeyPassthrough. Separately, the kagent and byo runtimes cannot use a ModelConfig whose credential is a file rather than a string. This restriction rules out both Vertex AI providers there. For more information about that limitation, see About model providers.
Tool and skill support
The coding-agent runtimes also constrain what an AgentTemplate can ask for.
| Constraint | Applies to |
|---|---|
A Shared agent-tool binding cannot itself carry tools, skills, plugins, or nested agents, and must use the same provider and credentials as the agent that binds it. | codex, claude |
| An MCPMCPModel Context Protocol, an open protocol for exposing tools and resources to a model. kagent reaches an MCP server through a RemoteMCPServer resource, and an AgentTemplate binds individual tools from it.Learn more server is bound whole. Claude does not support partial tool selection, so the agent sees every tool the server offers rather than only the ones a binding names. The compiler warns rather than failing. | claude |
A RemoteMCPServer must use the STREAMABLE_HTTP protocol. SSE is rejected. | codex |
The kagent and byo runtimes take the full set. For more information about what an AgentTemplate can bind, see About tools.
Telemetry content settings
Tracing and audit logging both carry the prompts and replies that an agent exchanges with a model. Two settings in the kagent Helm chart decide whether that content leaves the runtime, and each one reaches a different set of runtimes. Both default to false, and both take effect only where tracing or audit logging is already enabled.
otel:
captureSensitiveContent: false
logging:
captureRawApiBodies: false| Setting | What it includes | Applies to |
|---|---|---|
otel.captureSensitiveContent | Prompts, tool details, and assistant replies in the runtime’s telemetry. On the claude runtime, tool results require tracing, and assistant replies require audit logging. | codex, claude |
otel.logging.captureRawApiBodies | The complete provider API request and response bodies. This setting returns more than otel.captureSensitiveContent does, and it takes effect only when otel.logging.enabled is true. | claude |
The kagent runtime honors neither setting. To include message content for an agent on that runtime, set OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT in the Harness spec.env field. That variable defaults differently for each signal, so check the audit prompt onfiguration before you set it.
The controller sends the byo runtime no telemetry configuration, so neither setting reaches it. A byo image that implements OpenTelemetry itself reads whatever the Harness spec.env field holds. For more information, see Tracing.
Check that a Harness is ready
The READY column reports whether a Harness’s dependencies resolved.
kubectl get harness -n kagentA Harness that is not Ready most often names a WorkerPool that does not exist yet. For the specific reason, read its conditions with kubectl describe harness <harness-name> -n kagent.
Ready covers the Harness’s own dependencies, not whether a given agent runs on it. Whether an AgentTemplate compiles against this Harness is reported on the AgentTemplate, under status.harnesses. For that check and the conditions it reports, see Your first agent.