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

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.3
File Size Uploaded Provenance Actions
harness_sdk_python-0.40.3.tar.gz 157.7 kB With provenance Details for harness_sdk_python-0.40.3.tar.gz

Built distribution (wheel)

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

Total release size: 232.2 kB

Release files / harness_sdk_python-0.40.3.tar.gz

Download URL harness_sdk_python-0.40.3.tar.gz
Size 157.7 kB
Tags Source
SHA-256 checksum
How to use checksums
2a68c66582d303eca531d5ddabfae0176b63846358209e1dc746ba3a8ee2b145
BLAKE2b-256 checksum
How to use checksums
f94a0e7aafcd4d8af1a0591c8ba68d7731dda1c8d9b89ecf7d8eb3246bcb9f7d
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 10, 2026.

Transparency log

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

Download URL harness_sdk_python-0.40.3-py3-none-any.whl
Size 74.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6bb338dcbe708bb9c8dc2d1faee9e8babd697daa1a2815caa7254eb766eed4ed
BLAKE2b-256 checksum
How to use checksums
e0a824a9ac54471d15b464a2bc4538f1a668bb0323704db01cddf304b90bfcd2
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 10, 2026.

Transparency log

Security for harness-sdk-python 0.40.3

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.3.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 10, 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.3 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