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

TaskGuide
Build, run, stream, and handle resultsAgents and Runs
Select a model and configure authenticationModels and Model authentication
Add function tools and application dependenciesTools and dependencies
Accept media input and return typed outputInputs and outputs
Select optional behaviorCapabilities
Manage conversation context and tasksContext
Share file or record memoryMemory
Work with files, shell, and multiple EnvironmentsEnvironments
Persist, resume, and fork ThreadsState and Resume
Connect MCP toolsMCP
Understand images, audio, and videoMultimedia understanding
Run child agents or restricted Python orchestrationDelegation and CodeAct
Discover procedural instructionsSkills
Set budgets and inspect usageUsage and limits
Trace runs and stream observationsObservation
Add middleware and Environment integrationsPlugins
Embed Harness with durable application stateHosting
Test without provider credentialsTesting

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 (AgentSpec and 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

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.

On this page