Skip to main content
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.
For step-by-step setup with complete examples and screenshots, see the Python SDK and TypeScript SDK user guides.
An agent written as code reaches the Governor through two small packages: 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

  1. In Inspect › Governor › Agents, select Register agent and copy the key. The Connect an agent panel shows it once.
  2. Set the key where the agent runs:
  1. Install the package.
The Python package needs Python 3.10 or later and depends only on httpx. The TypeScript package has no runtime dependencies and runs on Node 18 or later and on edge runtimes.

Run an action

A target is named by its name or its id. The packages look names up once and cache them. 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:
  1. Tell you, through on_hold (Python) or onHold (TypeScript), so you can tell the user a person must approve.
  2. Poll the approval until a person decides.
  3. 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.
To govern a tool you already have, wrap the function that builds its action:
In TypeScript, 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.
The governor approves and audits the exact statement, so the database clients put each parameter into the statement as a quoted literal instead of sending it separately. Each statement is its own action, so there are no transactions across calls. The HTTP clients send only the path, query and body: the governor calls the target’s own address with its own credential, and your code’s Authorization and Cookie headers are dropped.

Act on behalf of a person

Pass a delegation id when the agent acts for a person who delegated to it. Rules that need a delegation then apply, and the person is recorded on every decision.
A one-time approval is tied to the delegation it was asked under, so an approval given for one person’s request does not run under another person’s delegation.

Identity tokens

An agent can get a short-lived signed token that names it, and the person it acts for, for a service that checks your organization’s published keys. See Agents as an identity provider.

Workload identity instead of a key

An agent in GitHub Actions, Kubernetes or another OIDC issuer can sign in with its workload token. Set up the agent’s federation rule in Inspect › Governor › Agents, then pass a function that returns a fresh token and the agent’s id.