Skip to main content
Integrate Semgrep Guardian with Codex for scans of AI-generated code through hooks and plugins. Codex is a recommended Guardian setup. The plugin uses Semgrep’s hosted server and OAuth, so you don’t need to install the Semgrep CLI locally.

Prerequisites

  • A Semgrep account
  • Codex CLI installed (codex command)

Setup

1

Install the plugin

Add the Semgrep marketplace, then install the Guardian plugin from it:
2

Start a new Codex session

Start a new Codex session so the plugin loads:
3

Sign in to Semgrep

Ask Codex:
Complete the sign-in prompts in your browser.
4

Confirm you're signed in

Ask Codex:
Codex confirms your identity and Semgrep deployment.
To verify the installation from your terminal, run:
For Windows machines: Windows Subsystem for Linux (WSL) is required. Native Windows is unsupported.

What rules does this setup use?

The Codex plugin scans with the fixed guardian-default ruleset. Rules enabled in your organization’s Policies don’t apply. See Rules and configuration for more information.

Next steps