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.
In this repository11 other files it gives its agents.
- access-controlSkill
- accessibilitySkill
- accessibility-testingSkill
- api-securitySkill
- authenticationSkill
- dependency-securitySkill
- injection-preventionSkill
- input-validationSkill
- secrets-managementSkill
- security-headersSkill
- xss-csrfSkill
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
- Distinctive: line 8
Every piece of code starts from a secure baseline.
- Distinctive: line 14
Validate at system boundaries: Every place data enters your system (user input, API responses, file uploads, database results from …
- Distinctive: line 22
Fail closed: When something goes wrong, deny access.
- Distinctive: line 24
Defense in depth: Don't rely on a single layer.
- Distinctive: line 28
Before any code is complete, verify:
- Very specific: line 41
If a secure approach isn't clear, flag it.
≈ “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.
Files
Security Context
Every piece of code starts from a secure baseline. These principles apply to all tasks, all languages, all frameworks.
Principles
- Default to secure. Insecure patterns require explicit justification. Never assume "we'll add security later."
- 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.
- Never trust the client. Client-side validation is UX. Server-side validation is security. Always do both.
- Least privilege. Grant the minimum access needed. Default to deny. Whitelist, don't blacklist.
- Log actions, never credentials. Record what happened and who did it. Never log passwords, tokens, API keys, or PII.
- Fail closed. When something goes wrong, deny access. Don't fail into an open/permissive state.
- 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.
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.

