Skip to main content

harness-sdk-python

The runs subsystem for Python Statewire hosts: @run_manager turns one async method into the run executor and mounts the run/* command surface (send, dequeue, edit, reload, stop, continue, input), each run in its own tray. Part of harness-sdk, with statewire and Pinboard.

Install

uv add harness-sdk-python

Extras: uv add "harness-sdk-python[postgres]", uv add "harness-sdk-python[deepagents]", uv add "harness-sdk-python[llm]", uv add "harness-sdk-python[typesafe]".

Use

from statewire import Statewire, command

from harness_sdk import HARNESS_PROTOCOL, RunManager, run_manager


class RunsHost(Statewire):
    protocols = (HARNESS_PROTOCOL,)

    async def lifespan(self):
        self.state = {"messages": []}
        yield

    @run_manager()
    async def run(self, ctx: RunManager.RunContext):
        for message in ctx.messages:
            self.state["messages"].append({"id": message["id"]})
        ctx.applied()
        return RunManager.Complete()

    @command("run/send")
    async def run_send(self, params, *, ctx, auth_result):
        return await self.run.send(
            params,
            applied=ctx.applied,
            auth_result=auth_result,
            version=ctx.version,
        )

Prioritize

run/send takes behavior: "steer" folds the message into the live run, "preempt" stops the live run and runs the message next, "queue" runs it after the live run. The default "auto" asks prioritize while a run is live (no prioritizer, a failure, or an invalid answer steers) and queues otherwise.

from harness_sdk.prioritize import jev_prioritizer, llm_prioritizer

@run_manager(prioritize=jev_prioritizer(min_confidence=0.6))
async def run(self, ctx: RunManager.RunContext): ...

@run_manager(prioritize=llm_prioritizer(ChatOpenAI(model="gpt-5-mini"), queue=True))
async def run(self, ctx: RunManager.RunContext): ...
  • prioritize(req: RunManager.PrioritizeRequest) -> "steer" | "preempt" | "queue", sync or async; req carries message, run (run_id, status, messages, steer_queue), and queue.
  • Built-ins choose between steer and preempt; queue=True adds queue. A timeout steers; jev_prioritizer also steers below min_confidence.
  • Clients on harness-sdk protocols before 2026-11-04 keep run/enqueue (behavior "queue") and run/steer (behavior "steer").

Docs

Metadata

Release files for harness-sdk-python 0.40.4

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

Source distribution (sdist)

Source distribution for harness-sdk-python 0.40.4
File Size Uploaded Provenance Actions
harness_sdk_python-0.40.4.tar.gz 157.7 kB With provenance Details for harness_sdk_python-0.40.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for harness-sdk-python 0.40.4
File Interpreter ABI Platform Actions
harness_sdk_python-0.40.4-py3-none-any.whl Python 3 none any Details for harness_sdk_python-0.40.4-py3-none-any.whl

Total release size: 232.2 kB

Release files / harness_sdk_python-0.40.4.tar.gz

Download URL harness_sdk_python-0.40.4.tar.gz
Size 157.7 kB
Tags Source
SHA-256 checksum
How to use checksums
e369aaa82370a918f0e1635681309a033449b629492dbdb9d5fb8c8d1ef7ac6f
BLAKE2b-256 checksum
How to use checksums
01ee5deac15221b3c3051bb4b0db4338184da7bc9b415dd70415684c93cd6592
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / harness_sdk_python-0.40.4-py3-none-any.whl

Download URL harness_sdk_python-0.40.4-py3-none-any.whl
Size 74.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3ba85386019f66d277664ec93d60720b41f8a512b1b7948ed4f2cd1c1fb9c6e6
BLAKE2b-256 checksum
How to use checksums
5e48bf7a6f94c2f309d01a823a03e1a00e01c42a7482cc88311fc917c1b1bab3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Security for harness-sdk-python 0.40.4

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for harness_sdk_python-0.40.4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

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.40.4 This release

2 release files Full 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