Harnesses and models
Ask an agent to send an email, and two pieces work underneath to get it done. The model decides an email should go out, but it cannot send one; all it can do is ask. The harness is the program that acts on that ask. This page explains what each piece does, and why Agenta asks you to choose the harness, the model, and the credential behind them separately.
What a model does
A large language model does exactly one thing. You send it a message, or a list of messages, and it returns a message. That is all it does.
A model cannot read a file, search the web, or send an email. When it needs one of those, all it can do is say so in its reply: call the tool send_email with these arguments. Something else has to act on that reply.
What a harness does
The harness is that something else. It runs the model in a loop:
- It sends the conversation to the model, together with your instructions, the list of tools the agent has, and the name and description of each skill.
- The model replies. If the reply asks for a tool call, the harness runs that tool.
- The harness adds the tool's result to the conversation and sends it back to the model.
- The loop repeats until the model replies with an answer instead of another tool call.
The harness also manages what surrounds the loop. It loads your instructions at the start of a session, and it reads the AGENTS.md files it finds in the folders the agent works in.
The harness handles compaction, which is what happens when a conversation grows past what the model can hold. The harness summarizes the earlier part of the conversation so the session can keep going.
Agenta ships two harnesses, Claude Code and Pi. Both run the loop above. They differ in how they compact a long conversation, how they load instructions, and which models they accept.
You choose the harness, the model, and the credential separately
Setting up an agent's runtime means three separate decisions:
- The harness. Claude Code or Pi.
- The model. The model the harness sends the conversation to.
- The credential. Where that model runs. The same model can come from the provider directly, from a proxy you run, or from a cloud such as AWS Bedrock.
They are separate because they change for different reasons. You change the model when you want a different tradeoff between quality, speed, and cost. You change the credential when your company routes model traffic through its own gateway, or when your model access sits with a cloud provider rather than with the model vendor. Neither of those is a reason to change the harness.
Because the three are separate, switching any one of them is a configuration change rather than a rebuild. Your instructions, skills, tools, files, and permissions stay where they are, so the agent that sends your email can move to another model and keep behaving like the agent you built.
To make these choices for an agent, see Choose a harness and model.
Where models come from
Agenta works with models from OpenAI, Anthropic, Google Gemini, Azure, AWS Bedrock, Mistral AI, Cohere, Groq, Together AI, DeepInfra, Perplexity AI, Anyscale, OpenRouter, and MiniMax. It also works with any OpenAI-compatible endpoint, and with models you host yourself through Ollama.
The models an agent can use depend on the harness you selected. Each harness accepts its own set of models.
Using a subscription instead of API billing
When you self-host Agenta, an agent can run against a Claude or ChatGPT subscription you already pay for, instead of metered API billing. See Use your own subscription.
Related
- Choose a harness and model walks through setting these on an agent.
- Cost and usage explains what each pass through the loop costs.
- Agents covers the configuration that stays put when you switch harness or model.