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.11

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.11
File Size Uploaded Provenance Actions
harness_sdk_python-0.40.11.tar.gz 167.6 kB With provenance Details for harness_sdk_python-0.40.11.tar.gz

Built distribution (wheel)

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

Total release size: 244.3 kB

Release files / harness_sdk_python-0.40.11.tar.gz

Download URL harness_sdk_python-0.40.11.tar.gz
Size 167.6 kB
Tags Source
SHA-256 checksum
How to use checksums
15f1f87ef9fea436bb651556e73ae842ad2398823d345ba81e984c898ed26077
BLAKE2b-256 checksum
How to use checksums
c289718fa4681b0faae4659b9453c3f9a490a18ea73d7ffbcbdad619379d0586
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 20, 2026.

Transparency log

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

Download URL harness_sdk_python-0.40.11-py3-none-any.whl
Size 76.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f583b223bb63ebb51fe014ef1fbaab68691a3951d34f8021d0d2029a83f33dd0
BLAKE2b-256 checksum
How to use checksums
a0bec8cd57cbdb2cfe6d9aa5a30c759d415d359ccb842a660d9f43fa3340c0bc
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 20, 2026.

Transparency log

Security for harness-sdk-python 0.40.11

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.11.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 20, 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.11 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