agentleFS
JBSommelingJBSommeling/claude-config/.agents/skills/security-and-hardening/SKILL.md

security-and-hardening

Skill0 starsChanged 29 days agoMITView on GitHub

Hardens code against vulnerabilities. Use when handling user input, authentication, data storage, or external integrations. Use when building any feature that accepts untrusted data, manages user sessions, or interacts with third-party services.

93 other projects use a version of this, 40 of them edited.

Adopted by

Most recently taken up by

Used with

Projects with it also use constraint-driven-development, observability-and-instrumentation and 9 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.
  • MrCipherSmithSkill

    constraint-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 17 projects that use this

  • HK-hubSkill

    observability-and-instrumentation

    Instruments code so production behavior is visible and diagnosable. Use when adding logging, metrics, tracing, or alerting. Use when shipping any feature that runs in production and you need evidence it works. Use when production issues are reported but you can't tell what happened from the available data.

    Also in 37 projects that use this

  • HK-hubSkill

    deprecation-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 41 projects that use this

  • seikaikyoSkill

    doubt-driven-development

    對非平凡決策啟動新鮮 context 對抗審查(找碴不背書),在修正還便宜的時候抓出錯誤方向。適用:高風險改動(production、資安敏感邏輯、不可逆操作)、不熟的程式碼、要宣稱「這樣是安全的 / 可行的」之前。機械性操作與一行修改不適用。

    Also in 40 projects that use this

  • seikaikyoSkill

    interview-me

    需求不明時的意圖萃取訪談:一次一題、每題附上自己的猜測、聽出「真正想要 vs 覺得應該要」,直到能預測使用者反應(約 95% 信心)才動工。適用:需求缺少對象 / 動機 / 成功標準 / 約束,或使用者點名「訪談我」「先確認一下」「我們確定嗎」。明確自足的指示、純資訊查詢、機械性操作不適用。

    Also in 35 projects that use this

  • dariia-mSkill

    anti-hallucination

    ALWAYS activate this skill. Apply these rules to every task regardless of domain. This skill governs how Claude Code verifies information, writes code, references documentation, and avoids fabricating functions, arguments, APIs, file paths, data structures, or facts. These rules override any inclination to guess.

    Also in 3 projects that use this

  • +1 more from HK-hub

The file

We split this skill into the rules it gives an agent

7 rules. 0 are common, 6 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 88 edited versions we read keep these.

  • 6

    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
  1. Distinctive:

    Treat every external input as hostile, every secret as sacred, every authorization check as mandatory.

    line 8
  2. Distinctive:

    Use HTTPS for all external communication

    line 17
  3. Distinctive:

    Use httpOnly, secure, sameSite cookies for sessions

    line 20
  4. Distinctive:

    Run dependency audit before every release

    line 21
  5. Distinctive:

    Commit secrets to version control

    line 35
  6. Very specific:

    Use eval() or innerHTML with user-provided data

    line 39
  7. Distinctive:

    No rate limiting on authentication endpoints

    line 78

“Common” is measured: kept by at least 6 in 10 of the 88 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Security and Hardening

Treat every external input as hostile, every secret as sacred, every authorization check as mandatory.

The Three-Tier Boundary System

Always Do (No Exceptions)

  • Validate all external input at the system boundary
  • Parameterize all database queries — never concatenate user input
  • Encode output to prevent XSS (use framework auto-escaping, don't bypass it)
  • Use HTTPS for all external communication
  • Hash passwords with bcrypt/scrypt/argon2
  • Set security headers (CSP, HSTS, X-Frame-Options, X-Content-Type-Options)
  • Use httpOnly, secure, sameSite cookies for sessions
  • Run dependency audit before every release

Ask First (Requires Human Approval)

  • Adding or changing authentication flows
  • Storing new categories of sensitive data (PII, payment info)
  • Adding external service integrations
  • Changing CORS configuration
  • Adding file upload handlers
  • Modifying rate limiting or throttling
  • Granting elevated permissions or roles

Never Do

  • Commit secrets to version control
  • Log sensitive data (passwords, tokens, full credit card numbers)
  • Trust client-side validation as a security boundary
  • Disable security headers for convenience
  • Use eval() or innerHTML with user-provided data
  • Store sessions in client-accessible storage (localStorage for auth tokens)
  • Expose stack traces or internal error details to users

Security Review Checklist

Authentication

  • Passwords hashed with bcrypt/scrypt/argon2 (salt rounds >= 12)
  • Session tokens are httpOnly, secure, sameSite
  • Login has rate limiting
  • Password reset tokens expire

Authorization

  • Every endpoint checks user permissions
  • Users can only access their own resources
  • Admin actions require admin role verification

Input

  • All user input validated at the boundary
  • SQL queries are parameterized
  • HTML output is encoded/escaped

Data

  • No secrets in code or version control
  • Sensitive fields excluded from API responses
  • PII encrypted at rest (if applicable)

Infrastructure

  • Security headers configured
  • CORS restricted to known origins
  • Dependencies audited for vulnerabilities
  • Error messages don't expose internals

Red Flags

  • User input passed directly to database queries, shell commands, or HTML rendering
  • Secrets in source code or commit history
  • API endpoints without authentication or authorization checks
  • Missing CORS configuration or wildcard (*) origins
  • No rate limiting on authentication endpoints
  • Stack traces or internal errors exposed to users
  • Dependencies with known critical vulnerabilities

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.