Skip to main content

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

Prerequisites

Before starting, ensure you have: For all options, first:
1

Install Gobi CLI

2

Add Your Project to Snyk

  1. Sign up for a Snyk account at snyk.io
  2. Create a new project in Snyk by importing your code repository (Git provider or manual upload)
  3. Install and authenticate the Snyk CLI locally:
    This will open your browser to authenticate with your Snyk account.
Important: The Snyk MCP requires the Snyk CLI to be authenticated locally. Run snyk auth to authenticate before using the Gobi agent with Snyk MCP.
To use agents in headless mode, you need a Gobi API key.

Snyk Continuous AI Workflow Options

🚀 Fastest Path to Success

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:
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.

Security Scanning Recipes

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"

Code Vulnerability Scanning (SAST)

Static Application Security Testing

Scan your source code for security vulnerabilities and code quality issues.TUI Mode Prompt:
Headless Mode Prompt:

Dependency Scanning (SCA)

Software Composition Analysis

Check open source dependencies for known vulnerabilities.TUI Mode Prompt:
Headless Mode Prompt:

Infrastructure as Code (IaC)

IaC Security

Scan Terraform, CloudFormation, and Kubernetes configs for misconfigurations.TUI Mode Prompt:
Headless Mode Prompt:

Container Scanning

Container Security

Analyze Docker images for vulnerabilities in base images and packages.TUI Mode Prompt:
Headless Mode Prompt:

Pull Request Scanning

Changed Files Only

Focus scanning on modified files to catch issues before merging.TUI Mode Prompt:
Headless Mode Prompt:

Security Learning

Snyk Learn Integration

Access security education resources based on identified vulnerabilities (CWE).TUI Mode Prompt:
Headless Mode Prompt:

Continuous Security with GitHub Actions

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.

Add GitHub Secrets

Navigate to Repository Settings → Secrets and variables → Actions and add:

Create Workflow File

Create .github/workflows/snyk-security.yml in your repository:
About SNYK_TOKEN: The workflow uses the SNYK_TOKEN in two ways:
  1. Direct Snyk CLI authentication - Authenticates the Snyk CLI for running scans
  2. Gobi CLI access - Available as an environment variable when Gobi generates AI mitigation suggestions
The cn agent automatically uses the SNYK_TOKEN when needed for Snyk MCP operations.
This workflow demonstrates several advanced features:
  • Changed Files Detection: Only scans files modified in the PR
  • AI Mitigation: Uses Gobi CLI to generate actionable mitigation steps
  • PR Comments: Automatically posts mitigation suggestions as PR comments
  • Comprehensive Reporting: Generates detailed security reports with artifacts

Security Guardrails

Implement automated security policies using Gobi’s rule system. See the Rules deep dive for authoring tips.
Coming Soon: These security guardrail prompts will be available as pre-configured rules on the Gobi Hub for easy installation.

Pre-commit Scanning

Dependency Safety

Container Hardening

IaC Compliance

Enable the Secure-at-Inception rules from the Hub to automatically apply these guardrails to all code generation and modifications.

Troubleshooting

Authentication Issues

Fix Validation

Connection Problems

Verification Steps: - Snyk MCP is installed via Gobi Hub - Secure-at-Inception rules are enabled - Authentication completed successfully - Project folder has been trusted

What You’ve Built

After completing this guide, you have a complete AI-powered security system that:
  • ✅ Uses natural language — Simple prompts instead of complex CLI commands
  • ✅ Fixes automatically — AI suggests and validates security fixes
  • ✅ Runs continuously — Automated scanning in CI/CD pipelines
  • ✅ Enforces guardrails — Security rules prevent vulnerable code from shipping

Continuous AI

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.

Next Steps

  1. Run your first scan - Try the SAST prompt on your current project
  2. Review findings - Analyze the security report and implement fixes
  3. Set up CI pipeline - Add the GitHub Actions workflow to your repo
  4. Customize rules - Add project-specific security policies
  5. Monitor trends - Track vulnerability reduction over time

Additional Resources

Snyk Documentation

Complete Snyk platform documentation

Gobi Hub

Explore more MCP integrations and agents

Security Best Practices

Learn about secure coding practices

MCP Concepts

Understanding MCP architecture