Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/antgroup/adversarial-ai-coding-plugin/prevent-iac-security-bugsnpx skills add antgroup/adversarial-ai-coding-plugin --skill prevent-iac-security-bugsgit clone --depth 1 https://github.com/antgroup/adversarial-ai-coding-pluginWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/antgroup/adversarial-ai-coding-plugin/prevent-iac-security-bugs)<a href="https://agentmods.dev/skills/antgroup/adversarial-ai-coding-plugin/prevent-iac-security-bugs"><img src="https://agentmods.dev/badge/skills/antgroup/adversarial-ai-coding-plugin/prevent-iac-security-bugs.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00176 | $0.01072 |
| Opus 5 | $0.00088 | $0.00536 |
| Sonnet 5 | $0.00035 | $0.00214 |
| Haiku 4.5 | $0.00018 | $0.00107 |
Grade A, and why
prevent-iac-security-bugs scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 59 lines — stays where its author put it; the contents beside it link to each section on GitHub.
IaC 安全配置生成规范
IaC 配置错误(如特权容器、凭据明文、无网络策略)一旦部署到生产集群,修复成本极高,且可能已造成入侵或数据泄露。在编写配置时消除漏洞,是最低成本的防护手段。
工作流程
按以下三步执行安全配置生成,每步都为后续步骤提供安全保障。
第一步:识别安全风险
分析用户需求,对照下表判断哪些风险类型适用于当前场景。识别出的每一个风险类型都需要处理,不得遗漏。
| 风险类型 | 触发场景 | 参考文档 |
|---|---|---|
| 特权容器与 root 运行 | 配置 Pod/容器;涉及 securityContext;容器以何种用户运行 | references/prevent-privileged-containers.md |
| 凭据硬编码 | env 中含密码/key;ConfigMap 存敏感数据;Dockerfile ENV 含凭据;Terraform/compose 含明文密码 | references/prevent-hardcoded-secrets.md |
| 网络暴露与策略缺失 | 配置 Service(尤其 LoadBalancer/NodePort);未见 NetworkPolicy;Ingress 规则;涉及端口暴露 | references/prevent-network-exposure.md |
| Dockerfile 安全编写 | 编写或修改 Dockerfile;涉及 ADD/COPY、ARG/ENV、USER、CMD、HEALTHCHECK、.dockerignore | references/prevent-dockerfile-security.md |
| RBAC 过度授权 | 创建/修改 Role/ClusterRole;配置 ServiceAccount;权限绑定;涉及通配符权限 | references/prevent-rbac-misconfiguration.md |
| 宿主机路径挂载 | 配置 volume;使用 hostPath;涉及 Docker socket;hostNetwork/hostPID 配置 | references/prevent-host-path-mount.md |
| Capabilities 滥用 | 配置 securityContext.capabilities;涉及特殊系统权限;网络监控/调试场景 | references/prevent-capabilities-misconfiguration.md |
第二步:查阅安全编码规范
对第一步中每一个识别出的风险类型,读取对应的参考文档后再进入第三步。
第三步:生成符合安全规范的配置
在完整理解安全规范后,按以下原则完成用户需求:
- 默认安全:默认禁用特权(
privileged: false、allowPrivilegeEscalation: false)、默认只读根文件系统、默认 Drop ALL Capabilities - 网络最小暴露:内部服务使用 ClusterIP,按需精确开放入站/出站白名单,管理接口不对公网暴露
- 凭据外置:密码、Token、Key 通过 Secret 或外部 KMS 管理,不写入 ConfigMap 或 env value
- 最小权限:RBAC 精确到 verb + resource + resourceName,ServiceAccount 默认禁止挂载 token
- 镜像固定:生产配置使用精确版本标签或 digest,禁止 latest
参考资源
references/prevent-privileged-containers.md— 特权容器与 root 运行防范references/prevent-hardcoded-secrets.md— 凭据硬编码防范(k8s Secret、Vault、KMS)references/prevent-network-exposure.md— 网络暴露与 NetworkPolicy 配置references/prevent-dockerfile-security.md— Dockerfile 安全编写规范(ADD/COPY、构建凭据、USER、HEALTHCHECK、.dockerignore)references/prevent-rbac-misconfiguration.md— RBAC 过度授权防范references/prevent-host-path-mount.md— 宿主机路径挂载与逃逸防范references/prevent-capabilities-misconfiguration.md— Linux Capabilities 滥用防范
What ships with it
7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- references/prevent-capabilities-misconfiguration.md 5.7 KB
- references/prevent-dockerfile-security.md 3.1 KB
- references/prevent-hardcoded-secrets.md 5.3 KB
- references/prevent-host-path-mount.md 6.9 KB
- references/prevent-network-exposure.md 5.2 KB
- references/prevent-privileged-containers.md 5.2 KB
- references/prevent-rbac-misconfiguration.md 7.5 KB
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 5d ago First seen · 59 lines · 176 tokens per session scan A ef2e3d690114
prevent-iac-security-bugs is a skill published in the GitHub repository antgroup/adversarial-ai-coding-plugin (7 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 176 tokens to every session and 1,072 once invoked, about $0.0009 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
deploy-mcp
Deploy the FutureSearch MCP server to staging or production on GKE. Use when the user wants to deploy, redeploy, roll back, scale replicas, or check deployment status. Triggers on deploy, redeploy, staging, production, rollout, scale, replicas.
infrastructure-validation
Use when working with Terraform (.tf, .tfvars), Ansible (playbooks, roles, inventory), Docker (Dockerfile, docker-compose.yml), Kubernetes (manifests, Helm charts), CloudFormation, or any infrastructure-as-code files. Also use when running terraform plan/apply, building Docker images, writing Helm templates, or when…
deploy-from-stale-worktree-silent-rollback
Diagnose "I deployed a new Cloud Run / Docker image but a bunch of recently merged fixes regressed in production." Use when: (1) the deploy script does gcloud builds submit ... "${SCRIPTDIR}" or docker build (build context = local filesystem, NOT a git ref), (2) the user has many git worktrees / multiple checkouts of…
strut
Operate and manage Docker Compose stacks on VPS infrastructure with the strut CLI. Use for any strut task — deploying and releasing services, database backup and restore, debugging production issues, detecting config drift, rotating secrets and keys, setting up monitoring, configuring domains and SSL, validating…
litestar-deployment
Auto-activate for Dockerfile, compose, Railway, Cloud Run, GKE, systemd, Kubernetes, Terraform, deploy scripts, or granian/litestar run at runtime. Not for packaging artifacts.
gcp-cloud-run
Building production-ready serverless applications on GCP with Cloud Run services and Cloud Run Functions. Use when deploying containerized or event-driven applications on Google Cloud.