Skip to main content
A coding agent is what actually writes the code during an experiment. Kapso drives them as subprocesses through a common interface, so the agent is a config choice rather than something the rest of the system knows about.

Which agents can I use?

Both shipped config modes, GENERIC and MINIMAL, set coding_agent.type: claude_code, so that is the agent you get unless you override it. An agent is only registered if its dependencies import, so aider is absent from a default install and kapso --list-agents shows five. Run that command to see what is actually available on your machine — it prints each registered agent with its description, default model, install command and the environment variables it reads:

Agent interface

All agents implement CodingAgentInterface:

How do I build an agent directly?

Most of the time the config picks the agent. To construct one yourself:
CodingAgentFactory.list_available() returns the registered agent names.

Claude Code

Anthropic’s CLI, and what both shipped config modes use. Best on complex refactoring and planning, with MCP tool support.

How do I authenticate Claude Code?

auth_mode accepts four values: The shipped config sets oauth on every Claude Code block, and the low-level adapter defaults to auto. For a non-interactive environment set CLAUDE_CODE_OAUTH_TOKEN in .env. An explicit mode removes higher-precedence credentials from the Claude subprocess environment, so oauth ignores an inherited ANTHROPIC_API_KEY, and bedrock drops every Anthropic credential so the CLI cannot bill the wrong provider. The parent process environment is never modified. Bedrock happens only when a config names it. auto never resolves to Bedrock, even with AWS credentials in the environment, so an existing campaign never changes provider, cost or model naming behind your back. Two things change together with the mode: aws_region is required and read from the config, never from AWS_REGION, and models are named by Bedrock inference profile id (us.anthropic.claude-haiku-4-5-20251001-v1:0) rather than by the aliases the other modes take. A missing region or missing credentials fails when the agent is constructed, with the fix in the message.

Codex

OpenAI’s CLI, run non-interactively with a full-access sandbox. This is what inference uses for research, judging and utility calls.
Set CODEX_API_KEY in .env instead of logging in for a non-interactive environment.

Gemini

Google’s SDK, via pip install google-generativeai. Fast and cost-effective for iterative refinement.
Set GOOGLE_API_KEY in .env.

OpenHands

Sandboxed, Docker-backed execution with full system access inside the sandbox.
OpenHands conflicts with the aider extra on litellm, openai and cffi. Install it in a separate environment, never alongside leeroo-kapso[aider].

OSS Claude Code

The Claude Code CLI pointed at an open-source model over an Anthropic-compatible endpoint, such as GLM on Fireworks. Same CLI, different backend.

CodingResult

All agents return a standardized result:

What must an agent return?

When used with kapso.evolve(), the coding agent must end its response with XML tags:
The search strategy extracts these tags (score becomes a float; null or an empty value becomes None) and hands them to the feedback generator to validate the evaluation and decide whether to continue. There is no fallback format: output without the tags is a warning and an empty result. An implementation session may also end without the tags by calling the request_from_user tool when the session needs something only a person can provide. Kapso later resumes that very session with your reply, through claude -p --resume for Claude Code and codex exec resume for Codex, which is why implementation sessions are launched with a session id (--session-id on Claude Code, --json on Codex to capture the thread id). See the inbox.

Example agent output

How does the feedback generator use an agent?

Coding agents also power the feedback generator. The default feedback generator uses claude_code, but any agent can be used:

CodingAgentConfig

Configuration passed to agents:

How do I add my own agent?

Registration is a classmethod call, not a decorator. Agents declared in agents.yaml are registered on module import; register() is how you add one at runtime.

How is Git handled?

Two ways, and the agent declares which by returning from supports_native_git():
Every shipped agent returns False except aider, which auto-commits.

What capabilities does an agent report?

Configuration

The coding_agent block, and auth_mode

Experiment lifecycle

Where the agent sits in one experiment
Related pages: Configuration · Experiment lifecycle · Orchestrator Kapso is an open-source framework by Leeroo that builds software toward measurable goals through experiment campaigns. Source code: github.com/Leeroo-AI/kapso · Install: pip install leeroo-kapso · Every page as plain text: llms.txt.