# Dockerfile Security Gate

> Scores a Dockerfile for root users, leaked secrets, unpinned images and risky build steps, with the line to change.

Dockerfile Security Gate is a free AI agent skill on Agensi by Prateek, in Security. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [Prateek](https://www.agensi.io/creators/prateek)
- Category: [Security](https://www.agensi.io/skills/security)
- Version: 1.1
- Last updated: 2026-12-04
- Security: scan passed (2026-12-04); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/dockerfile-security-gate
- Tags: devops-cloud, security, code-quality-review

## What it does

- Finds secrets left in ENV and ARG
- Flags root users and privileged build steps
- Catches unpinned images and pipe-to-shell downloads
- Scores the file and gives each fix by line number

## Who it's for

- **Developers shipping to production:** Find security holes and hidden secrets in your container images before you deploy. Try: "Check this Dockerfile for security issues."
- **DevOps teams managing build pipelines:** Enforce best practices and reduce image size across your team's projects. Try: "Audit the Dockerfiles in this folder and show me which ones fail."
- **Security reviewers and auditors:** Quickly spot dangerous patterns like root users or leaked credentials in build files. Try: "Run a security scan on this Dockerfile and give it a grade."

## About this skill

This skill checks your Dockerfile for common mistakes that make containers slow, heavy, or easy to hack. It looks at how you build your images and points out exactly which lines are dangerous, like running as a root user or leaving passwords in the code.

### How it works
1. You provide a Dockerfile or the text of one.
2. The skill runs a check against a set of security and reliability rules.
3. You get a security score from 0 to 100 and a letter grade.
4. You see a table of every problem found, including the line number and how to fix it.
5. You receive a corrected version of the risky parts of your code.

### Frameworks & tools
This skill uses a Python script to analyze your text files.

### Why this beats prompting it yourself
While a standard chat might give general advice, this skill uses a specific set of rules to score your file objectively. It checks for technical details that are easy to miss, like missing install flags that make your images too large or unsafe download methods that could let in viruses.

### Use cases
- Fix a Dockerfile that failed a company security scan
- Find and remove secrets or API keys accidentally left in your build files
- Make your container images smaller by cleaning up install steps
- Stop containers from running with root privileges

### Known limitations
This skill only reads the text in your file. It cannot run the build or see inside the files you are copying into the image.

## Requires

- Python 3.9+

## Technical details

Built to analyze Dockerfile instructions using a Python linter script (lint_dockerfile.py). It checks for security risks (root usage, secrets in ENV/ARG), reliability (unpinned images, ADD vs COPY), and optimization (apt-get cleanup, HEALTHCHECK). Supports multi-stage builds by focusing runtime rules on the final stage. Outputs a structured report with a 0-100 score, severity-based findings table, and a corrected code snippet.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Dockerfile Security Gate skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### What does Dockerfile Security Gate do?

Scores a Dockerfile for root users, leaked secrets, unpinned images and risky build steps, with the line to change.

### Which AI agents support Dockerfile Security Gate?

This skill uses the open SKILL.md standard. Use it through an MCP-compatible agent connected to Agensi, and check the compatibility information on this page for confirmed agents and required capabilities.

### How do I use Dockerfile Security Gate?

Connect your AI agent to Agensi through MCP, then ask it to use Dockerfile Security Gate on your task. Your agent loads the latest approved version each time. Paid skills require a purchase or active subscription. Skill files are not available for download; your licence does not allow you to save, copy or export any part of a skill.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
