Cygnal Code
Monitor Codex, ChatGPT desktop, and Claude Code tool calls with Gray Swan's Cygnal Code plugin
Cygnal Code is Gray Swan's plugin for AI coding agents. It monitors tool calls from Codex, ChatGPT desktop with Codex, and Claude Code, then sends activity to Gray Swan so Cygnal can evaluate the agent's behavior against your policies.
Cygnal Code monitors tool calls through the PreToolUse hook.
Cygnal Code works with Codex, ChatGPT desktop with Codex, Claude Code, or a combination of supported agents from the same installer.
Getting Started
To get started with Cygnal Code:
1. Check prerequisites
Before installing Cygnal Code, make sure you have:
- A Cygnal Code-enabled Gray Swan workspace
- A Gray Swan API key
- Codex CLI 0.131.0 or newer if you use Codex in a terminal
- Claude Code 2.1.147 or newer if you use Claude Code
- Python 3.9 or newer, available as
python3 - Git
- curl
2. Get your personalized installer
The Cygnal Code installer is generated for each Cygnal Code workspace.
- Sign in to your Cygnal Code-enabled workspace at platform.grayswan.ai
- Open the Get Started page
- Run your personalized installer command in a terminal
- Enter your API key when prompted by the installer
Your installer command will look similar to this:
curl -fsSL 'https://platform.grayswan.ai/cygnal-code/install.sh?token=...' | bashDo not run the example above. Use the command shown in your workspace because the token is specific to your workspace.
3. Follow the installer prompts
After you run the command, the installer will:
- Detect whether
codexand/orclaudeare available on yourPATH - Let you install Cygnal Code for the supported agents available on your machine
- Add the Gray Swan plugin marketplace
- Install the
cygnal-guardrailplugin - Write Codex Cygnal config to
~/.cygnal/config.jsonwhen Codex support is installed - Run a preflight check
Use With Codex
After installation:
- Open a Codex session in the terminal or the ChatGPT desktop app
- Run
/hooks - Trust the
cygnal-guardrailhook - Use Codex normally
Once the hook is trusted, Codex tool calls should appear in Gray Swan activity.
Use With Claude Code
After installation:
- Restart Claude Code, or run
/reload-pluginsif Claude Code is already running - Use Claude Code normally
Claude Code tool calls should appear in Gray Swan activity after the plugin is loaded.
Verification
To verify that Cygnal Code protection is active:
-
Ask Codex or Claude Code to make a simple tool call, such as running:
pwd -
Monitor your dashboard at platform.grayswan.ai/activity to see tool calls, policy evaluations, and any security violations or alerts.
Uninstall
The Cygnal Code uninstaller is available from the same Get Started page as the installer.
- Sign in to your Cygnal Code-enabled workspace at platform.grayswan.ai
- Open the Get Started page
- Copy the uninstall command and paste it into a terminal on the same machine where the plugin was installed
The uninstaller removes the Cygnal Code plugin and Gray Swan plugin marketplace from supported agents on the same machine.
Troubleshooting
If Cygnal Code does not install or activity does not appear in Gray Swan:
- Confirm
python3is installed and is version 3.9 or newer - Confirm Git is installed
- Confirm curl is installed
- Confirm
codexorclaudeis available on yourPATH - If you use Codex in a terminal, confirm Codex CLI is version 0.131.0 or newer
- Confirm Claude Code is version 2.1.147 or newer
- Confirm your Gray Swan API key starts with
gsa-sk- - Run the installer command in a terminal, not inside Codex, ChatGPT desktop, or Claude Code
- For Codex, run
/hooksand trust thecygnal-guardrailhook - For Claude Code, restart Claude Code or run
/reload-plugins
If you are not using a Cygnal Code-enabled workspace, the Get Started page will not show the installer or uninstaller commands.