Sign In
C

Container Security (Snyk)

@snyk
Visit Skill
Share:

Snyk's container-security skill: scan Docker images for OS and app vulnerabilities via the Snyk MCP server and fix Dockerfiles.

Security Reviewed

Instruction-only Snyk skill (3 Markdown files, no scripts); it needs a Snyk login, sends image scans to Snyk through npx snyk@latest, and may edit Dockerfiles and run docker builds.

Install Container Security (Snyk) in Google Antigravity

Antigravity loads skills from .agents/skills/ in your project or ~/.gemini/config/skills/ for all projects (official docs). Full guide

EasiestOption 1: paste this to your Antigravity agent
Install the "Container Security (Snyk)" skill for Google Antigravity.
Follow the steps at https://www.antigravityskills.org/install/container-security.md (source: https://github.com/snyk/studio-recipes/tree/main/command_directives/synchronous_remediation/skills/container-security).
Before running anything, show me what you will download and whether it includes scripts, and wait for my OK.
Install it into this project (.agents/skills/) unless I say global. When done, check that Antigravity lists it as an installed skill.

The agent reads the install file, shows you what it will download and waits for your OK.

Option 2: install it yourself
  1. 1. Download the repository
    git clone --depth 1 https://github.com/snyk/studio-recipes /tmp/studio-recipes && git -C /tmp/studio-recipes log -1 --format=%h

    We reviewed commit 691f03c. If the second command prints a different hash, the skill may have changed since our review.

  2. 2. Copy the skill into this project (workspace skill)
    mkdir -p .agents/skills && cp -r /tmp/studio-recipes/command_directives/synchronous_remediation/skills/container-security .agents/skills/

    Run from your project root. Antigravity reads workspace skills from .agents/skills/<folder>/; the folder holds SKILL.md and references/ (3 Markdown files, no scripts).

  3. 3. Or install it for all projects (global skill)
    mkdir -p ~/.gemini/config/skills && cp -r /tmp/studio-recipes/command_directives/synchronous_remediation/skills/container-security ~/.gemini/config/skills/

    Use this instead of the previous step. For the Antigravity CLI the global folder is ~/.gemini/antigravity-cli/skills/.

  4. 4. Add the Snyk MCP server to Antigravity
    {
      "mcpServers": {
        "Snyk": {
          "command": "npx",
          "args": ["-y", "snyk@latest", "mcp", "-t", "stdio"]
        }
      }
    }

    This is the repo's mcp/.mcp.json. Put it in ~/.gemini/config/mcp_config.json (all projects) or .agents/mcp_config.json (this project). Needs Node.js for npx. Without the MCP server the skill has no scan tool.

  5. 5. Log in to Snyk
    npx -y snyk@latest auth

    The README says snyk auth (or set SNYK_TOKEN for non-interactive use). The npx form is our adaptation for machines without a global Snyk CLI.

  6. 6. Check that Antigravity sees both

    Antigravity 2.0 app: start a new conversation and ask "What skills do you have?"; container-security should be listed. Antigravity CLI: run /skills (/skills reload in a session that was already open). The Snyk server should appear under Settings > Customizations > Installed MCP Servers.

The studio-recipes README does not mention Antigravity, and Snyk's installer does not install this skill. These steps copy the documented skill folder into Antigravity's standard skill folders and reuse the repo's own MCP config.

Using Claude Code, Cursor or Codex? See other assistants below.

What is Container Security (Snyk)?

Container Security is Snyk's instruction-only skill for developers who build Docker images and want their coding agent to scan an image with Snyk, explain which vulnerabilities come from the base image and which from their own layers, and propose Dockerfile, package and base-image fixes. The scan itself runs through the Snyk MCP server, so you need a Snyk account. What we counted at commit 691f03c (2026-10-01, still the latest commit on 2026-10-14): the skill folder holds 3 Markdown files with 970 lines / 22,460 bytes in total (SKILL.md is 359 lines / 9,726 bytes, plus references/base-image-recommendations.md and references/dockerfile-best-practices.md) and no scripts. SKILL.md is organised as 5 phases (identify the image, scan, analyse, remediate, verify), 3 ready-made scenarios, a 7-row base-image quick reference, 3 error cases and 5 constraints. It is one of 8 skill folders under command_directives/synchronous_remediation/skills/ in snyk/studio-recipes.

How to use Container Security (Snyk)?

Copy the container-security folder into your agent's skills folder, connect the Snyk MCP server (the repo's mcp/.mcp.json starts it with npx -y snyk@latest mcp -t stdio) and log in with snyk auth or a SNYK_TOKEN. Then ask in plain words, for example "scan my app:latest image and help me fix it". The skill tells the agent to call the Snyk container scan tool (optionally with your Dockerfile path, app_vulns and a severity threshold), group findings into base OS packages, added OS packages, app dependencies and Dockerfile issues, suggest fixes, and after you apply them rebuild with docker build --no-cache and scan again for a before/after table.

Key features of Container Security (Snyk)

  • ✓Scans a local image, a registry image or a .tar archive through the Snyk MCP container scan tool
  • ✓Optional parameters the skill passes: Dockerfile path (file), app_vulns, severity_threshold and exclude_base_image_vulns
  • ✓Two-scan method to separate vulnerabilities inherited from the base image from those your own layers add
  • ✓Remediation guidance for base-image upgrades, single OS packages and application dependencies
  • ✓Dockerfile hardening checklist: pinned tags, non-root user, multi-stage builds, --no-install-recommends
  • ✓Verification step: rebuild without cache, re-scan and compare before/after counts

When to use Container Security (Snyk)

  1. 1Scanning a Docker image before deploying it
  2. 2Hardening an existing Dockerfile
  3. 3Choosing a base image with fewer known vulnerabilities
  4. 4Finding out which vulnerabilities come from the base image and which you added

Installation & Setup Guide

Agent Rules / Prompt Setup

Follow these steps (taken from the project's own docs) to configure Container Security (Snyk) in your development environment.

Step 1: Claude Code: copy the skill folder (documented)claude
git clone --depth 1 https://github.com/snyk/studio-recipes /tmp/studio-recipes && mkdir -p .claude/skills && cp -r /tmp/studio-recipes/command_directives/synchronous_remediation/skills/container-security .claude/skills/

command_directives/synchronous_remediation/skills/README.md documents cp -r skills/<skill-name> into <project>/.claude/skills/ (recommended) or ~/.claude/skills/ (global).

Step 2: Claude Code and others: Snyk MCP config via Snyk's installerclaude
curl -fsSL 'https://raw.githubusercontent.com/snyk/studio-recipes/main/installer/dist/snyk-studio-install.sh' -o snyk-studio-install.sh && bash ./snyk-studio-install.sh --dry-run

From the README. The installer merges the Snyk MCP config and other recipes (hooks, snyk-fix commands) into detected assistants; it does not add container-security. Remove --dry-run after checking what it will change.

Step 3: Authenticate Snykclaude
snyk auth

Or set SNYK_TOKEN from your Snyk account (README).

Step 4: Cursor: not documented by the projectcursor

The installer configures the Snyk MCP server for Cursor, but the repo gives no Cursor path for the container-security skill, so we do not list one.

Usage Example & Verification

Prompt / Request Example
1) Project example (End-to-End Example in SKILL.md): "Scan my app:latest image and help me fix it."
-> What happens: the agent calls the Snyk container scan tool with image="app:latest" and app_vulns=true, summarises the findings by severity and source (base image vs. your layers), and proposes a base-image upgrade, package pins and dependency updates. After you apply them it rebuilds and re-scans.

2) Our example: "Review my Dockerfile, build it as myapp:dev and scan it with the Dockerfile attached. Only show high and critical issues."
-> What happens: this follows Scenario 2 in SKILL.md ("Secure my Dockerfile"): a Dockerfile review, a docker build, then a scan with file="./Dockerfile" and severity_threshold="high", combined into one fix list. The skill's allowed tools include Write and Edit, so it may offer to change the Dockerfile; check the diff.

3) Our example: "Which vulnerabilities in node-api:1.4 come from the base image, and which did we add?"
-> What happens: Step 2.3 in SKILL.md: one scan with exclude_base_image_vulns=true (only your layers) and one without it (full picture), then a comparison.
Installation Confirmation Method

In a new Antigravity conversation ask "What skills do you have?" (CLI: /skills) and look for container-security; check that Snyk is switched on under Installed MCP Servers. Then try "Scan nginx:latest with Snyk and summarise the critical issues".

Security Review

Static review
Reviewed Date
2026-10-14
Audited Ref / Commit
691f03ce1b74d16514686601d4cb1b033a492518
Reviewer
antigravityskills.org (static code review)

Instruction-only Snyk skill (3 Markdown files, no scripts); it needs a Snyk login, sends image scans to Snyk through npx snyk@latest, and may edit Dockerfiles and run docker builds.

Full review: scope, findings, risks
Audit Scope:Static review of snyk/studio-recipes at commit 691f03c (2026-10-01, HEAD on 2026-10-14): command_directives/synchronous_remediation/skills/container-security/ (SKILL.md and both references), skills/README.md and synchronous_remediation/README.md, the repository README.md, installer/manifest.json (all 9 recipes and 4 profiles), mcp/.mcp.json and LICENSE; a search of all files for 'antigravity' and 'container-security'. The installer's Python/Go code and the other skills were not reviewed.
Key Findings:Instruction-only skill: 3 Markdown files, no scripts, no URLs it fetches itself. allowed-tools: mcp_snyk_snyk_container_scan, Read, Write, Edit, Bash, Grep. The workflow uses docker pull, docker login, docker build --no-cache and Dockerfile edits. Scanning goes through the Snyk MCP server (npx -y snyk@latest mcp -t stdio), which needs snyk auth or SNYK_TOKEN. Snyk's installer does not install this skill.
Identified Operational Risks & Permissions:Image data is analysed by Snyk. Broad allowed tools (Bash, Write, Edit) let the agent change files and run Docker commands. npx -y snyk@latest always runs the newest published Snyk CLI. The README's installer is a downloaded shell script (use --dry-run first).

Static review at commit 691f03c. The skill folder command_directives/synchronous_remediation/skills/container-security/ contains SKILL.md and two reference files, all Markdown; there is no executable code. SKILL.md's allowed-tools field grants mcp_snyk_snyk_container_scan plus Read, Write, Edit, Bash and Grep, and its steps include docker pull, docker login <registry>, docker build --no-cache and optional Dockerfile fixes, so the agent can change files and run Docker in your project. The scan is done by the Snyk MCP server that mcp/.mcp.json starts with npx -y snyk@latest mcp -t stdio, which downloads the newest Snyk CLI and sends the image analysis to Snyk; it needs snyk auth or SNYK_TOKEN. The skill reads no API keys itself. Snyk's README installer is downloaded with curl from raw.githubusercontent.com and run with bash; it supports --dry-run and --uninstall, but according to installer/manifest.json it does not install this skill.

Operational Notes & Known Limitations

Known Limitations

  • •Needs the Snyk MCP server and an authenticated Snyk account (SKILL.md compatibility field). Docker must be installed for local images; private registries may need docker login
  • •Snyk's one-command installer does not install this skill (we counted): installer/manifest.json has 9 recipes and the only skills among them are snyk-fix (for Codex and Copilot CLI only) and secure-dependency-health-check. You copy container-security yourself
  • •Antigravity is not mentioned anywhere in the repository (we searched all files). The README's supported list is Cursor, Claude Code, GitHub Copilot (CLI and VS Code), Gemini, Windsurf and Kiro, and the installer has no Antigravity target
  • •allowed-tools names the scan tool mcp_snyk_snyk_container_scan, a client-prefixed name, while the scenarios in the same file call it snyk_container_scan. In other clients the tool may be listed under a different name, so the agent has to match it
  • •Version drift (we counted): the installer manifest pins Snyk CLI 1.1306.0, but mcp/.mcp.json runs npx -y snyk@latest, so the MCP server is whatever Snyk published last
  • •All vulnerability numbers in SKILL.md (for example 18 vulnerabilities, or a base-image change that 'eliminates ~14 vulns') are sample output, not data about your image
  • •Difference from the Portainer MCP page on this site: Portainer manages running containers and stacks; this skill only scans images and suggests fixes. It does not deploy or start anything

Frequently Asked Questions

Is the Container Security skill safe?

In our static review of commit 691f03c, the skill is 3 Markdown files with no scripts. It lets the agent use the Snyk scan tool plus Read, Write, Edit, Bash and Grep, so it can edit your Dockerfile and run docker pull, docker login and docker build. Scans go to Snyk, and the Snyk MCP server runs npx -y snyk@latest.

How do I install Container Security in Antigravity?

Copy command_directives/synchronous_remediation/skills/container-security from snyk/studio-recipes into .agents/skills/ (or ~/.gemini/config/skills/), add the Snyk MCP server to mcp_config.json, run snyk auth, then ask "What skills do you have?" (CLI: /skills). The repo does not mention Antigravity.

Does Snyk's installer include this skill?

No. We counted the 9 recipes in installer/manifest.json; none of them installs container-security. The installer sets up the Snyk MCP server, hooks and the snyk-fix and dependency-health skills.

Do I need a Snyk account?

Yes. SKILL.md requires an authenticated Snyk account; the README says to run snyk auth or set SNYK_TOKEN.

Will it change my Dockerfile automatically?

It can. Write and Edit are in its allowed tools, and the workflow can fix Dockerfile issues and rebuild with docker build --no-cache. Ask it to show changes before applying them.

Supported Platforms

antigravityclaudecodexcursorgemini