Skip to main content

harnessweaver

The core of HarnessWeaver, the composable AI harness framework: the spec loader, the 13-point hook bus, envelope and budgets, the error taxonomy, the runners, the built-in modules and the test kit. It depends only on pydantic, opentelemetry-api, pyyaml, anyio and loguru.

uv add harnessweaver                 # the core
uv add "harnessweaver[openai]"       # plus a first-party plugin
uv add "harnessweaver[all]"          # every first-party plugin, the CLI and the sidecar
import harnessweaver as hw

harness = hw.load("harness.yaml")        # spec + org baseline + env overlay, validated at startup

# Wrap: govern a client the app already has
client = harness.instrument(AsyncOpenAI(base_url=GATEWAY))

# Session: your code owns the flow, the harness governs each step
async with harness.session("support", principal=user, tenant="acme") as s:
    route = await s.decide("intent", text=question)
    articles = await s.context("help").fetch(question)
    answer = await s.generate(prompt="answer@1", question=question, intent=route.choice)

# Run: the harness owns the lifecycle
result = await harness.run("extract_invoice", doc, principal=user)
Extra Adds
openai openai.chat for any OpenAI-compatible endpoint, and instrument() for OpenAI clients
anthropic anthropic.messages for Claude, and instrument() for Anthropic clients
pydantic-ai The pydantic_ai.agent runner and wrap() for Pydantic AI agents
monty monty.sandbox for code-executing tools
otel otel.sdk: OpenTelemetry SDK and exporter setup
cel cel.policy: full CEL for policy rules
cli The harnessweaver command
sidecar harnessd, the HTTP sidecar
all All of the above

The test kit is harnessweaver.testing, and installing the package adds the plugin conformance suite to pytest (pytest --harnessweaver-conformance=<namespace>).

Documentation: the docs, from Concepts to the spec reference.

Metadata

Release files for harnessweaver 0.18.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for harnessweaver 0.18.0
File Size Uploaded Provenance Actions
harnessweaver-0.18.0.tar.gz 308.5 kB Without provenance Details for harnessweaver-0.18.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for harnessweaver 0.18.0
File Interpreter ABI Platform Actions
harnessweaver-0.18.0-py3-none-any.whl Python 3 none any Details for harnessweaver-0.18.0-py3-none-any.whl

Total release size: 621.7 kB

Release files / harnessweaver-0.18.0.tar.gz

Download URL harnessweaver-0.18.0.tar.gz
Size 308.5 kB
Tags Source
SHA-256 checksum
How to use checksums
14200c6793968292d0684d698e48590177b90a53e937b3905ebbc01045784dd7
BLAKE2b-256 checksum
How to use checksums
4dacb8432a9b7d747e9368c3edc6606b91d1287640c117a3849fa9577740db02
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","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 / harnessweaver-0.18.0-py3-none-any.whl

Download URL harnessweaver-0.18.0-py3-none-any.whl
Size 313.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a8548d01fc9ce5fcfd0e226a1b49f5f3d6afe3d1915c7d026c0c44c9135790ef
BLAKE2b-256 checksum
How to use checksums
a493dea9d70ea70faf772cdfce44de90750d2bfff3d847f24054592135eb6335
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","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}

Security for harnessweaver 0.18.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.18.0 This release

2 release files No provenance

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