security-and-hardening Skill for Claude: Write More Secure Code
Makes Claude threat-model first, then follow a clear always, ask-first and never list when it writes security-sensitive code.
- Installs
- 75.8K
- on skills.sh
- Stars
- 112.6K
- on GitHub
- Files
- 1
- besides SKILL.md
- Updated
- Nov 2026
- last repo commit
security-and-hardening makes Claude start with a short threat model, then apply a three-tier rule set: always do, ask first and never do. It covers injection, XSS, auth and sessions, headers, uploads, secrets, dependencies, privacy and AI features.
It triggers when you handle user input, authentication, stored data or outside services. It bundles one Markdown pattern file with code examples and no scanner scripts, and it tells Claude to run your package manager's own audit.
Good for
- Developers building login, input handling, file uploads or payments
- Teams adding LLM features that need output and prompt-injection rules
- Reviewers who want a checklist to sign off against
Install security-and-hardening
Claude Code
- 1
Copy this prompt.
Install the security-and-hardening skill in Claude Code. Run this command: /plugin marketplace add addyosmani/agent-skills /plugin install agent-skills@addy-agent-skills Then check that it loaded and tell me how to use it.
- 2
Paste it into Claude Code. It shows the change and asks before running it.
The README says a per-skill install copies only the skill folder, not the repo-level references folder that holds the shared checklists. The skill still works without it. The plugin route installs the whole set of 25 skills with those references. Pick one route, not both. If the plugin install fails with an SSH error, the README gives an HTTPS form of the marketplace add.
From the project README. Source.
What's in the skill
When it loads
Hardens code against vulnerabilities. Use when auditing an input handler for vulnerabilities, when handling user input, authentication, data storage, or external integrations, or when checking a login flow is safe against the OWASP Top Ten. Use when building any feature that accepts untrusted data, manages user sessions or session cookies, or interacts with third-party services. Use when auditing dependencies for known vulnerabilities, triaging package-manager audit findings, or assessing supply-chain risk in a new package. Use when personal data or privacy compliance (GDPR, CCPA) is involved.
Sections in SKILL.md
- Overview
- When to Use
- Process: Threat Model First
- The Three-Tier Boundary System
- Always Do (No Exceptions)
- Ask First (Requires Human Approval)
- Never Do
- Hardening Controls
- Injection, XSS, and access control
- Authentication and sessions
- Headers, CORS, and responses
- Input validation and uploads
- Server-side fetches (SSRF)
- Destructive operations on derived paths
- Rate limiting
- Secrets
Key facts
- Author
- addyosmani
- License
- MIT
- Installs on skills.sh
- 75,764 (Nov 2, 2026)
- GitHub stars (whole repo)
- 112,555 (Nov 2, 2026)
- Last commit to the repo
- Nov 1, 2026
- skills.sh audits
- Gen Agent Trust Hub pass, Socket pass, Snyk pass
- Linked, not bundled
- security-checklist.md lives in the repo's references folder, which a per-skill install does not copy (issue 361)
- Frameworks named
- OWASP Top 10 and the OWASP Top 10 for LLM Applications (2025)
What it includes
Map trust boundaries, name assets, run STRIDE, write abuse cases
Five minutes of thinking like an attacker before adding controls.
Threat model first8 rules with no exceptions
Validate external input, parameterize queries, encode output, use HTTPS, hash passwords, set security headers, use httpOnly cookies and run the native dependency audit.
Always do7 changes that need human approval
New auth flows, new sensitive data, new external integrations, CORS changes, file upload handlers, rate limit changes and elevated permissions.
Ask first7 hard stops
Commit secrets, log sensitive data, trust client-side validation, disable security headers, use eval or innerHTML with user data, keep sessions in localStorage or expose stack traces.
Never doInjection, XSS, access control, auth, headers, uploads, SSRF
Each topic links to a pattern with example code in references/hardening-patterns.md.
Hardening controlsAllowlisted root, minimum depth, ownership check
Before a delete, move or overwrite, the resolved target must pass all three checks.
Destructive operations on derived pathsBlock install scripts first, then run the native audit
Never apply forced fixes such as npm audit fix --force automatically. Audits miss new malicious packages, so review new dependencies.
Runs code ·
Dependencies and supply chainClassify fields, collect for a purpose, set retention
Covers deletion paths, consent and data-processing agreements with vendors.
Personal data and privacyTreat model output as untrusted input
Maps to the OWASP LLM Top 10 (2025): validate output, resist prompt injection and keep secrets out of the context window.
AI and LLM featuresSign-off lists
Ends with a verification list, including a clean audit and no secrets in source or git history.
Review checklist and verification
From the official docs
Permissions
Medium risk
The skill makes Claude edit security-sensitive code and run package-manager commands such as audits and clean installs. Work on a branch and review every dependency change.
What it can do
- Read your data
- Create and change things
- Delete things
- Read-only mode
Watch out for
It edits security-sensitive code
Changes to auth, input handling and secrets are easy to get subtly wrong. Review the diff and test on a branch.
It runs package-manager commands
The dependency steps mention native audits and a clean frozen install. Approve each command and read lockfile changes.
The skill says to avoid forced fixes
It warns against applying npm audit fix --force automatically. Hold Claude to that and review any upgrade.
It tells Claude to block dependency install scripts first
The dependency steps say to bootstrap with scripts disabled and to approve only the minimum. Check which scripts you approve.
Technical details
| Talks to | Not stated in the SKILL.md; the dependency steps use your package manager's own commands |
|---|
Questions
How do I install security-and-hardening?
Use the install box above. The plugin route installs all 25 skills and the repo's shared checklists. A per-skill install copies only this skill folder, so its links to security-checklist.md will not resolve. The pattern file inside the folder still works.
Does it scan my code for vulnerabilities?
No scanner is bundled. The folder holds a SKILL.md and a Markdown pattern file. The skill tells Claude to write code to its rules and to run your package manager's native audit against the lockfile before release.
Which standards does it follow?
The SKILL.md builds on the OWASP Top 10 for web apps and maps AI features to the OWASP Top 10 for LLM Applications (2025). It adds STRIDE for threat modeling.
Does it work in the Claude app or Codex?
The README documents a Codex plugin install and a Claude Code plugin. The Claude app route is not documented.
How is it different from code-review-and-quality?
security-and-hardening is a guide to building securely. code-review-and-quality reviews a change on five axes, and its security axis points to this skill for detail. The two are separate skills in the same repo.
Does it need an API key?
No key is named in the SKILL.md. Its audit step uses your package manager's own audit command.
Is it safe?
It is mostly text rules, but it makes Claude edit security-sensitive code and run package-manager commands such as audits and clean installs. Work on a branch and review every dependency change.
Information
updated Nov 2, 2026
- Repository
- addyosmani/agent-skills
- Folder
skills/security-and-hardening
Sources
Docs, issue trackers and discussions this page is built from.
Show all 5Hide
- addyosmani/agent-skills README · github.com
- security-and-hardening SKILL.md · github.com
- hardening-patterns.md · github.com
- security-and-hardening on skills.sh · skills.sh
- addyosmani/agent-skills · github.com