code-security
Skill by semgrep
Provides secure coding guidelines for AI assistants, covering 15+ languages, OWASP Top 10 issues and infrastructure configuration. It is for developers writing or reviewing code that handles input, auth, files, queries or network requests.
Install code-security
Built from the published package, never by AI.
git clone --depth 1 https://github.com/semgrep/skills /tmp/skills && mkdir -p ~/.claude/skills && cp -r /tmp/skills/skills/code-security ~/.claude/skills/code-securityRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/semgrep/skills /tmp/skills && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/skills/skills/code-security ~/.gemini/antigravity-cli/skills/code-securityAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
The code-security skill from Semgrep gives an AI assistant secure coding guidelines. It covers more than 15 languages, the OWASP Top 10, and infrastructure configuration such as Terraform, Kubernetes, Docker and GitHub Actions. The guidance is organized into 28 rule categories, grouped by impact from Critical to Low. A rules directory holds a file for each category with vulnerable and secure code examples, and an index lists CWE and OWASP references.
The skill works in two modes. In proactive mode, the assistant checks code it writes or reviews for relevant vulnerabilities without being asked. In reactive mode, it finds the matching rule file when a user asks about security. A language table lists the priority rules to check first for each language. The skill is aimed at developers who want their code reviewed for security, including requests such as review my code or is this safe.
Written from the project's SKILL.md and checked against it.
What it can do
- Proactive security checksChecks code being written or reviewed for relevant vulnerabilities based on language and patterns.
- Reactive rule lookupFinds the matching rule file when a user asks about a specific security topic.
- Language priority rulesLists the rules to check first for Python, JavaScript, Java, Go, C/C++, Ruby, PHP and HCL/YAML.
- Infrastructure rulesCovers Terraform for AWS, Azure and GCP, Kubernetes, Docker and GitHub Actions configuration.
- Vulnerability rule filesProvides rule files with vulnerable and secure code examples for injection, XSS, SSRF and more.
- CWE and OWASP indexMaps rule categories to CWE and OWASP references in a separate index file.
Try asking
- Check this Python function for SQL injection.
- Review this Terraform file for public access and encryption issues.
- Review my GitHub Actions workflow for script injection risks.
Good to know
- The source describes written guidelines and does not mention automated scanning.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: skills/code-security/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
AGENTS.md113 KB -
README.md3 KB -
SKILL.md5 KB -
metadata.json199 B -
rules/_sections.md7 KB
Show all 34 files
-
rules/_template.md635 B -
rules/authentication-jwt.md3 KB -
rules/best-practice.md3 KB -
rules/code-injection.md5 KB -
rules/command-injection.md3 KB -
rules/correctness.md4 KB -
rules/csrf.md5 KB -
rules/docker.md3 KB -
rules/github-actions.md5 KB -
rules/insecure-crypto.md4 KB -
rules/insecure-deserialization.md7 KB -
rules/insecure-transport.md7 KB -
rules/kubernetes.md4 KB -
rules/maintainability.md2 KB -
rules/memory-safety.md3 KB -
rules/path-traversal.md6 KB -
rules/performance.md3 KB -
rules/prototype-pollution.md3 KB -
rules/race-condition.md7 KB -
rules/regex-dos.md4 KB -
rules/secrets.md4 KB -
rules/sql-injection.md5 KB -
rules/ssrf.md5 KB -
rules/terraform-aws.md5 KB -
rules/terraform-azure.md10 KB
And 4 more files on GitHub.
Alternatives to code-security
All alternatives →Retrieves lab biomarker results and clinician notes from Function Health through its FHIR API. It is for people who want an AI assistant to review their own lab history and notes.
Gives an AI assistant a methodology for finding and exploiting privilege escalation weaknesses on Windows systems during authorized penetration tests. It is for security testers and defenders validating escalation paths.
Guides the assistant through designing, debugging and hardening GitHub Actions CI/CD workflows. It is aimed at teams that run production pipelines on GitHub.
Develops evidence-backed structural security hardening proposals from disclosures, findings, source code, or Codex Security scans. It is for teams that need systemic fixes and architectural tradeoffs.
Claude Security scans code for security issues with Claude Code. It covers whole repositories, branch or pull request diffs, single commits, and existing findings from SARIF files or earlier reports.
Turns vulnerability notes, disclosure reports, PoCs, source code, or Codex Security findings into self-contained vulnerability reports. Built for security researchers who need claims the evidence supports.
Compare with function_health, windows-privilege-escalation or github-actions-advanced
code-security: common questions
Which languages does code-security cover?
The source says it covers secure coding across 15+ languages. It lists priority rules for Python, JavaScript/TypeScript, Java, Go, C/C++, Ruby, PHP and HCL/YAML.
Does code-security cover the OWASP Top 10?
Yes, the source states that it covers the OWASP Top 10 along with infrastructure security and coding best practices. Its rules index includes CWE and OWASP references.
Does it cover infrastructure as code?
Yes, the source includes rules for Terraform on AWS, Azure and GCP, Kubernetes, Docker and GitHub Actions.
How do I install code-security?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is code-security free?
The code is published under the NOASSERTION licence. The service it connects to may have its own pricing.
Is code-security safe to use?
It scores 80 of 100. Grades: maintenance A, licence F, quality B. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to code-security?
Similar skills: function_health, windows-privilege-escalation, github-actions-advanced, propose-security-hardening.
