agentleFS
K95M65K95M65/AI_ONBOARD/skills/secure-coding/SKILL.md

secure-coding

Skill0 starsChanged 4 months agoMITView on GitHub

Practices for writing secure code — the defensive habits and per-category rules that prevent vulnerabilities before they ship. Use when implementing security-sensitive features (auth, input handling, data access, crypto) or as a checklist while reviewing them.

11 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Files
SKILL.md

Secure coding

The write-time member of the security set: threat-model frames what to protect (before), secure-coding prevents defects (during), security-audit / security-review catch what slipped (after).

When to use

Implementing or reviewing code that handles untrusted input, authentication/authorization, sensitive data, secrets, or cryptography.

Core habits

  • Validate in, encode out. Validate untrusted input at the boundary; encode output for its sink. (Deep dive: the input-sanitization skill.)
  • Least privilege. Narrowest scope, capability, and lifetime for every token, query, and process.
  • Fail closed. On error or ambiguity, deny — never default-allow.
  • Never trust the client. Re-verify every check server-side; client-side validation is UX, not security.
  • Keep secrets out of code and logs. (Deep dive: secret-management; detection: secret-scan.)
  • Prefer safe defaults and reviewed libraries over hand-rolled security (crypto, auth, parsers).

By category

Walk reference.md: injection, authz/IDOR, crypto, error handling & logging, deserialization, and dependencies. For the two biggest areas use the focused skills — input-sanitization and identity-management.

Verify

Pair with security-review (on a diff) or security-audit (on a codebase), and run dependency-vuln-scan and secret-scan. Wire them into CI with automated-security-review.

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.