Guardian and the Semgrep Malware Firewall protect different components of the development workflow.
- Guardian scans code generated by AI coding agents before it is committed.
- Semgrep Malware Firewall blocks malicious packages when developers install dependencies on their local machine.
/install-mfw in their coding agent to install the Malware Firewall, or follow the Malware Firewall installation guide.Before you deploy
Each developer still signs in to Semgrep individually after Guardian is installed. Read Authentication first. It covers the OAuth and CLI sign-in models, where credentials are stored, and why shared tokens and service accounts are discouraged for fleet deployments. Prefer OAuth, including when you deploy through an MDM platform. When developers can’t complete a browser sign-in, deploy Guardian with a read-only token. This requires Semgrep Enterprise. For more information, see Deploy with a read-only token.Prerequisites
- You have a Semgrep account and organization.
- You’re an admin for your coding agent’s enterprise controls and your MDM platform, if applicable.
- Claude Code and Codex are the recommended setups for organization-wide deployment.
Option 1: Use your agent’s built-in enterprise controls
Many coding agents let you pin an approved marketplace or plugin for your whole team. This is the simplest way to enable Guardian across your organization or make it required.- Claude Code
- Codex
- Cursor
1
Enable the plugin in your managed settings
Modify your Claude marketplace settings to include Semgrep in your enabled plugins list:
2
Confirm the plugin is connected
Run
claude mcp get plugin:semgrep:guardian and confirm it reports as connected.claude-plugins-official), so the payload only needs to enable the plugin. There’s no separate marketplace to declare. See Require marketplaces for your team for more information.Option 2: Deploy through a mobile device management (MDM) platform
Deploy through your MDM platform to scope the deployment by device group. The Jamf template configures Claude Code only; the Iru (Kandji) templates cover Claude Code and Codex. To deploy Guardian to Cursor, use Option 1.- Jamf
- Iru (Kandji)
Deploy a Custom Settings payload with preference domain
com.anthropic.claudecode through a Configuration Profile.1
Create the property list
Save the following as
com.anthropic.claudecode.plist.com.anthropic.claudecode.plist
com.anthropic.claudecode.plist
com.anthropic.claudecode.plist
2
Upload it as a Custom Settings payload
Follow Jamf’s guide, Deploying Custom Computer Configuration Profiles Using the Application and Custom Settings Payload, using the preference domain
com.anthropic.claudecode and the property list above as the uploaded file.3
Scope the profile
Scope the Configuration Profile to your target device group.
These templates enable the plugin only. To deploy a read-only token, set
SEMGREP_APP_TOKEN and SEMGREP_GUARDIAN_EMAIL. For the values, see Deploy with a read-only token.- Claude Code: add both variables to the same managed settings payload under the
envkey. See Claude Code settings. - Codex: set both as environment variables on each developer machine. Guardian passes them to the plugin.
Deployment recommendations
- Test the deployment on a single machine before pushing to the whole fleet.
- After deploying, confirm that Guardian loaded. In Claude Code, run
claude mcp get plugin:semgrep:guardianand confirm it reports as connected. In Codex, runcodex plugin list --jsonand confirm thesemgrepplugin is listed. - Each developer signs in to Semgrep after Guardian is installed. Deploy a read-only token when developers can’t complete a browser sign-in. See Authentication for how sign-in works, and the Quickstart for setup steps.
Deploy with a read-only token (Semgrep Enterprise only)
Prefer OAuth, including when you deploy through an MDM platform. Use a read-only API token when developers can’t complete a browser sign-in.1
Create a read-only token
Sign in to Semgrep and go to Settings > Tokens, then set the token scope to read-only. For more information, see Access tokens.
2
Confirm that the token is read-only
On a machine with the Semgrep CLI installed, run the following command and confirm that it fails:
SEMGREP_APP_TOKEN=READ_ONLY_TOKEN semgrep cisemgrep ci runs on your machine and sends findings to Semgrep AppSec Platform. A read-only token can’t send findings, so the command fails. If the command succeeds, return to the previous step and create a token with the read-only scope.3
Set the environment variables on each developer machine
Set these environment variables:
You deploy the same token to every machine. Set
SEMGREP_GUARDIAN_EMAIL on each machine.Many MDM platforms provide a payload variable for the assigned user’s email address, so you can deploy one profile to the fleet. See your MDM provider’s documentation for the variable name.