code-security
This skill provides comprehensive security guidelines for writing secure code across 15+ languages, covering OWASP Top 10 vulnerabilities and infrastructure…
Identity proven by GitHub's verified organisation badge (semgrep)
- Agents
- Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode, claude.ai and API
- License
- LicenseRef-Semgrep-Rules (restricted)
- Pin
- 68177b8pinned Oct 9, 2026
- Context cost
- about 1,100 tokenswhen the skill loads
- GitHub stars
- 322on semgrep/skills
- Scripts
- None found
What it does
“Security guidelines for writing secure code. Use when writing code, reviewing code for vulnerabilities, or asking about secure coding practices like 'check for SQL injection' or 'review security'. IMPORTANT: Always consult this skill when writing or reviewing any code that handles user input, authentication, file operations, database queries, network requests, cryptography, or infrastructure configuration (Terraform, Kubernetes, Docker, GitHub Actions) — even if the user doesn't explicitly mention security. Also use when users ask to 'review my code', 'check this for bugs', or 'is this safe'.”
Generated summary from the skill's own text
This skill provides comprehensive security guidelines for writing secure code across 15+ languages, covering OWASP Top 10 vulnerabilities and infrastructure security. The agent consults 28 rule categories with specific code examples to identify and prevent SQL injection, XSS, command injection, cryptographic weaknesses, and other security flaws during code writing and reviews. It operates proactively by automatically checking for relevant vulnerabilities based on code patterns and language, or reactively when users ask about security.
When to use it
- Writing code that handles user input, databases, file operations, or authentication
- Reviewing code for vulnerabilities, bugs, or security issues
- Building infrastructure with Terraform, Kubernetes, Docker, or GitHub Actions
- Asking about secure coding practices or vulnerability prevention
When not to
- Deploying to production without additional security testing or audits
- Replacing formal security assessments by dedicated tools or specialists
Install
Restricted license: install from the publisher's repository and read its terms.
These commands install from the publisher's repository and need no account.
skills CLI
npx skills add semgrep/skills --skill code-securityInstalls from the repository's default branch, which may have changed since the commit we checked.
GitHub CLI 2.90 or later
gh skill install semgrep/skills code-security@68177b8830f96cd9d10dacbb14dde2566360503dInstalls the commit we checked (68177b8).
Copy by hand
Download the folder at 68177b8 and put it in .claude/skills/code-security for Claude Code and in .agents/skills/code-security for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode.
Claude Code plugin
/plugin install semgrep@claude-plugins-officialThe publisher's plugin in Claude's official marketplace. It may hold more than this skill, and we have not pinned it.
Copy for your agent
A prompt for any coding agent. It installs this skill from GitHub at the pinned commit, copies the files as they are, and runs nothing unless you ask.
Prompt
Install the agent skill "code-security" by Semgrep. Source, pinned to commit 68177b8830f96cd9d10dacbb14dde2566360503d: https://github.com/semgrep/skills/tree/68177b8830f96cd9d10dacbb14dde2566360503d/skills/code-security 1. Download that folder at exactly this commit. Do not use the default branch. 2. Copy every file unchanged, keeping the folder structure, into .claude/skills/code-security/ for Claude Code and .agents/skills/code-security/ for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode. Create the folders if they do not exist. 3. Do not edit the files, and do not run any script in the folder unless I ask you to. 4. When you are done, list the files you copied and where you put them. Its license is restricted or not stated. Show me the license terms from the repository before you copy anything. Listing and checks: https://www.agentnative.dev/skills/semgrep/code-security
SKILL.md at the pin
The license of this skill does not let us show its files here.
Files
- SKILL.md5.0 KB · b461c67676ae
- AGENTS.md115 KB · 6cd6b4bbf1f1
- README.md2.7 KB · cda8ab182ecd
- metadata.json199 B · 50a92a01f288
- rules/
- _sections.md7.1 KB · 433969dfd99b
- _template.md635 B · b70b95079de5
- authentication-jwt.md3.0 KB · 34733a46ca0f
- best-practice.md3.2 KB · e8f84946a70b
- code-injection.md4.8 KB · eed652664607
- command-injection.md3.5 KB · 647eb190c7ae
- correctness.md3.8 KB · ccd42eeb5f3f
- csrf.md5.5 KB · ab60a433f252
- docker.md2.8 KB · 290ab1e0694a
- github-actions.md5.4 KB · 9d9adfb95cd2
- insecure-crypto.md4.6 KB · 38dd98590800
- insecure-deserialization.md6.8 KB · 208d17602144
- insecure-transport.md6.7 KB · f727737ad830
- kubernetes.md4.5 KB · cf6a7a90b202
- maintainability.md1.8 KB · addc19b3d898
- memory-safety.md3.2 KB · a89456ec456a
- path-traversal.md5.7 KB · bd2b4430192c
- performance.md3.5 KB · 5997b4b1405c
- prototype-pollution.md2.8 KB · 1c5d60dd1b10
- race-condition.md7.1 KB · 39ce1f2f5c32
- regex-dos.md3.8 KB · b65841b3f860
- secrets.md4.2 KB · 707d4719022c
- sql-injection.md5.5 KB · f63b58e5f9a2
- ssrf.md5.1 KB · 0512acf2c21b
- terraform-aws.md4.9 KB · 57d6fc77edb6
- terraform-azure.md10 KB · 55aa51834974
- terraform-gcp.md8.7 KB · 230c34f2496f
- unsafe-functions.md5.4 KB · 6d640ce274fe
- xss.md5.3 KB · 467ea130cc49
- xxe.md4.6 KB · 3dcbba04f4fb
34 files, 268 KB in total. Each file has a sha256 in the pin's manifest; the first 12 characters are shown.
Skill folder on GitHub at 68177b8More from Semgrep
llm-security
This skill provides security guidelines for LLM applications based on the OWASP Top 10 for LLM 2025.
Claude Code, Codex, Cursor +4 · about 1.1K tokens · pinned 6 days ago
semgrep
This skill enables the agent to run Semgrep static analysis scans for security vulnerabilities and create custom detection rules in YAML.
Claude Code, Codex, Cursor +4 · about 2.2K tokens · pinned 6 days ago
add-and-validate-guardian-developer-semgrep-rule
This skill helps developers write custom Semgrep rules and add them to Guardian to enforce project conventions or catch patterns Guardian's standard rules miss.
Claude Code · about 2.1K tokens · pinned 6 days ago
remove-guardian-developer-semgrep-rule
This skill removes custom Semgrep rules that Guardian maintains in user or repository directories.
Claude Code · about 940 tokens · pinned 6 days ago
setup-semgrep-plugin
This skill installs and configures Semgrep on the agent's system, including authentication with Semgrep's service and verification that version 1.146.0 or…
Claude Code, Codex, Cursor +4 · about 190 tokens · pinned 6 days ago
Related in Security
container-security
This skill scans Docker container images for OS package vulnerabilities, application dependencies, and Dockerfile configuration issues using Snyk.
by SnykOfficial publisher
Claude Code, Codex, Cursor +4 · about 2.2K tokens · pinned 6 days ago
iac-security
This skill scans Infrastructure as Code files for security misconfigurations across Terraform, Kubernetes, CloudFormation, and Azure ARM templates using Snyk.
by SnykOfficial publisher
Claude Code, Codex, Cursor +4 · about 2.1K tokens · pinned 6 days ago
claude-security
Scans your repository for security issues using Claude, examines code changes or commits for vulnerabilities, and generates patch files to fix findings.
by AnthropicOfficial publisher
Claude Code · about 1K tokens · pinned 6 days ago
sensitive-logging-audit
The skill helps audit and fix sensitive data leaks in Python SDK logging, exceptions, and telemetry by collecting candidate sinks, manually tracing values…
by OpenAIOfficial publisher
Contains scripts
Claude Code, Codex, Cursor +3 · about 970 tokens · pinned 6 days ago
security-audit
This skill guides security audits of codebases, APIs, and services by finding vulnerabilities that cross real trust boundaries.
by CloudflareOfficial publisher
Contains scripts
Claude Code · about 5.4K tokens · pinned 6 days ago
assess-patch-risk
This skill analyzes patch artifacts to assess their program impact, regression risk, and suitability for automated merging.
by OpenAIOfficial publisher
Codex · about 2.3K tokens · pinned 6 days ago