security-and-hardening
Skill1 starsChanged 31 days agoMITView on GitHub
Hardens code against vulnerabilities. Use when handling untrusted input, authentication, sessions, data storage, file uploads, webhooks, outside services or LLM calls; when auditing a handler or login flow against the OWASP Top Ten; when auditing dependencies or assessing a new package; or when personal data is involved. Privacy decisions (purpose, retention, deletion, sharing) are made when the data is added; legal pages and consent come before launching to real users.
- Reads credentials
88 other projects use a version of this.
Adopted by
Most recently taken up by
- thistleknot/skillstheir own version, first seen Nov 8, 2026
- ishandutta2007/Awesome-Agent-Skillstheir own version, first seen Nov 8, 2026
- enes-alatas/spooltheir own version, first seen Nov 8, 2026
- TheAstroByte/astrobyte-agent-skillstheir own version, first seen Nov 8, 2026
- MMACABRE/SKILLStheir own version, first seen Nov 8, 2026
- celestialdust/achilles-skillstheir own version, first seen Nov 1, 2026
Used with
Projects with it also use constraint-driven-development, deprecation-and-migration and 8 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
MrCipherSmithSkillconstraint-driven-development
Use when a project needs a persistent, measurable quality bar — starting a project without documented standards, 'set up constraints', or when coverage/perf/a11y thresholds get re-debated per-PR. Produces CONSTRAINTS.md with enforceable numbers, ratchets, and a guard against silent weakening. NOT for throwaway prototypes or a one-off CI setup.
Also in 16 projects that use this
HK-hubSkilldeprecation-and-migration
Manages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when deciding whether to maintain or sunset existing code.
Also in 40 projects that use this
HK-hubSkillsource-driven-development
Grounds every implementation decision in official documentation. Use when you want authoritative, source-cited code free from outdated patterns. Use when building with any framework or library where correctness matters.
Also in 43 projects that use this
seikaikyoSkilldoubt-driven-development
對非平凡決策啟動新鮮 context 對抗審查(找碴不背書),在修正還便宜的時候抓出錯誤方向。適用:高風險改動(production、資安敏感邏輯、不可逆操作)、不熟的程式碼、要宣稱「這樣是安全的 / 可行的」之前。機械性操作與一行修改不適用。
Also in 39 projects that use this
seikaikyoSkillinterview-me
需求不明時的意圖萃取訪談:一次一題、每題附上自己的猜測、聽出「真正想要 vs 覺得應該要」,直到能預測使用者反應(約 95% 信心)才動工。適用:需求缺少對象 / 動機 / 成功標準 / 約束,或使用者點名「訪談我」「先確認一下」「我們確定嗎」。明確自足的指示、純資訊查詢、機械性操作不適用。
Also in 36 projects that use this
jarosser06Skilltest-strategy
Plans pytest test strategies for Drift's 90%+ coverage requirement using coverage analysis, edge case identification, and test suite design. Use when determining what tests to write, analyzing coverage gaps, or planning test strategies.
Also in 3 projects that use this
Other versions88 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 88
- addyosmani/agent-skills★ 114ksame name
- penpot/penpot★ 62ksame name
- ollaya-dev/ollaya★ 1.4ksame name
- shashankswe2020-ux/whoop-mcp★ 174same name
- enes-alatas/spool★ 48same name
- vinvcn/addyosmani-agent-skills-zh★ 46same name
- jmxt3/gitscape.ai★ 33same name
- sampleXbro/agentsmesh★ 27same name
- jaskirat1616/grok-skills★ 22same name
- ishandutta2007/Awesome-Agent-Skills★ 21same name
78 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 repository20 other files it gives its agents.
- AGENTS.mdAGENTS.md
- api-and-interface-designSkill
- browser-testing-with-devtoolsSkill
- buildSkill
- code-review-and-qualitySkill
- code-simplificationSkill
- debugging-and-error-recoverySkill
- deploySkill
- design-motion-principlesSkill
- exploreSkill
- flow-documentSkill
- front-end-designSkill
- frontend-ui-engineeringSkill
- incremental-implementationSkill
- observability-and-instrumentationSkill
- planSkill
- playwright-cliSkill
- publishSkill
- pushSkill
- web-design-guidelinesSkill
The file
We split this skill into the rules it gives an agent
12 rules. 0 are common, 8 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 83 edited versions we read keep these.
8
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Project rules first: If the project has .agents/rules/ (installed with the SaaS playbook), read .agents/rules/security.md and …
- Very specific: line 12
Treat every external input as hostile.
- Distinctive: line 21
The API is the security boundary: All validation, authentication and authorization run there.
- Very specific: line 23
Prefer one origin (API under /api), so no CORS.
- Distinctive: line 28
Never log passwords, tokens, card numbers or other sensitive data.
- Distinctive: line 48
Check the staged diff before committing.
- Very specific: line 52
Use the package manager that the lockfile, packageManager and CI agree on.
- Distinctive: line 57
Follow the reference procedure when adding or upgrading dependencies.
- Distinctive: line 61
Keep it out of logs, telemetry and LLM prompts.
- Distinctive: line 62
Keep it findable: tables keyed by user/owner, not free-text blobs.
- Distinctive: line 64
Before launching to real users: privacy policy, consent UI, vendor DPAs, and a final check that the record matches the code.
- Distinctive: line 70
Keep secrets, other tenants' data and the full system prompt out of the context.
“Common” is measured: kept by at least 6 in 10 of the 83 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
<!-- Adapted from addyosmani/agent-skills@1401c8b (MIT, see licenses/). Changes: layered (general guidance here, playbook decisions in .agents/rules/); cloud-agnostic; web app baseline, secret store and managed identity, shared-store rate limiting, private file storage, pre-PR checks, privacy decided when data is added (legal pages at launch); trimmed (detail in references/). -->Project rules first. If the project has .agents/rules/ (installed with the SaaS playbook), read .agents/rules/security.md and .agents/rules/database.md and follow them: they override this skill where they differ. Without them, follow this skill as written.
Security and Hardening
Treat every external input as hostile. When you write code for a rule below, read its section in references/hardening-patterns.md.
1. Threat model first (five minutes)
- Map trust boundaries: requests, uploads, webhooks, outside APIs, queues, LLM output, and local values another party wrote (process command lines, shared-volume filenames, job payloads). Trust follows who wrote a value.
- Name the assets: credentials, personal data, payments, admin actions.
- Run STRIDE over each boundary.
- Write abuse cases next to use cases; the first test is "how would I misuse this?"
2. Web app baseline
- The API is the security boundary. All validation, authentication and authorization run there. Trust nothing the browser sends; never rely on a proxy, CDN or gateway for a check.
VITE_*/NEXT_PUBLIC_*variables reach the browser: never secrets or privileged keys.- Prefer one origin (API under
/api), so no CORS. Otherwise allow exact origins from config only; never*. - Session cookies: host-only,
Secure,HttpOnly,SameSite=Lax/Strict, boundedMax-Age. No auth tokens in localStorage. - Personalised responses:
Cache-Control: private, no-store. - Security headers on every response (CSP from
default-src 'self', only tightened; HSTS; frame protection;nosniff). Never disable them. HTTPS everywhere. - Return an explicit public shape (never
passwordHash, reset tokens). Error bodies are generic; stack traces go to server logs only. - Never log passwords, tokens, card numbers or other sensitive data.
3. Ask the user first
Auth logic changes · new sensitive-data categories · new outside integrations · CORS changes · upload handlers · rate-limit changes · elevated roles.
4. Controls
- Injection: parameterize every query; never build SQL, NoSQL or shell commands from strings.
- XSS: framework auto-escaping; no
eval()/innerHTMLwith user data; allowlist-sanitize unavoidable raw HTML. - Access control: on every request, the user must own or be permitted on that specific resource (IDOR).
- Passwords: argon2, bcrypt (cost ≥ 12) or scrypt from a vetted library. Session secret from the secret store, never code.
- Validation: a schema at the boundary (shape, lengths, enums, formats); reject with 422 and details; use only the parsed value after.
- Uploads: allowlist MIME types, cap size, check magic bytes when it matters, store under a generated name.
- File storage: private buckets only. Users get minutes-long, read-only signed URLs for one object, after an ownership check, signed via managed identity (no long-lived account key). Per-tenant prefix (
<owner_id>/...); the client never picks the full path. - SSRF (server fetches a user-influenced URL): allowlist scheme and host, reject if any resolved IP is private or reserved (incl.
169.254.169.254, IPv6), no redirects. - Destructive ops on derived paths: before delete/move/overwrite, require the symlink-resolved target to be under an allowlisted root, at least one level below it, with ownership evidence read beforehand. A shape check is not authorization. On refusal, log and stop; never fall back to a broader path.
- Rate limiting: API generally, auth strictly (~10 attempts / 15 min), 429 with
Retry-After. Multiple instances or serverless: shared store (e.g. Redis) or API gateway, never in-memory. LLM endpoints also get a per-user token/cost limit.
5. Secrets
- Deployed: the cloud's secret store via managed identity, not app settings or CI variables. Prefer identity-based auth over keys.
- Local: a gitignored env file;
.env.exampleholds placeholders only. - Check the staged diff before committing; a secret scanner (e.g. Gitleaks) runs before each PR.
- A secret that reached a remote is compromised: rotate first, then purge history.
6. Dependencies
- Use the package manager that the lockfile,
packageManagerand CI agree on; stop on disagreement or competing lockfiles. - Block install scripts until reviewed; never blanket-approve.
- OSV-Scanner checks every lockfile before each PR. Triage critical/high by reachability; never auto-apply forced fixes; document deferrals with a review date.
- Audits only catch known advisories: review new packages and lockfile diffs (owner, age, provenance, typosquats).
Follow the reference procedure when adding or upgrading dependencies.
7. Personal data
- Collect only what a feature needs, for a stated purpose.
- Keep it out of logs, telemetry and LLM prompts.
- Keep it findable: tables keyed by user/owner, not free-text blobs. Classify fields as you add them.
- Decide as you add it: purpose, retention, how it's really deleted (stores and backups, not a flag), export, and which outside services or analytics receive it. Record it where the project keeps its data decisions (in the SaaS playbook,
ARCHITECTURE.md→ "Personal data"). - Before launching to real users: privacy policy, consent UI, vendor DPAs, and a final check that the record matches the code.
- A privacy incident starts the breach-notification clock; postmortem with
debugging-and-error-recovery.
8. AI / LLM features (OWASP LLM Top 10)
- Model output is untrusted: never into
eval, SQL, shell,innerHTMLor file paths. Parse, schema-validate, encode. - Untrusted text in context can hijack the prompt. The system prompt is not a boundary; enforce permissions in code.
- Keep secrets, other tenants' data and the full system prompt out of the context.
- Scope tools, validate every tool argument, confirm destructive actions.
- Cap tokens, rate and recursion depth. Partition RAG per tenant; validate documents before indexing.
9. Before every PR
- Gates pass: secret scan, code scan, dependencies (no reachable unmitigated critical/high), security review of the diff (no Critical/High), and an LLM red-team suite (e.g. promptfoo) when LLM code or prompts changed.
- Review the diff for auth, input, data and privacy, headers and CORS, dependencies, AI/LLM and errors (project security checklist if any). Confirm headers in a real response.
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.

