Skip to main content
The Mezmo Governance plugins bring Agent Governance policies to coding agents and agent SDKs that don’t run on AURA. Before the agent runs a tool, such as a shell command or an MCP tool call, the plugin asks Mezmo whether the call can proceed. Mezmo decides with the same policies, approvals, and workflows that govern AURA agents. This page explains how to set up a coding agent in Mezmo, install its plugin, and check that the agent is governed. The plugins are open source in the mezmo/agent-plugins repository on GitHub. The repository is the source of truth for each plugin’s install steps, settings, and limits.

Supported Agents and SDKs

The plugins support these coding agents:
  • Claude Code
  • Codex CLI
  • Cursor
  • Gemini CLI
  • Antigravity CLI
  • GitHub Copilot
  • Goose
  • Droid
  • Windsurf
  • Pi
  • OpenCode
For agents you build yourself, the repository also has integrations for the Claude Agent SDK, LangChain, the OpenAI Agents SDK, and Mastra. You add these to your application code.

How the Plugins Work

Before each tool call the plugin governs, it sends the call to Mezmo’s authorize endpoint and waits for a decision:
  • If Mezmo allows the call, the tool runs.
  • If Mezmo denies the call, the tool doesn’t run, and the agent shows the reason from the policy rule.
  • If the policy requires approval, the plugin waits for an approver. If nobody decides within the plugin’s timeout, the plugin denies the call. The timeout is 590 seconds, which is also the most it can be. To wait less, set MEZMO_GOVERNANCE_TIMEOUT_SECONDS. Mezmo keeps the request pending for its full 15-minute approval window, so it can still be approved after the plugin has given up. Approving it then doesn’t run the call.
  • If Mezmo can’t be reached or returns a response the plugin can’t read, the plugin denies the call.
Mezmo identifies the agent from the service account token the plugin sends, and records each request as a workflow. The plugins also write a line for each call to a local audit log, ~/.mezmo/governance-audit.jsonl by default. To change the path, set MEZMO_GOVERNANCE_AUDIT_LOG.
In these cases, tool calls run without asking Mezmo:
  • The Claude Code and Codex plugins have no token. Set MEZMO_GOVERNANCE_REQUIRED=1 to deny every call instead.
  • Codex hasn’t trusted the hooks in /hooks. Codex skips untrusted hooks without a warning, and you trust them again after each plugin update.
  • The agent’s own hook timeout ends before the plugin decides. This applies to Codex, Gemini CLI, GitHub Copilot, and Droid. Keep the agent’s hook timeout above the plugin’s.
  • The OpenCode plugin fails to load.
The repository’s Install by hand table lists the cases for each agent.
Each plugin sends Mezmo the tool name and its full arguments, such as the shell command, the file path, and the file content for write tools. Write policies on the assumption that Mezmo sees every argument, and keep secrets out of tool arguments. The Claude Code and Codex plugins also send each tool call to the Mezmo ledger, which is on by default once the plugin has a token. For Bash and MCP calls, the ledger record includes the arguments and the tool’s result or error, each cut at 4,096 characters. To turn this off, set the Claude Code plugin’s ledger_enabled option to false, or run ./mezmo-governance setup codex --no-ledger for Codex. Other plugins keep tool results on your machine. The repository’s What leaves your machine section lists what each plugin sends.
Coverage differs by agent. For example, the Claude Code plugin governs only Bash and MCP tool calls, and other built-in tools such as Read and Write run without a check. What each plugin governs, and whether it blocks the tool when the plugin itself fails, is listed in the repository’s Install by hand table.

Write Rules for Claude Code Bash Commands

The Claude Code plugin splits a Bash command into its parts, such as cd /repo and git push origin main in cd /repo && git push origin main, and sends each part as its own tool call. The strictest outcome among the parts wins, so an allowed cd can’t carry a git push through. Each part has these arguments for rules to match: Each spelling of a flag is a separate argument. For example, --force gives flag_force and -f gives flag_f, so a rule for force pushes needs one rule per spelling. A part the plugin can’t fully read, such as one with a variable or a redirect, has no program, arg_, or flag_ arguments. Write allow rules on program with is (eq) or is one of (in), because is not (neq) and is not one of (nin) also match a part with no program. For every case, see Bash commands in the Claude Code README.

Set Up a Coding Agent in Mezmo

Register each coding agent in Mezmo before you install its plugin, so Mezmo can recognize its tool calls. Before you begin, create a policy for the agent. In policy rules, the tool namespace is the plugin’s namespace, such as claude_code, codex, or cursor, or the MCP server name for an MCP tool. Each plugin’s README in the repository lists its tool names.
  1. Register an agent for each coding tool on each machine, so that each one has its own policy and workflow history. For Instance ID, enter a value that is unique per machine, such as claude-code-my-laptop.
  2. On the Service Account step, create a service account for this agent only.
  3. Copy the new access key and store it securely. This key is the plugin’s service account token, and Mezmo shows it only once.
  4. On the Policy step, assign the agent’s policy.
  5. On the Finished step, copy the url value in the [hitl.route] table of the config.toml section. This URL ends in /governance/workflow/authorize, and the plugin uses it as MEZMO_GOVERNANCE_URL. The rest of the config.toml section applies only to AURA.
A governed agent can read its own token. If the service account can change policies or agents, the agent could change its own rules. Give the service account Agent Governance permissions only, without policy Write or agent Write. See Permissions.

Install a Plugin

The repository’s mezmo-governance command installs a plugin into an agent’s user configuration, so it governs every session of that agent on the machine. Before you begin:
  • Use macOS or Linux. Windows isn’t tested.
  • Install Python 3.9 or later. Pi and OpenCode also need Node 22.18 or later.
  • Install the coding agent you want to govern, so its command is on your PATH.
To install a plugin:
  1. Clone the repository, and change to its folder:
  2. In the shell that starts the agent, export the URL and token from Set Up a Coding Agent in Mezmo. OpenCode 2.x ignores these variables, because it runs tools in a background service. For OpenCode 2.x, the install names the plugin in opencode.json with the URL and a file that holds the token. See the repository’s OpenCode README.
  3. Preview the changes the install makes. Replace claude-code with the name of your agent:
  4. Install the plugin:
Keep the cloned folder where it is. Pi loads the plugin from that folder, and Claude Code uses it as the plugin’s marketplace. To see the agent names that install accepts, run ./mezmo-governance agents. To install every supported agent on your PATH, use --all in place of the agent name. Some agents need an extra step after the install. For example, Codex runs the hooks only after you trust them in /hooks, and Claude Code can store the token with /mezmo:setup governance, in the macOS Keychain or, on Linux, in ~/.claude/.credentials.json, readable only by you. See the repository’s README for each agent’s steps, and for the SDK integrations.

Check the Setup

  1. In the shell with the exported URL and token, check the settings, the connection to Mezmo, and each installed plugin:
    Each check prints ok, warn, FAIL, or skip, with a fix for a failed check. The --probe option sends Mezmo one test call for the tool doctor:probe, which confirms that Mezmo finds the agent and its policy. An allowed or denied probe prints ok. If the policy holds the probe for approval, the check prints warn; to avoid that, add a rule to the agent’s policy that allows tool probe in namespace doctor.
  2. Send each installed plugin a test shell call and read call through a local mock server:
  3. In the agent, run a tool call that your policy denies. The agent shows the reason from the policy rule, and the request appears on the Workflows page.
To remove a plugin, run ./mezmo-governance uninstall <agent> --dry-run to preview the change, then run the same command without --dry-run.