gvn¶
gvn ("governor") is a Python framework for building agent harnesses. An agent is a program that puts a language model in a loop: ask the model what to do next, do it, report back, until the job is done. The harness is the code around the model that runs that loop: it decides when to call the model, which tools (functions of yours) it may use, when a person must approve, and what happens when something fails.
gvn builds complex workflows from verified parts. Each actor, such as an agent or a workflow, owns its state and follows a state machine. A parent workflow can host an actor and route its outcomes, while the actor keeps its internal states. gvn checks the machine for gaps and checks how the workflow's stages connect before it runs.
What makes it different¶
- Verify each machine and its composition. Every non-final state needs a route or fallback for every declared input. gvn refuses to build an incomplete machine and names the gap. A workflow plan also checks that its stages' outcomes have declared routes. Workflow plan checks.
- Encapsulate state. A child keeps its own transcript, retries, and internal stages. The parent coordinates it using an agreed starting input and result. Who owns what.
- Reuse tested actors. A workflow can host an agent, an approval, or another workflow. The repository's release-desk example replaces a build workflow while keeping the parent routing and the public build contract. Tested workflow replacement.
- Branch on declared outcomes. A Decision can classify a model reply into one of a finite set of symbols. The verifier checks that the machine has a route for every symbol. Decisions.
- A run survives a crash and can wait days for a person. Another process can replay its recorded history and resume pending work. A tool must deduplicate effects that might be reissued after a crash. Runtime guarantees, Durability, Forking a run.
- Set policy per tool call. The policy judges calls individually. The agent can park on one approval request that covers several calls, and a person can approve or deny them. An agent that asks first.
- Carry exposure and authenticated identity into decisions. An agent records which untrusted tool sources entered its transcript and shares that record with policy and approval requests. The journal records the answering principal when the application supplies one. Trust.
- Track model spending per run. An allowance sets a journal-based interruption threshold for tokens, model calls, or cost. The reference agent suspends when interrupted and can resume under a larger allowance. Spending and rate limits.
- Verify compensation paths. Declare which stages undo effects and which endings mean they were undone. gvn checks the routes to those endings. The application implements the undo operation itself. Compensation.
- Tests run offline in milliseconds. Every outside dependency has a stand-in, and a recorded run can be replayed against changed code. Testing.
gvn at a glance¶
One picture holds the whole design. An actor (an agent, a workflow, a conversation) is a checked state machine that only decides. The governor drives it, hands the work it asks for to fulfillers (the model, your tools, your policy), and records every event in the journal.
flowchart LR
you(["You, or your application"])
person(["A person who approves"])
subgraph run ["One run"]
direction TB
governor["<b>Governor</b><br/>drives the run"]
actor["<b>Actor</b><br/>a verified state machine"]
governor -- "event" --> actor
actor -- "request" --> governor
end
fulfillers["<b>Fulfillers</b><br/>model · tools · policy"]
journal[("<b>Journal</b><br/>every event, in order")]
you -- "event: started" --> governor
governor -- "request" --> fulfillers
fulfillers -- "event" --> governor
governor -- "records" --> journal
governor -- "asks" --> person
person -- "event: approved or denied" --> governor
The quickstart walks through this picture and then builds each part.
Find your way¶
- Install gvn with
pip install gvn. - Run the order lookup with one read-only tool and a scripted model.
- Take the quickstart to build a verified machine and run an agent on a real model.
| You want to | Go to | Time |
|---|---|---|
| Build a first checked machine | Quickstart | 10 minutes |
| Learn it step by step, one idea at a time | Tutorials | 10 to 20 minutes each |
| Understand the design behind the code | Concepts | read in order |
| Do a specific job: a real model, structured answers, running as a service | Guides | as needed |
| Measure how well a version of your harness does its job, and compare two versions | Evals | 10 minutes to start |
| See a harness drawn, step through its recorded runs, fork and answer them, and edit it, on a local page | The Workbench | 20 minutes to start |
| Give an agent files, a shell, git, the web, Jira Cloud, GitHub or any MCP server | Tools | as needed |
| Read complete harnesses for real kinds of work | Domains | as needed |
| Look something up: a term, an interface, how stored data is versioned | Glossary, Reference | as needed |
Is it for you?¶
gvn suits you if you want to keep a growing harness understandable by splitting it into actors with explicit contracts and verified control flow. Is gvn for you? explains how this approach fits alongside other ways of building agents.