Skip to main content

Agent Harness

a13n-harness is the process-local Pydantic AI execution foundation for Agent Foundation agents. The repository directory is packages/agent-harness, the Python distribution is a13n-harness, and the import package is a13n_harness.

Capability composition

Agent definitions compose behavior through Pydantic AI Capabilities. The first-party feature Capabilities own lifecycle hooks and select pure Toolsets; the Toolsets depend only on provider-neutral ports such as FileOperator, MediaReader, DocumentConverter, and WebClient.

from a13n_harness import (
    DynamicEnvironmentCapability,
    DynamicEnvironmentConfiguration,
    HandoffCapability,
    RuntimeContextCapability,
    SelfHealingModelCapability,
    UserInteractionCapability,
    WorkingStateCapability,
)

capabilities = (
    DynamicEnvironmentCapability(
        DynamicEnvironmentConfiguration(
            file_tools=True,
            shell_tools=True,
            process_tools=True,
            port_tools=False,
            max_reference_entries=1_024,
        )
    ),
    RuntimeContextCapability(),
    SelfHealingModelCapability(),
    HandoffCapability(),
    WorkingStateCapability(),
    UserInteractionCapability(),
)

Embedding code supplies current Environment and provider collaborators through RunBindings. Media, document, and Web implementations stay behind their typed run collaborators rather than becoming dependencies of the Harness core. Static callers may import reusable Toolsets from a13n_harness.toolsets; their model-facing JSON results use named TypedDict contracts in the corresponding Toolset modules. Managed invocation policy and client-tool contracts are available from a13n_harness.tools.

Execution boundary and filters

Every built Agent includes one outer ToolExecutionBoundaryCapability and one innermost MessageIntegrityFilterCapability; application definitions do not install either boundary manually. First-party Toolsets own semantic progressive disclosure and can use the shared typed helper to save a fuller redacted result in a run-private model-readable file. The execution boundary preserves ordinary Pydantic dispatch and remains the sole mandatory final validation, redaction, and larger hard-size fallback for locally executable function-tool text/JSON results. Complete trusted HarnessToolMetadata additionally selects managed authorization, credentials, grants, retry, and invocation events.

Request/history filters live in a13n_harness.filters. Message integrity is mandatory; ContentFilterCapability and ColdStartFilterCapability are optional definition-selected filters for native multimodal request compatibility and cold-cache reduction of already-consumed tool-result strings. SelfHealingModelCapability is the recommended explicit selection for known one-shot provider-history repairs: it installs SelfHealingModel around the final effective request Model. It is not enabled implicitly. Interrupted-stream ModelAttempt recovery remains in the Harness rather than a request filter or the self-healing wrapper.

Every HarnessState carries the stable thread_id of one independently advancing history. Resume preserves that ID, HarnessState.fork() creates a new one, and each process-local HarnessRunStream, event, and result pairs it with a fresh run_id. The stream's public union is HarnessStreamEvent.

Runnable examples and guides

The Agent Application example progresses from the minimal application-owned build and fresh bindings to managed Direct Local tools, structured resume, and Host-owned persistence and recovery. The plugin integration example publishes and selects a real Harness plugin distribution.

The Agent Harness user guide covers installation, first-party feature families, filters, Environments, results, resume, and usage. The plugin guide covers packaging, configuration, lifecycle, and discovery from a Host-managed plugin directory without a process restart.

Versioning

Agent Harness, a13n-environment-provider, and a13n-stream-protocol form the Harness release group. A release/harness-v<version> tag publishes all three distributions at exactly the same version, where <version> is stable X.Y.Z or RC X.Y.Z-rc.N. Python package metadata represents the RC as X.Y.ZrcN. Published Harness metadata pins the exact Provider version, and published Stream Protocol metadata pins the exact Harness version. Agent UI releases independently and selects a Harness release explicitly.

The accepted architecture and public contract are defined in the Agent Harness specification.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

a13n_harness-0.0.3.tar.gz (389.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

a13n_harness-0.0.3-py3-none-any.whl (325.5 kB view details)

Uploaded Python 3

File details

Details for the file a13n_harness-0.0.3.tar.gz.

File metadata

  • Download URL: a13n_harness-0.0.3.tar.gz
  • Upload date:
  • Size: 389.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","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}

File hashes

Hashes for a13n_harness-0.0.3.tar.gz
Algorithm Hash digest
SHA256 f9fb47adfb8b2f95b57ea8fbceb2945e22152973a507f22979d5b86330c5af59
MD5 b85c5658303a627d65ed26830bee8e35
BLAKE2b-256 a9132370180afe39dc4e1de381a64db2fa87056c049bbbf4c11d23e2a1242303

See more details on using hashes here.

File details

Details for the file a13n_harness-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: a13n_harness-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 325.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","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}

File hashes

Hashes for a13n_harness-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 32c19c152b70315add131bab1654b02adca2eed372c0aa36e60e6cdef26b9f3b
MD5 6098660640c2aa06a52f7e7a2df2af3b
BLAKE2b-256 9bd598575cb2b8779c271869ce2c179dc8e9f0794225ea658a7538162253562f

See more details on using hashes here.

Release history Release notifications | RSS feed

0.0.17

2 files

0.0.16

2 files

0.0.15

2 files

0.0.14

2 files

0.0.13

2 files

0.0.12

2 files

0.0.10

2 files

0.0.9

2 files

0.0.8

2 files

0.0.7

2 files

0.0.6

2 files

0.0.5

2 files

0.0.4

2 files

This release

0.0.3 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page