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

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

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.2
File Size Uploaded Provenance Actions
harness_sdk_python-0.40.2.tar.gz 154.9 kB With provenance Details for harness_sdk_python-0.40.2.tar.gz

Built distribution (wheel)

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

Total release size: 228.5 kB

Release files / harness_sdk_python-0.40.2.tar.gz

Download URL harness_sdk_python-0.40.2.tar.gz
Size 154.9 kB
Tags Source
SHA-256 checksum
How to use checksums
a88edaeeee7568605c4122e3d2734671b9da1a369e8daba6c26e767281428177
BLAKE2b-256 checksum
How to use checksums
8375bc0b260b1533de671db7b0e85977a3f497bb07239d3f8f08d907211aa51a
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 9, 2026.

Transparency log

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

Download URL harness_sdk_python-0.40.2-py3-none-any.whl
Size 73.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c5c56c34ecc9636be84dbd740379c2363db08169a5043174ea79b3aef10f493e
BLAKE2b-256 checksum
How to use checksums
a65423038e8fd41e7d75066ae4b2c97c0e73eac52a8069bae22aecc5644ca0c5
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 9, 2026.

Transparency log

Security for harness-sdk-python 0.40.2

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.2.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 9, 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.2 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