Skip to main content

Runkite governance helper

A standard-library-only Python client for POST /governance/decide and GET /governance/actions/{id} on your self-hosted Runkite plane. It does not depend on the runner package or an agent framework.

This helper has its own distribution, separate from runkite-runner. The published Runkite 0.7.0 release did not include it. Use the registry command only for a version whose publication has been verified:

python -m pip install runkite-governance

For source that has not been published, install from a checkout:

python -m pip install ./python/runkite_governance

The runtime requires Python 3.11 or newer. Installing a managed runner does not install this decision-only helper.

from runkite_governance import GovernanceClient

governance = GovernanceClient("http://localhost:2026", api_key="server-side-key", timeout_ms=10_000)
decision = governance.decide(
    agent_id="notes-app",
    connector="workspace",
    tool="createNote",
    args={"title": "Release notes", "body": "A draft"},
    run_id="stable-app-turn-and-tool-call-id",
)

Your application executes after allow, refuses after deny, and persists the action ID and exact original arguments after pending. On a later application request, use governance.action(action_id) and execute only after approved. Rejected or consumed actions must not execute. Implement idempotency in the application's database: GET does not consume approval.

resolve(...) performs a bounded wait and returns an allow/deny outcome. Its deadline covers the initial decision and every poll. decide and action accept timeout_ms and a threading.Event as cancelled. Cancellation stops the caller promptly. Blocking standard-library I/O unwinds separately with a socket timeout and response-chunk checks; a bounded shared worker pool prevents unlimited abandoned resolver/socket threads. Do not hold a serverless request open for long operator approval.

Use a server-side key with governance:decide. Tenant identity comes from that key. The caller retains its model loop and tool execution. This path creates no Runkite thread or run and does not apply run kill switches, break-glass or spend caps. It is separate from the deliberately deferred full client SDK.

Optional Microsoft Agent Framework middleware

For a verified registry release, install the optional middleware with:

python -m pip install 'runkite-governance[agent-framework]'

For unpublished source, install the extra from a checkout:

python -m pip install './python/runkite_governance[agent-framework]'

The extra pins the tested framework core; model-provider packages remain application choices.

Import GovernanceFunctionMiddleware, GovernedFunction, GovernanceBlockedError and PendingInvocation from runkite_governance.agent_framework. Register exact local FunctionTool objects, server-owned policy identities and an application operation-ID callback. Install the guard last, after argument repair. It snapshots JSON arguments and Python defaults, decides once, and reaches native execution only after allow. Deny and pending stop the agent with a native MiddlewareFailure; an optional async on_pending callback persists the exact frozen proposal first.

The app owns pending continuation and execution idempotency. Rich Python types, coercing validators and provider-executed tools are outside this adapter's scope. See the framework example for a durable application transaction, offline streaming and non-streaming tests, and supported argument constraints. Execution retains native mutable containers; the app must not mutate invocation arguments after authorization. Importing the base client does not import the optional framework. This extra is not a runner adapter and creates no run.

License: Apache-2.0. See LICENSE and NOTICE. Third-party dependencies retain their own licenses.

Metadata

Release files for runkite-governance 0.8.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 runkite-governance 0.8.0
File Size Uploaded Provenance Actions
runkite_governance-0.8.0.tar.gz 15.3 kB With provenance Details for runkite_governance-0.8.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for runkite-governance 0.8.0
File Interpreter ABI Platform Actions
runkite_governance-0.8.0-py3-none-any.whl Python 3 none any Details for runkite_governance-0.8.0-py3-none-any.whl

Total release size: 30.6 kB

Release files / runkite_governance-0.8.0.tar.gz

Download URL runkite_governance-0.8.0.tar.gz
Size 15.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b8bfbbe10c1e010a0c40fc94c5d412e532ca89013c386e5d62184bc53e1e3310
BLAKE2b-256 checksum
How to use checksums
890350d74b3eec04600b170e7231a3ed3e368e8beb0ccd8bd471f2ff670d5983
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 15, 2026.

Transparency log

Release files / runkite_governance-0.8.0-py3-none-any.whl

Download URL runkite_governance-0.8.0-py3-none-any.whl
Size 15.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7cd1bd168b52e41525bfe2fca28bfeb4f85a350595b39f36da46236435fdd2a4
BLAKE2b-256 checksum
How to use checksums
e50569534b41495b33690a4e28831a46cd7093a3d017a289e2dfd3af125ac9ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 15, 2026.

Transparency log

Security for runkite-governance 0.8.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.

Full provenance

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

Select from 2 files

Attestation for runkite_governance-0.8.0.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 15, 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.8.0 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