Both packages are in early access. Until they are on PyPI and npm, your Coverbase representative gives you the packages to install. The imports and calls on this page do not change when they are published.
coverbase-governor for Python and @coverbase/governor for TypeScript. They are thin layers over the governor’s runtime API. Use them when your agent is code you write. An MCP client (Claude Code, Claude Desktop, Cursor, VS Code) needs neither: it connects to the governor’s MCP endpoint directly.
The packages do three things you would otherwise build by hand:
- Held actions. When a policy holds an action for a person, the package waits for the decision and sends the identical request again with the approval. An Approve once approval covers only that exact call, so the retry must not change it.
- Identity and delegation. The package reads the agent key from the environment, or uses a workload identity token instead, carries a delegation so the agent acts on behalf of a person, and mints short-lived identity tokens for your own services.
- Typed results. An allowed action returns its result. A denial, a decline, an expired approval and a target error each raise a typed error whose message a model can relay to its user.
Set up
- In Inspect › Governor › Agents, select Register agent and copy the key. The Connect an agent panel shows it once.
- Set the key where the agent runs:
- Install the package.
httpx. The TypeScript package has no runtime dependencies and runs on Node 18 or later and on edge runtimes.
Run an action
sql, http, aws and code are shortcuts for the four request kinds. Sensitive values in a result arrive masked, as they do for every governed action.
Held actions
When a policy holds an action,run and its shortcuts:
- Tell you, through
on_hold(Python) oronHold(TypeScript), so you can tell the user a person must approve. - Poll the approval until a person decides.
- On approval, send the same request again with the approval id and return the result.
To return at once instead of waiting, pass
wait=False (Python) or wait: false (TypeScript), keep the approval id, and pass it back later to resume. act returns the raw decision without waiting or raising.
Governed tools
A governed tool turns an action into a tool a model can call. It never raises for a policy outcome: it returns the status (allowed, held, denied or failed) and a message, so the model sees why and can tell the user. With the return hold mode, a held tool returns at once, and calling it again with the same arguments resumes the same approval instead of opening a new one.governor_tools (Python) and governorTools (TypeScript) build one tool for every target the agent can reach, with the same names and arguments as the governor’s MCP tools. A target no baseline lets the agent reach is left out.
governedTool({ governor, name, description, target, parameters, build }) does the same.
Drop-in clients
To route existing code through the governor, change the line that opens the connection.Authorization and Cookie headers are dropped.