agentleFS
hereshecodeshereshecodes/secureskills/skills/security-context/SKILL.md

security-context

Skill0 starsChanged 8 months agoMITView on GitHub

Use ALWAYS when writing any code. Sets the secure-by-default mindset for all development tasks.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    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:

    Every piece of code starts from a secure baseline.

    line 8
  2. Distinctive:

    Validate at system boundaries: Every place data enters your system (user input, API responses, file uploads, database results from …

    line 14
  3. Distinctive:

    Fail closed: When something goes wrong, deny access.

    line 22
  4. Distinctive:

    Defense in depth: Don't rely on a single layer.

    line 24
  5. Distinctive:

    Before any code is complete, verify:

    line 28
  6. Very specific:

    If a secure approach isn't clear, flag it.

    line 41

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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 Context

Every piece of code starts from a secure baseline. These principles apply to all tasks, all languages, all frameworks.

Principles

  1. Default to secure. Insecure patterns require explicit justification. Never assume "we'll add security later."
  2. Validate at system boundaries. Every place data enters your system (user input, API responses, file uploads, database results from untrusted sources) is a validation point.
  3. Never trust the client. Client-side validation is UX. Server-side validation is security. Always do both.
  4. Least privilege. Grant the minimum access needed. Default to deny. Whitelist, don't blacklist.
  5. Log actions, never credentials. Record what happened and who did it. Never log passwords, tokens, API keys, or PII.
  6. Fail closed. When something goes wrong, deny access. Don't fail into an open/permissive state.
  7. Defense in depth. Don't rely on a single layer. Validate in the controller AND the service. Check permissions at the route AND the database query.

Code Review Checklist

Before any code is complete, verify:

  • User input is validated server-side
  • Database queries use parameterized statements
  • Authentication is checked on protected routes
  • Authorization verifies resource ownership
  • Secrets are not hardcoded
  • Error messages don't leak internal details
  • Sensitive data is not logged
  • HTTP responses include security headers

When Unsure

If a secure approach isn't clear, flag it. Write a // TODO: SECURITY — verify this is safe comment and explain the concern. A visible question is better than a hidden vulnerability.

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.