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
- Documentation: https://gvn-harness.dev
- Source, issues and the other gvn packages: https://github.com/humbertopoliti/gvn
- Changelog: https://github.com/humbertopoliti/gvn/blob/main/CHANGELOG.md
License
Metadata
Release files for gvn 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gvn-0.2.1.tar.gz | 1.3 MB | With provenance | Details for gvn-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gvn-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for gvn-0.2.1-py3-none-any.whl |
Total release size: 1.9 MB
Release files / gvn-0.2.1.tar.gz
| Download URL | gvn-0.2.1.tar.gz |
|---|---|
| Size | 1.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3d0ec93b5db91e534e24bd84f554c3242ba450b2f44ebcc128695da5f3e58a16
|
|
BLAKE2b-256 checksum How to use checksums |
6c43186879967b73a3c69f86c6d834f7a3d517636dc154c033f89b523ea520b4
|
| 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 logRelease files / gvn-0.2.1-py3-none-any.whl
| Download URL | gvn-0.2.1-py3-none-any.whl |
|---|---|
| Size | 603.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
28ef5d68c3ed516fb60a39110b7722c4ae72b11c93f17d7211437091bfcd7429
|
|
BLAKE2b-256 checksum How to use checksums |
967b7cb9a5b9ea5af5386d8ed5695aaa82095f948b46f1e60303d182590b7b0f
|
| 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 logSecurity for gvn 0.2.1
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.
Attestation for gvn-0.2.1.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 logA 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.