secure-coding
Skill2 starsChanged 34 days agoApache-2.0View on GitHub
Review code for security vulnerabilities and provide secure coding guidance across Go, Python, JavaScript, Java, Ruby, C#, and Swift, aligned to OWASP Top 10:2025 (application) and aware of the OWASP Top 10 for LLM & GenAI 2025. Triggers on code review, security questions, and vulnerability prevention.
20 other projects use a version of this.
Adopted by
Most recently taken up by
- TheLunchTrae/claude-code-configstheir own version, first seen Nov 8, 2026
- profdorly/ultimate-dev-skillstheir own version, first seen Nov 8, 2026
- AxlZero21/Skillstheir own version, first seen Nov 8, 2026
- its-ash/skillstheir own version, first seen Nov 1, 2026
- gabrielbauman/skillstheir own version, first seen Nov 1, 2026
- nandhu-44/secure-vibe-codingtheir own version, first seen Nov 1, 2026
Other versions20 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 20
- techygarg/lattice★ 209same name
- nimadorostkar/Claude-Skills-collection★ 33same name
- HyunjunJeon/claude-workflow-mods★ 9same name
- MartinOlivero/saas-builder★ 4same name
- sergeyizmailov/knowledge-delta-skills★ 3same name
- slilbudget/knowledge-delta-skills★ 3same name
- ffsshhttiikk/opencode-agents-skills★ 2same name
- g-cqd/skills★ 2same name
- txRandria/skills★ 2same name
- AxlZero21/Skills★ 1same name
10 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository10 other files it gives its agents.
- AGENTS.mdAGENTS.md
- author-detectionsSkill
- fix-findingsSkill
- secure-ai-servicesSkill
- secure-cloudSkill
- secure-osSkill
- secure-pipelineSkill
- secure-saasSkill
- triage-findingsSkill
- understand-codeSkill
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 3 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 16 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 86
When the xgrep guard hook blocks a prompt or tool call, it names the rule and where it matched (never the value).
- Distinctive: line 89
Never work around it: Don't rephrase, split, encode or move the command into a script to get past the guard, and don't edit, disable or …
- Very specific: line 95
The allowlist is the user's call: Only the user adds rule ids to .xgrep/guard-allow.txt.
- Distinctive: line 100
When reviewing code, check for these in order:
“Common” is measured: kept by at least 6 in 10 of the 16 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Secure Coding
Proactively avoid generating vulnerable code. When writing, reviewing, or modifying code, check against the pattern tables in this skill to use safe alternatives instead of dangerous patterns.
When to Use
- Reviewing code for security issues
- Writing new code that handles user input, secrets, HTTP requests, file I/O, or crypto
- Answering "is this safe?" or "how do I securely..." questions
- Generating code that touches authentication, authorization, or data validation
When NOT to Use
- Authoring detection rules (use the
author-detectionsskill) - Triaging existing SAST scan findings (use the
triage-findingsskill) - Non-security code questions (algorithms, performance, etc.)
Detecting Intent
Code review: User shares code or asks to review a file/PR for security issues. Secure alternative: User asks how to do something safely ("how do I compare secrets in Go?"). Proactive: User is writing code that touches a security-sensitive area.
Quick Reference -- Most Critical Patterns
Never Do This
| Pattern | Why | Safe Alternative |
secret == expected | Timing attack | Constant-time compare (see patterns.md) |
"SELECT * FROM t WHERE id=" + input | SQL injection | Parameterized queries |
eval(user_input) | Code execution | json.loads(), ast.literal_eval() |
requests.get(user_url) | SSRF | URL allowlist validation |
open(user_filename) | Path traversal | os.path.basename() + join |
pickle.load(data) / yaml.load(data) | Deserialization RCE | json.loads() / yaml.safe_load() |
jwt.decode(token, secret) (no algorithms) | JWT alg confusion | jwt.decode(token, secret, algorithms=["HS256"]) |
InsecureSkipVerify: true | MitM attack | Remove or set false |
Math.random() for tokens | Predictable | crypto.randomBytes() |
tls.Config{MinVersion: tls.VersionTLS10} | Deprecated TLS | MinVersion: tls.VersionTLS12 |
References
- Full per-language pattern tables: references/patterns.md
- Real CVE code examples: references/cve-examples.md
OWASP Top 10:2025 alignment
This skill is the write-it-securely-first layer for the application categories of OWASP Top 10:2025. The patterns above map to:
| Pattern class | OWASP Top 10:2025 |
| SQLi, command/code injection, SSRF, path traversal, XSS, unsafe deserialization-as-injection | A05:2025 Injection |
Timing-unsafe compare, weak/deprecated crypto, Math.random for tokens, TLS < 1.2, JWT alg confusion, InsecureSkipVerify | A04:2025 Cryptographic Failures |
pickle/yaml.load RCE, untrusted-data sinks, dependency/update integrity | A08:2025 Software or Data Integrity Failures |
| Secrets/PII in log output, error/stack-trace exposure | A09:2025 Security Logging & Alerting Failures (and LLM02, below) |
| Missing/bypassable authorization, hardcoded credentials | A01 / A07:2025 (code side; config side is cnspec) |
A06:2025 Insecure Design is a design/threat-modeling concern no static check can decide — this skill reduces it proactively, but it stays a review-and-design item.
OWASP Top 10 for LLM & GenAI 2025 (when the code is an LLM/GenAI app)
Two categories are code-level and belong here:
- LLM02 Sensitive Information Disclosure — never put secrets or PII in prompts, model inputs, logs, or error text; the "no secrets in log output" check applies to prompts too.
- LLM05 Improper Output Handling — treat an LLM's output as untrusted input. Never
pass it into
eval/exec, a shell, SQL, a file path, or raw HTML/markup without the same validation you would apply to user input.
The full engine coverage (what xgrep and cnspec detect, with honest Strong/Partial/N/A levels)
is in docs/owasp.md; once code is written, the secure-pipeline skill
scans, gates, and fixes it before it ships.
If xgrep guard Blocks an Action
When the xgrep guard hook blocks a prompt or tool call, it names the rule and where it matched (never the value). Treat that as a security finding, not an obstacle:
- Never work around it. Don't rephrase, split, encode or move the command into a script to get past the guard, and don't edit, disable or uninstall the hook.
- Explain and ask. Tell the user which rule fired, why it is risky, and offer a safe alternative (download, inspect, then run; read a secret from the environment).
- Treat a flagged secret as exposed. Recommend rotating it and remove it from the content instead of retrying.
- The allowlist is the user's call. Only the user adds rule ids to
.xgrep/guard-allow.txt.
Review Checklist
When reviewing code, check for these in order:
Security Review:
- [ ] Secret comparison uses constant-time function
- [ ] SQL queries use parameterized placeholders
- [ ] No eval/exec/compile on untrusted input
- [ ] HTTP requests validate URLs against allowlist
- [ ] File paths validated against base directory
- [ ] Deserialization uses safe loaders with type restrictions
- [ ] JWT decoding specifies allowed algorithms
- [ ] TLS >= 1.2, certificate validation enabled
- [ ] Crypto RNG used for security values (not math/rand)
- [ ] No secrets in log output
- [ ] CORS restricted to specific origins
- [ ] HTTP response headers don't include unsanitized user input
- [ ] File creation uses atomic mode setting (no chmod race)
- [ ] XSS: output encoded for context (HTML, JS, URL)Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

