Skip to main content

gvn

Agent harnesses built from state machines that are verified before they run.

gvn ("governor") is a Python framework for building agent harnesses: the code around a language model that decides when to call the model, which tools it may use, when a person must approve, and what happens when something fails.

Every agent and workflow is an actor that follows a state machine, and gvn checks that machine before it runs. Every non-final state needs a route or a fallback for every declared input. gvn refuses to build a machine with a gap, and names the gap.

pip install gvn

gvn needs Python 3.12 or newer and has no runtime dependencies. Model vendors, PostgreSQL and OpenTelemetry come as extras, for example pip install "gvn[anthropic]".

A first agent

This runs offline, with a scripted stand-in for the model and one tool.

import asyncio

from gvn.harness.messages import Message, ToolCall
from gvn.harness.ports import Reply
from gvn.kernel.schema import Record, Text
from gvn.shortcuts import FunctionTool, run_agent
from gvn.testing.fakes import ScriptedModel


def order_status(order_id: str) -> dict[str, str]:
    return {"order_id": order_id, "status": "shipped"}


tool = FunctionTool(
    name="order_status",
    description="Look up an order's shipping status.",
    arguments=Record({"order_id": Text()}),
    function=order_status,
)
model = ScriptedModel(script=[
    Reply(message=Message.assistant(calls=[
        ToolCall(call_id="lookup-1", name="order_status", arguments={"order_id": "A-17"}),
    ])),
    Reply(message=Message.assistant(text="Order A-17 has shipped.")),
])

run = asyncio.run(run_agent(
    instructions="Look up the order before answering.",
    prompt="Where is order A-17?",
    model=model,
    tools=[tool],
))
assert run.outcome().payload()["tools"][0]["content"]["status"] == "shipped"
print(run.outcome().payload()["text"])

What is in the package

Module What it holds
gvn.kernel State machines, the verifier, decisions, durable objects and schemas
gvn.harness The actors (agent, errand, approval, inquiry, choice, conversation, timer, workflow), tools and ports
gvn.runtime The Governor, recovery, replay, inspection, forks, leases, allowances and throttles
gvn.adapters Anthropic, OpenAI and Chat Completions models, SQLite and PostgreSQL journals, logs and traces
gvn.evals Cases, criteria, judges, reports and comparisons, and the gvn command line
gvn.testing Fakes for every port, so tests run offline

Documentation and source

License

Apache License 2.0

Metadata

Release files for gvn 0.2.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 gvn 0.2.0
File Size Uploaded Provenance Actions
gvn-0.2.0.tar.gz 1.3 MB With provenance Details for gvn-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gvn 0.2.0
File Interpreter ABI Platform Actions
gvn-0.2.0-py3-none-any.whl Python 3 none any Details for gvn-0.2.0-py3-none-any.whl

Total release size: 1.9 MB

Release files / gvn-0.2.0.tar.gz

Download URL gvn-0.2.0.tar.gz
Size 1.3 MB
Tags Source
SHA-256 checksum
How to use checksums
d3d5a876a81e4cd2a4bdb0f8bf2b78c015224fa276cf3b06de00f35faa571e57
BLAKE2b-256 checksum
How to use checksums
05fad1c9d3a6fbb9601e8759565f707c314f36a3d9417f3e2b1d10cb985e56cf
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 24, 2026.

Transparency log

Release files / gvn-0.2.0-py3-none-any.whl

Download URL gvn-0.2.0-py3-none-any.whl
Size 603.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
941ac05157c0539c1ec0534a04090402f7d629d2ab9a2a63ff7c4432534e76d6
BLAKE2b-256 checksum
How to use checksums
3b01132db34c3fff8cadbd3a08e7228d776cd07ab25a36d10402d7e69af4c459
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 24, 2026.

Transparency log

Security for gvn 0.2.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 gvn-0.2.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 24, 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.

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