Skip to main content
Semgrep Guardian integrates natively with AI coding agents to catch security issues before they ship. It bundles the Semgrep MCP server, Hooks, and Skills into a single install, and scans every file an agent generates using Semgrep Code, Supply Chain, and Secrets. When findings are detected, the agent is prompted to regenerate code until Semgrep returns clean results or you choose to dismiss them. Claude Code is the recommended setup. Follow the Claude Code tab below to get started — no local Semgrep CLI required. Guardian also works with other AI coding agents. Pick your agent in the tabs below; each tab covers that product’s native hooks or MCP integration. The plugin also works with any MCP client.

Prerequisites

  • A Semgrep account
For organization-wide rollout, OAuth and credential details, and shared-token guidance, see Enterprise deployment.

Connect to your IDE

Start with the Claude Code tab. That path uses Semgrep’s hosted remote plugin and does not require a local Semgrep CLI install. Use the other tabs only if you are setting up a different agent.
Install the Guardian plugin from the Claude Marketplace:
Start a new Claude Code session (claude) to log in to Semgrep.This integration uses Claude Code hooks and plugins. By default, it uses Semgrep’s hosted remote server, so you don’t need to install the Semgrep CLI locally.
For Windows machines: Windows Subsystem for Linux (WSL) is required. Native Windows is unsupported.
The remote server is the recommended default. If you need to run Semgrep locally instead, you can install the local plugin from the semgrep/guardian-local repo.
2
Start a Claude Code instance:
3
Open the plugin manager:
4
Go to Discover. Search for Semgrep, and then click Install.
5
Load the plugin:

What rules does Semgrep Guardian scan with?

Guardian uses different rules depending on the environment in which you use it:
  • Claude Code remote server (default): scans with the default Guardian ruleset. This is not currently configurable. If you require custom rules, see Semgrep’s #mcp Slack community for assistance.
  • Claude Code local and all other IDE integrations: scans with the rules enabled for your Semgrep organization through your Policies.

Install the Semgrep CLI

This section is only for non-Claude Code setups (or the optional local Claude Code plugin). Claude Code with the remote plugin is the recommended path and does not require a local Semgrep CLI. Prefer the Claude Code tab above unless you specifically need a local CLI integration.
1
Install the Semgrep CLI using pipx, uv, or Homebrew. This requires Python 3.10 or later — the Semgrep CLI needs Python at runtime regardless of how you installed the CLI:
NOTEpipx and uv are the preferred installation methods. The Homebrew formula is maintained on a best-effort basis and often lags behind the latest release.Homebrew users: ensure that you’ve added Homebrew to your PATH.
2
Verify that you’ve installed the latest version of Semgrep:
3
Sign in to your Semgrep account and install the Semgrep Pro engine:
semgrep login launches a browser window. You can also use the activation link printed in the terminal.

Additional resources