Connect Cyfendo to VS Code (Copilot)

One click to add Cyfendo to GitHub Copilot's agent mode.

Setup · about 2 minutes

Set it up

  1. When VS Code asks to sign in to Cyfendo, allow it. Your browser opens Cyfendo: sign in and click Allow.

  2. In Copilot Chat, switch to Agent mode.

  3. The first time the agent wants to run a Cyfendo tool, open the Allow dropdown and trust all of Cyfendo's tools (for this workspace, or always), so checks don't stop for approval. Change it later with Chat: Manage Tool Approval.

  4. Add the instruction below to .github/copilot-instructions.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

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 .github/copilot-instructions.md so VS Code (Copilot) calls Cyfendo on its own after risky changes and tells you when results are ready.

How to add it in VS Code

  1. Click Copy on the instruction below.
  2. In VS Code, open the Explorer (⇧⌘E on Mac, Ctrl+Shift+E on Windows and Linux). If .github/copilot-instructions.md already exists in your project, open it and go to step 4.
  3. Otherwise, right-click an empty area below the file list, choose New File…, type .github/copilot-instructions.md and press Enter. VS Code creates the .github folder too.
  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 Copilot the message “Add this to .github/copilot-instructions.md at the root of the project, word for word:” followed by the instruction.

.github/copilot-instructions.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 VS Code (Copilot)'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 GitHub Copilot 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 GitHub Copilot already review its code?

GitHub offers Copilot code review on pull requests and code scanning with CodeQL. 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 GitHub Copilot call Cyfendo?

With the instruction in .github/copilot-instructions.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.
  • To use an API key instead of signing in, add a headers entry with X-Cyfendo-Api-Key and keep the key in an input variable rather than in the file.
  • VS Code also reads AGENTS.md at the root of your repository, if you'd rather keep the instruction there.

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