Agent Harness
Harness (a13n-harness) is the embeddable execution SDK behind Harness UI and Service. It builds reusable agents, runs them with current tools and Environments, streams observations, and returns state for continuation. Start with the offline quickstart; the Python import is a13n_harness.
Capability composition
Build an AgentSpec with only the behavior your application needs. For example, to expose Environment tools and working state:
from a13n_harness import AgentSpec, HarnessBuilder
from a13n_harness.capabilities import WorkingStateCapability
from a13n_harness.environment import DynamicEnvironmentCapability, DynamicEnvironmentConfiguration
executable = HarnessBuilder().build(
AgentSpec(model="openai-responses:gpt-5"),
output_type=str,
capabilities=(
DynamicEnvironmentCapability(DynamicEnvironmentConfiguration()),
WorkingStateCapability(),
),
)
Supply a fresh Provider Environment to each run(..., environment=...), or use environments={...} for named mounts. Harness enters and closes adapters; your application selects their configuration, current state, access policy, and when to destroy a backing target. See Environments and Capabilities.
Model construction
Pass a native model directly through HarnessBuilder.build(model=...), or select one in AgentSpec.model. a13n_harness.infer_model() constructs a model from supported aliases and caller-owned provider factories. create_model_http_client() builds a caller-owned httpx2 client for provider requests. Configure credentials and close owned clients in your application. See Models and Model authentication.
Execution boundary and filters
Harness prepares images for the selected Model without changing saved history or original files. Configure HarnessModelCharacteristics.image_input with ImageInputPolicy, or set image_input=None to disable preparation. See Context.
Recognized provider-history repairs are on by default; configure them through SelfHealingModelCapability or disable automatic installation with HarnessBuilder(self_healing_enabled=False). For long Threads, opt into history compaction. Add other Capabilities for policy, memory, or delegation.
A completed Run returns a HarnessState with a stable thread_id. Pass it as previous_state to continue the Thread; each new Run receives a fresh run_id. The Host persists accepted state and reconstructs credentials and other current authority on resume. State and resume covers serialization and interrupted calls.
Runnable examples and guides
- Agent application: offline streaming turns, checkpointing, and restart recovery.
- Environment Providers: construction, re-entry, and lifecycle.
- Plugins and extensions: packaged middleware, Capabilities, and Environment integrations.
- MCP tools: an in-process server and an offline Model, followed by Host-owned clients and per-Run headers.
- Harness guide: the public API by task.
Versioning
Harness and a13n-stream-protocol publish together at one exact version. Harness UI releases independently. The Harness specification owns the accepted contracts.
Metadata
Release files for a13n-harness 0.7.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| a13n_harness-0.7.0.tar.gz | 1.1 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| a13n_harness-0.7.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.9 MB
Release files / a13n_harness-0.7.0.tar.gz
| Download URL | a13n_harness-0.7.0.tar.gz |
|---|---|
| Size | 1.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
43a0053d61837e3e492205695d2e2146a4aefb86cf8bb318209ff588e3f07e36
|
|
BLAKE2b-256 checksum How to use checksums |
e3b348084795240c0a5cc9f423f98c716051880704ff7425eec5d18fbcb27dee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / a13n_harness-0.7.0-py3-none-any.whl
| Download URL | a13n_harness-0.7.0-py3-none-any.whl |
|---|---|
| Size | 796.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7727043a65a68d386c9e752c0b5d39b984041840efc85c49e0a972648a08489a
|
|
BLAKE2b-256 checksum How to use checksums |
1bef700558c4373591194e978dd49f626bd72c35a3a6ccb07c65f9d08737f978
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|