Connect OpenCode to AvowGate

Last updated: November 25, 2026

OpenCode will tell you a task is done. AvowGate keeps a checklist of what OpenCode committed to, links each item to a named test, and answers pass or blocked for the exact version of your code. This page shows how to connect OpenCode, what you can see about what it did, and the limits.

Before you start

You need an AvowGate account (access is by request while AvowGate is in private beta; ask on the home page). Create an agent token under Settings in the app. The agent token can read and write, and it can never sign off. Keep it in an environment variable, not in a file you commit.

Connect OpenCode

Add this to opencode.json. Keep the token in an environment variable named AVOWGATE_TOKEN:

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "avowgate": {
      "type": "remote",
      "url": "https://avowgate.com/api/v1/mcp",
      "headers": { "Authorization": "Bearer {env:AVOWGATE_TOKEN}" },
      "oauth": false
    }
  }
}

Restart OpenCode after changing its settings.

Make it follow the loop

The one-command setup (Set up my agent, in the app) also writes your workspace's agent rules into AGENTS.md in your project. The rules say how to work with AvowGate: start a task, write requirements and tests first, report real results, check the gate. The block is marked "managed by AvowGate" and everything else in the file is kept.

How a task goes

  1. at_task_start with a title and objective, then at_commitment for each thing OpenCode will make true.
  2. Make the change, then at_create_test and at_link_spec_test to register each test by its exact name and link it to its commitment.
  3. Run the tests and report them with at_report_results, including the commit.
  4. at_check_gate answers pass or blocked with reasons. at_task_close succeeds only when every commitment is settled and the gate passes.

See what OpenCode did

Agent Watch works with OpenCode through a plugin. Download it into your project; OpenCode loads every .js file in .opencode/plugins/ by itself:

mkdir -p .opencode/plugins && curl -H "Authorization: Bearer $AVOWGATE_TOKEN" https://avowgate.com/api/v1/watch/opencode-plugin -o .opencode/plugins/avowgate-watch.js

Set the same environment variables as for Claude Code in the shell that starts OpenCode, and keep them out of version control because they hold your token: AVOWGATE_WATCH_PRODUCT (your product id), AVOWGATE_BASE_URL (https://avowgate.com) and AVOWGATE_API_TOKEN (the agent token). Start OpenCode and its actions appear in the Watch tab.

The plugin reports shell commands, file writes, edits and patches, web fetches and searches, and calls to connected tools. Secrets are hidden on your computer before anything is sent. When a person has paused the agents or the product refuses red actions, the plugin stops the step and shows the agent the reason.

What the hook or plugin sends, where it goes and how to remove it are on the Agent Watch safety page.

Limits

Questions

How do I connect OpenCode to AvowGate?

Create an agent token under Settings in the app, keep it in an environment variable, and add AvowGate as an MCP server at https://avowgate.com/api/v1/mcp using the setup on this page. The token can read and write but can never sign off.

Can OpenCode sign off its own work in AvowGate?

No. OpenCode can add and strengthen requirements, report results and read everything. Only a person can sign off a risk, dismiss a finding, promote a rule or retire a test.

Does Agent Watch work with OpenCode?

Yes, through a plugin that you download into .opencode/plugins/. Reporting and pausing both worked in a live test on OpenCode 1.17.9.

Is AvowGate a sandbox for OpenCode?

No. AvowGate records what was asked and what was reported, and refuses to call a task done without proof. It cannot stop OpenCode from running a command.

More

Other agents: Claude Code, Cursor, Codex. The guide has all four side by side, and pricing lists the plans.