Agent harnesses change every few months, and each fails in its own way. Principles for agent systems that survive a change of harness, model or provider.
The model gets the attention, but the harness decides what an agent can do. By harness we mean the software that turns a model into an agent: the loop that plans and calls tools, the file and system access it is given, its permission modes, how it keeps and compacts context, how a session is saved and resumed, and where a person is asked to approve.
Harnesses are improving fast, and the best one for a given job changes every few months. Each also fails in its own way: a budget runs out halfway through a task, a stream drops, a provider has an incident, a new version changes a default. If your system is wired into one harness, you inherit its roadmap and its outages. These are the principles we build on instead.
Keep the state outside the harness
The instructions, the task, its history and its artifacts belong to your system, in a repository, a database or a queue, not inside one tool's session. A task that carries its own state can be resumed in another session, on another harness or another model, and carry on where it stopped. A task whose context lives only in one session starts over.
Write the instructions once
The rules every agent follows, from coding conventions to what it must never do, should live in one versioned place. Each harness has its own way of loading instructions, so generate or link them from that single source, and layer project-specific rules on top. A rule then changes once, and every agent picks it up in its next session.
Put tools behind a standard interface
Tools are how agents touch the world, and they are the expensive part to rebuild. Expose them through a standard tool protocol such as MCP, with typed inputs and outputs and an explicit permission for each one. Changing the harness then means pointing it at the same tools, not writing them again.
Use roles, not one long session
A single long session with broad permissions is the easiest thing to start and the hardest to trust. Split the work into roles, each with its own session, narrow permissions and only the tools it needs.
In the test-agent framework we built, a planner explores a web application and writes a test plan, a generator turns the plan into executable browser tests, and a healer debugs the tests that fail and repairs them. Each runs in an isolated session with restricted permissions, inside a container that runs headed when someone is debugging and headless in continuous integration. When the harness or the model underneath changes, the roles and the contracts between them stay the same.
Keep the controls out of the prompt
Permission modes, approvals, the folders and data an agent may touch, and spending limits belong in the software around the agent, enforced by code. They hold when the model has a bad day. An instruction to be careful does not.
Design for failure
Assume every session can die and every provider can go down. Make work resumable, make retries safe to repeat, and let a request move to another provider when the first one fails. Make failure visible: a task that is stuck should say so to a person, quickly. Record failures by kind, never by content, so the logs help you without becoming a liability.
Keep secrets out of band
Agents should never ask for a credential in a conversation, and a key should never appear in a prompt, a transcript or a log. Give each agent scoped credentials it can read but not print, issued outside the conversation.
When this is worth the effort
Not every team needs it on day one. It pays off when several teams or agents share the same tools, when work has to survive a provider outage, when a regulated environment needs the same controls on every agent, or when you expect to change models more than once a year. Most of these principles are the discipline we bring to agents in production anyway: explicit control flow, permissioned tools, a trace for every run and a person where the stakes call for one. The harness is where that discipline lives, and it is what we design in agent harnesses and runtimes.
Working on something like this?
We take AI from a promising proof of concept to a system that ships and holds up.
Book a discovery call