TL;DR: AI coding agents need structured security skills because broad prompts like “write secure code” are too abstract to steer real decisions, according to Semgrep. The practical shift is from post-generation detection alone to machine-readable guidance, testable rules, and feedback loops that constrain insecure code before it lands.
NHIMG editorial — based on content published by Semgrep: AI agents are writing code now. That part is settled
By the numbers:
- 80% of organisations report their AI agents have already performed actions beyond their intended scope, including accessing unauthorised systems (39%), inappropriately sharing sensitive data (31%), and revealing access credentials (23%).
- 96% of technology professionals identify AI agents as a growing security threat, and 66% believe this risk is immediate.
Questions worth separating out
Q: How should security teams implement security skills for AI coding agents?
A: Start with the vulnerability classes that appear most often in your own findings, then write one tightly scoped skill per class.
Q: Why do AI coding agents need more than system prompts for secure development?
A: System prompts are too broad to capture the context-dependent choices that secure code requires.
Q: What breaks when security skills are too broad or too prescriptive?
A: Broad skills lose decision value because the agent cannot tell which rule applies in a specific code path.
Practitioner guidance
- Define scoped security skills for your highest-risk code patterns Start with your top recurring findings, such as input sanitisation, secrets handling, authentication flows, and path traversal.
- Embed positive and negative examples in every skill Include one vulnerable snippet and one corrected version drawn from real code patterns in your stack.
- Test skills with adversarial prompts before rollout Ask the agent to produce insecure code on purpose, then verify whether the skill blocks or corrects it.
What's in the full article
Semgrep's full post covers the operational detail this post intentionally leaves for the source:
- Concrete examples of security skills for specific vulnerability classes, including path traversal and input handling
- Practical patterns for turning static analysis findings into agent instructions that can be applied in real workflows
- Guidance on testing whether an AI coding agent follows a skill when prompted to produce insecure code
- A closer look at how Semgrep's rules and skill collections can be used together in a development pipeline
👉 Read Semgrep's guide on writing security skills for AI coding agents →
AI coding agents and security skills: are your controls specific enough?
Explore further
Structured guidance is becoming the control plane for AI coding agents. Vague prompts do not give security teams a reliable way to shape agent decisions, which is why skills matter more than slogan-level instructions. For application security, this shifts the governance question from “did the model know better?” to “was the model given an enforceable decision rule?” The right comparison is not prompt versus no prompt, but machine-readable control versus human hope.
A question worth separating out:
Q: How can teams tell whether AI-generated code needs extra review?
A: Track where code or changes were produced by AI agents, then apply deeper static analysis and human review to paths that touch authentication, secrets, input handling, or sensitive data. The goal is not to distrust every generated line, but to concentrate scrutiny where the likely failure modes are highest.
👉 Read our full editorial: AI coding agents need security skills, not vague prompting