Connect Cyfendo to OpenAI Codex

Two commands add Cyfendo to Codex.

Setup · about 2 minutes

Set it up

  1. Run the commands below in a terminal. They add Cyfendo to ~/.codex/config.toml.

    Terminal
    codex mcp add cyfendo --url https://mcp.cyfendo.com/mcp
    codex mcp login cyfendo
  2. codex mcp login opens your browser: sign in to Cyfendo and click Allow.

  3. So that Cyfendo's checks run without stopping for approval, open ~/.codex/config.toml and add default_tools_approval_mode = "approve" under [mcp_servers.cyfendo].

  4. Add the instruction below to AGENTS.md at the root of your project (the clicks are listed with the instruction). On the first check, Cyfendo gives the project its own ID and the agent saves it in cyfendo.json: commit that file with your code.

    Get the instruction
  5. Start a new Codex session so it picks up the instruction.

New to Cyfendo? Choose Continue with Google to create a free account in the same step. If you sign up with email instead, confirm your email first, then start the connection again from your app.

Recommended

Teach your agent when to check

Paste this into AGENTS.md so OpenAI Codex calls Cyfendo on its own after risky changes and tells you when results are ready.

How to add it in Codex

  1. Click Copy on the instruction below.
  2. Open your project folder in your code editor. If there's an AGENTS.md at the top level (next to README.md or package.json), open it and go to step 4.
  3. Otherwise, create a new file named AGENTS.md at the top level. In VS Code or Cursor: right-click an empty area below the file list, choose New File…, type AGENTS.md and press Enter.
  4. Paste the instruction at the end of the file and save (⌘S on Mac, Ctrl+S on Windows and Linux).

Prefer not to edit files? Send Codex the message “Add this to AGENTS.md at the root of the project, word for word:” followed by the instruction.

To use it in every project instead, paste it into ~/.codex/AGENTS.md (create the file if it doesn't exist).

AGENTS.md
## Security checks (Cyfendo)
Cyfendo identifies this project by the project_id in cyfendo.json at the project root. Pass it in every Cyfendo call. If the file doesn't exist, the first check or scan creates the project: save the project_id it returns to cyfendo.json and keep the file with the code.
- At the start of each of my requests, call cyfendo_status and tell me about any earlier_results before doing anything else.
- When you finish a task that changed login, sessions, permissions, database access, payments, file uploads, API routes or secrets, call cyfendo_check_changes once with all the files the task changed (list deleted files under deleted) and a short label. Don't wait for the result.
- For a confirmed issue that is still current, fix it as its fix_steps describe, or call cyfendo_generate_fix and then cyfendo_get_fix for Cyfendo's tested patch and show me the diff before applying it. Then call cyfendo_verify_fix.
- When I say I'm getting ready to release, call cyfendo_scan_project with this repository as a git source if it is pushed to GitHub, GitLab or Bitbucket; otherwise upload the source files in parts. Tell me when it has finished.

Check it works

Try it

Send one of these to OpenAI Codex's agent.

  • Check that it's connectedUse Cyfendo to show my security status.
  • Check a changeCheck the files you just changed with Cyfendo.
  • Collect finished resultsCollect any Cyfendo results that are ready.
  • Before you publishI'm getting ready to publish. Run a full Cyfendo security scan.

Before you launch

Security questions

Is the code Codex writes secure?

Usually it works, and working code can still be exploitable: an endpoint that skips an ownership check, a query built from user input, a file path taken straight from a request. These bugs look normal in review, which is why they ship.

Doesn't Codex already review its code?

Codex can review your pull requests. A review reads the code and judges whether it looks risky. Cyfendo tries a safe attack against your app's code in an isolated sandbox and reports only issues the attack proves, each with fix steps. Your agent fixes real problems instead of arguing with false alarms.

When does Codex call Cyfendo?

With the instruction in AGENTS.md: once at the end of each task that touched login, permissions, data access, payments, uploads, API routes or secrets, and a full scan when you say you're getting ready to release. Changes to styles, text and tests are skipped.

Good to know

  • Commit cyfendo.json with your code: every clone of the repository, and every coding agent working on it, then shares the project's Cyfendo results. If you copy the code into a separate project, delete cyfendo.json in the copy so it gets its own ID.
  • Full scans: when the project is pushed to GitHub, GitLab or Bitbucket, connect that repository in Cyfendo (Settings → Integrations → Git) and Cyfendo reads it directly, whatever its size. Public repositories need no setup. Otherwise the agent uploads the source files in parts of up to 50 files.
  • The same server in config.toml: [mcp_servers.cyfendo] with url = "https://mcp.cyfendo.com/mcp". To use an API key instead of signing in, add bearer_token_env_var = "CYFENDO_API_KEY" and set that variable.
  • The Codex CLI, the Codex IDE extension and the ChatGPT desktop app share this configuration.

Troubleshooting

The sign-in window doesn't open

Your browser blocked the popup. Allow popups for your app builder's site, then click the authorize or connect button again.

I can't find my personal workspace

On a business account, your own workspace is your business workspace, so it carries your organization's name. Pick the one marked "your workspace".

The connection test fails

Check the server URL is exactly https://mcp.cyfendo.com/mcp (with /mcp at the end) and, if your app asks, that the transport is HTTP (Streamable HTTP), not SSE.

A check stays "running"

Proving an attack takes several minutes, so checks run in the background. Your agent can only report a result when you send it a message: Cyfendo notifies you when a check finishes, then send your agent "Collect any Cyfendo results that are ready." A check stops testing after about 15 minutes and reports what it has.

Last updated · View as Markdown