Harness
An embeddable Python SDK for building agents, connecting tools and Environments, and continuing work from saved state.
Harness (a13n-harness) runs or streams agent work inside your own process. Your application supplies current credentials and chooses what to persist. Harness UI provides an interactive local Host; Service operates managed agents.
Start with a small Agent
The offline quickstart builds and runs an Agent without credentials or external services:
Build once, then supply current run inputs. Save the returned state to continue the same Thread.
Learn by feature
| Task | Guide |
|---|---|
| Build, run, stream, and handle results | Agents and Runs |
| Select a model and configure authentication | Models and Model authentication |
| Add function tools and application dependencies | Tools and dependencies |
| Accept media input and return typed output | Inputs and outputs |
| Select optional behavior | Capabilities |
| Manage conversation context and tasks | Context |
| Share file or record memory | Memory |
| Work with files, shell, and multiple Environments | Environments |
| Persist, resume, and fork Threads | State and Resume |
| Connect MCP tools | MCP |
| Understand images, audio, and video | Multimedia understanding |
| Run child agents or restricted Python orchestration | Delegation and CodeAct |
| Discover procedural instructions | Skills |
| Set budgets and inspect usage | Usage and limits |
| Trace runs and stream observations | Observation |
| Add middleware and Environment integrations | Plugins |
| Embed Harness with durable application state | Hosting |
| Test without provider credentials | Testing |
What Harness owns
AgentSpec and HarnessBuilder define and build an ExecutableAgent. Each run creates an AgentContext and returns events, results, usage, and HarnessState. Harness owns process-local execution; an embedding Host owns its users, persistence, and recovery policy.
The SDK accepts native model, message, tool, and output types from its dependencies. Harness UI YAML is Host configuration, not an AgentSpec schema.
Three places to put configuration
- Definition (
AgentSpecand builder arguments): instructions, output type, and stable capabilities. - Invocation (
RunBindings, Environment, input): current identity, clients, tools, and access policy. - Continuation (
HarnessState): messages and portable capability state; not credentials or live resources.
Runnable applications
- Agent application: offline streaming, persisted turns, and restart recovery.
- Environment Providers: fresh adapters, re-entry, and explicit destruction.
- Plugins: trusted middleware and Environment extensions.
- Installed Provider: Provider package discovery.
- MCP App: interactive MCP tool results.
Versions and scope
These guides track the source API on main. Harness and Stream Protocol publish at one exact release version; Harness UI releases independently. See the accepted specifications for architecture contracts.