For AI agents & their operators

Chainsaw speaks MCP. Pick the mode before you pick the key.

Mode A sets up the proxy; Mode B manages policy. On Claude Code, a plugin also checks every package the agent installs before it runs. The CLI, decision engine and plugin are open source at github.com/chain305/chainsaw-core.

Step 1 · Route the user

Which Chainsaw mode does the user need?

Chainsaw's MCP server has two modes. Mode A sets up the proxy, so the user's npm, pip or docker installs route through Chainsaw; Mode B manages policy. Match the user to a mode from what they say, using the table below. If you can't tell which mode they need, ask.

PersonaThey'll sayRoute to
End-user developer end_user_dev “set up chainsaw for python” Mode A · client-setup, onboard with skip=true
AppSec appsec “draft a CVSS policy” Mode B · manage-propose
DevSecOps / Platform devsecops “add proxy to GitHub Actions” Mode A · client-setup
Enterprise IT enterprise_it “export SBOM” Mode B · manage-readonly

Pass skip=true to chainsaw_onboard to silence the persona nudge.

Step 2 · Pick the mode

What can an agent do in each mode?

ModePresetScopesToolsKey
Mode AConfigure my project to install through Chainsaw client-setup repos:read list_my_repositoriesget_install_snippetsetup_doctor Mint a client-setup key
Mode BManage Chainsaw: policies, audit, SBOMs manage-readonly / manage-propose policies:readpolicies:manage*audit:readpackages:read list_policiespropose_policyget_audit_logcheck_vulnerabilitiesget_package_info Mint a manage-readonly key

In Mode A the human mints the client_credential, and the agent edits config files and never holds it.

Step 3 · Connect

How does an agent connect to Chainsaw over MCP?

An agent connects in three steps, then uses the streamable HTTP config below with a bearer token.

  1. 01 · Discover

    /.well-known/mcp.json
  2. 02 · Authenticate

    POST /api/auth/cli/device

    Device code. Never POST /api/login.

  3. 03 · First call

    chainsaw_introduce

    Its response is the source of truth, not this page.

{
  "mcpServers": {
    "chainsaw": {
      "type": "streamable-http",
      "url": "https://chain305.com/chainproxy/mcp",
      "headers": { "Authorization": "Bearer <TOKEN>" }
    }
  }
}

On the developer's machine

How do I check what Claude Code installs?

The chainsaw-guard plugin runs Chainsaw's install guard on every Bash command Claude Code is about to run. A known-malicious or typosquatted package is refused before anything is fetched, and the agent is told why. No account needed.

curl -fsSL https://chain305.com/install.sh | sh
claude plugin marketplace add Chain305/chainsaw-core
claude plugin install chainsaw-guard@chainsaw
The command…The agent gets
installs a package the guard refusesA deny with the reason. The command does not run.
names a package only known at run time (npm i "$PKG")Claude Code asks you to approve it.
installs nothing the guard refusesNothing. The hook never approves a command, so your permission settings still decide.

Covers npm, pip, Go, Cargo, RubyGems, Homebrew, yarn, pnpm, uv, Poetry and pipx, plus npx, npm create, pnpm dlx, bunx, uvx and pipx run. It reads command text, so an install inside a script file is not checked; the proxy checks those. Setup guide →

Security model

What stops an agent over-reaching?

Every policy edit an agent proposes goes to Billy, where a person approves it by default.

  1. 01 · Proposed

    A human or an AI agent

    Dashboard, or MCP with the manage-propose key

  2. 02 · Billy queue

    • the diff
    • blast radius, last 7 days
    • routed to the rule's owner
  3. 03 · Owner signs off

    Inside the SLA

    Unacknowledged requests escalate

  4. 04 · Enforced

    Live on the proxy

    Every transition writes a signed audit row

Self-approval refused. An agent's proposal goes through the same queue as a human's, under the same RBAC.

Install-time hookClaude Code's installs are checked before Bash runs them. A refusal tells the agent not to retry another way.
Least-privilege presetsclient-setup can't read audit data or touch policy. manage-readonly can't mutate.
Per-agent tokensEach agent gets its own revocable token, attributed in the audit log.
Drift checkchainsaw doctor verify-hook catches client-side bypasses.

Questions

What is the Chainsaw MCP server?

The Chainsaw MCP server is a remote MCP server at https://chain305.com/chainproxy/mcp, reached over streamable HTTP, that lets coding agents such as Claude Code, Cursor and Windsurf work with Chainsaw, the supply chain firewall from Chain305. Agents discover the server at /.well-known/mcp.json, sign in with the device-code flow and send a bearer API key on each call. The server has two modes. Mode A configures a project to install through the proxy, with the tools list_my_repositories, get_install_snippet and setup_doctor. Mode B manages policy, audit and SBOMs, with tools such as list_policies, propose_policy, get_audit_log, check_vulnerabilities and get_package_info. Each agent gets its own revocable token, attributed in the audit log. The first call is always chainsaw_introduce, whose response is the source of truth for modes and key presets. The CLI and decision engine behind the server are open source under Apache-2.0 at github.com/chain305/chainsaw-core.

What is the difference between a client_credential and an API key?

A Chainsaw client_credential and a Chainsaw API key are two different secrets with two different owners. The client_credential is a username-and-password style secret, pasted by a person into .npmrc, pip.conf, ~/.m2/settings.xml or ~/.docker/config.json, so the package manager installs through the proxy. The human mints the client_credential in the dashboard and keeps it; agents never hold one, and Mode A never asks for one. The API key is the bearer token an agent uses for MCP and the management API. An API key is minted in the dashboard or through the device-code flow, scoped to one preset (client-setup, manage-readonly or manage-propose), issued per agent and revocable on its own, with activity attributed to the key in the audit log. In practice, an agent mixing up the two asks the user for the wrong secret at the wrong moment, so name the secret needed before asking.

How does Chainsaw stop slopsquatting by AI coding agents?

Chainsaw stops slopsquatting at two points: the agent's machine and the install path. Slopsquatting works because a coding agent installs the name it suggested without a person reading the command. On the machine, the chainsaw-guard Claude Code plugin reads each Bash command before it runs, including npx and npm create, and refuses a known-malicious or typosquatted name, handing the agent the reason instead. It needs no account, but it has no new-release hold, so a newly registered name that resembles no known attack gets past it. The proxy catches that one. In Mode A, the agent uses the client-setup preset to write the proxy configuration into the project, and the human keeps the client_credential. From then on, every install is checked against the org's policy. First, a default hold refuses versions published in the last 48 hours. Typosquat matching then applies edit-distance, homoglyph and word-reorder matchers. Finally, a known-malicious feed refuses reported packages by name. An agent holding a manage-readonly key can also look a package up with get_package_info before installing it. Policy changes an agent proposes in Mode B go to Billy for a person to approve by default.

What does the Chainsaw Claude Code plugin do?

The chainsaw-guard plugin is a Claude Code PreToolUse hook that runs Chainsaw's open-source install guard on every Bash command the agent is about to run. It splits the command the way a shell would, finds each package install, including npx, npm create, uvx and installs inside bash -c, and checks it against the same known-malicious and typosquat rules as Chainsaw's shell guard. A refused install comes back to the agent as a deny with the reason, so nothing is fetched. A package name only known at run time makes Claude Code ask the user, and the hook never approves a command on the user's behalf. The checks run on the developer's machine with no account; signed in, npm and Homebrew installs also get the Chainsaw server's verdict. It reads command text, so an install inside a script file is not checked, and it is a second check beside the Chainsaw proxy, not a replacement for it. The plugin is installed with claude plugin marketplace add Chain305/chainsaw-core and claude plugin install chainsaw-guard@chainsaw, and needs the chainsaw CLI v0.22.170 or later.

Building against Chainsaw?

Start with the MCP discovery files

Fetch /llms.txt and /.well-known/mcp.json first. Everything else chains off those.