Automated Security Scanning with Snyk MCP and Gobi
Set up an AI-powered security workflow that automatically scans your code, dependencies, infrastructure, and containers using natural language commands.
What You'll Build
An automated security scanning system that uses Gobi’s AI agent with Snyk
MCP to identify vulnerabilities in code, dependencies, infrastructure, and
containers - all through simple natural language prompts
Skip the manual setup and use our pre-built Snyk Continuous AI agent that includes
the Snyk MCP and optimized security scanning workflows for more consistent results.
After ensuring you meet the Prerequisites above, you have two paths to get started:
⚡ Quick Start (Recommended)
🛠️ Manual Setup
1
Load the Pre-Built Agent
Navigate to your project directory and run:
Copy
cn --config gourmand/snyk-continuous-ai
This agent includes:
Snyk MCP pre-configured and ready to use
Security-focused rules for best practices
2
Run Your First Security Scan
From your project directory, start with a comprehensive security scan:
Copy
# Headless modecn -p "Run a complete security scan on this project including code vulnerabilities, dependencies, and any IaC files. Summarize findings by severity." --auto
That’s it! The agent handles everything automatically.
Why Use the Agent? The pre-built agent provides consistent security scanning workflows and handles MCP configuration automatically, making it easier to get started with AI-powered security scanning.
Agent Requirements
To use the pre-built agent, you need either:
Gobi CLI Pro Plan with the models add-on, OR
Your own API keys added to Gobi Hub secrets (same as manual setup)
The agent will automatically detect and use your configuration along with the pre-configured Snyk MCP for security scanning operations.
Now you can use natural language prompts to run comprehensive security scans. The Gobi agent automatically calls the appropriate Snyk MCP tools.
You can add prompts to your agent’s configuration for easy access in future sessions. Go to your agent in the Gobi Hub, click Edit, and add prompts under the Prompts section.
Where to run these workflows:
IDE Extensions: Use Gobi in VS Code, JetBrains, or other supported IDEs
Terminal (TUI mode): Run cn to enter interactive mode, then type your prompts
CLI (headless mode): Use cn -p "your prompt" --auto for headless commands
Test in Plan Mode First: Before running security scans that might make
changes, test your prompts in plan mode (see the Plan Mode
Guide; press Shift+Tab to switch modes in TUI/IDE). This
shows you what the agent will do without executing it. For example: "Run a Snyk Code scan and fix the top 3 issues"
Scan your source code for security vulnerabilities and code quality issues.TUI Mode Prompt:
Copy
Run a Snyk Code scan on this repo with severity threshold medium.Summarize issues with file:line. Propose minimal diffs for the top 3and rerun to verify.
Headless Mode Prompt:
Copy
cn -p "Run a Snyk Code scan on this repo with severity threshold medium. Summarize issues with file:line. Propose minimal diffs for the top 3 and rerun to verify." --auto
Check open source dependencies for known vulnerabilities.TUI Mode Prompt:
Copy
Run Snyk Open Source on this repo (include dev deps).Summarize vulnerable paths and propose a minimal-risk upgrade plan.Re-test after the plan (dry run).
Headless Mode Prompt:
Copy
cn -p "Run Snyk Open Source on this repo (include dev deps). Summarize vulnerable paths and propose a minimal-risk upgrade plan. Re-test after the plan (dry run)." --auto
Analyze Docker images for vulnerabilities in base images and packages.TUI Mode Prompt:
Copy
Scan image my-api:latest. Exclude base image vulns.Print dependency tree. Recommend a safer base image or upgrades.Re-test after the change (dry run).
Headless Mode Prompt:
Copy
cn -p "Scan image my-api:latest. Exclude base image vulns. Print dependency tree. Recommend a safer base image or upgrades. Re-test after the change (dry run)." --auto
This example demonstrates a Continuous AI workflow where security scanning runs automatically on pull requests, generates AI-powered mitigation suggestions, and posts them as PR comments.
About the —auto flag: The --auto flag enables tools to run continuously without manual confirmation. This is essential for headless mode where the agent needs to execute multiple tools automatically to complete tasks like security scanning, vulnerability analysis, and fix validation.
"Check Snyk auth status and current org. If not authenticated,help me authenticate. Then run a quick Code scan on ./with severity medium and print one example issue."
Verification Steps: - Snyk MCP is installed via Gobi
Hub - Secure-at-Inception rules are
enabled - Authentication
completed successfully - Project folder has been trusted
Your security workflow now operates at Level 2 Continuous
AI -
AI handles routine security scanning and remediation with human oversight
through review and approval of fixes.