agentleFS
alexderzalexderz/agentic-toolbox/skills/security-hardening/SKILL.md

security-hardening

Skill5 starsChanged 47 days agoMITView on GitHub

use this when reviewing security, mapping trust boundaries, or hardening web, API, or agent changes — including LLD boundary gates, PR security review, auth, secrets, CORS, uploads, mesh binds, and skill intake.

25 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use coordinate, incident-response 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.
  • swyxioSkill

    coordinate

    Coordinate focused Luna helpers for bounded work and Astra advisers for difficult design questions while doing the main work yourself.

    Also in 3 projects that use this

  • AnthropicSkill

    incident-response

    Run an incident response workflow — triage, communicate, and write postmortem. Trigger with "we have an incident", "production is down", an alert that needs severity assessment, a status update mid-incident, or when writing a blameless postmortem after resolution.

    Also in 5 projects that use this

  • OpenAISkill

    observability

    Vercel Observability expert guidance — Drains (logs, traces, speed insights, web analytics), Web Analytics, Speed Insights, runtime logs, custom events, OpenTelemetry integration, and monitoring dashboards. Use when instrumenting, debugging, or optimizing application performance and user experience on Vercel.

    Also in 4 projects that use this

  • barisariburnuSkill

    performance-optimization

    Complete performance optimization guide for Next.js applications including frontend, backend, database, caching, and general optimization strategies. Use when improving performance, reducing bundle size, optimizing queries, or implementing caching.

    Also in 4 projects that use this

  • GitHubSkill

    accessibility-audit

    Audits actual components and routes against applicable WCAG 2.2 A/AA criteria using consumer-owned design-system evidence and repository tools. Use when asked for an accessibility audit, a11y check, keyboard or focus review, contrast check, or screen-reader verification.

    Also in 3 projects that use this

  • MicrosoftSkill

    api-design

    Guide for designing and documenting RESTful APIs. Use when asked to design an API, create endpoints, or document an API.

    Also in 5 projects that use this

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 22 edited versions we read keep these.

  • 6

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Do not treat the system prompt as a security boundary.

    line 14
  2. Distinctive:

    If a change touches a boundary and skips a row, it fails the gate.

    line 31
  3. Distinctive:

    Stop before you add or widen a topic in the table.

    line 46
  4. Distinctive:

    Do not implement the widening in the same pass as an unrelated ticket.

    line 49
  5. Distinctive:

    Leave the CI secret-scan and dependency-audit hooks to tester.

    line 77
  6. Distinctive:

    Never add write, deploy, or credential tools to a skill that reviews, intakes, audits, or hardens, even “to finish the review.” Read, …

    line 85

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

First-party Always / Ask first / Never rules for security and the SDLC. The table shape is inspired by Addy Osmani’s boundary pattern. This file is not a vendor copy.

The gate is the security check at LLD (trust boundaries) and at PR. security owns it.

Prompts are not a boundary

Do not treat the system prompt as a security boundary. Treat LLM output as untrusted.

Enforce authn/z, validation, egress, and data-class rules in code, policy, and infrastructure. Do not count prompt text, “be careful” instructions, or model self-reporting as controls. Treat tool calls, generated SQL/HTML/shell, and agent plans the same as untrusted client input.

Always

RuleWebAPIAgent
Validate at the trust boundary (schema, authn/z, size, type)Form/query/body at the server, not only the browserEvery public and mesh-facing handlerEvery tool argument and model-chosen action before it runs
Parameterized queries / safe data accessNo string-built SQL or ORM raw with user textSame; bind params on every storeGenerated queries are untrusted; run only through parameterized paths
Encode output for the sink (HTML, URL, JSON, shell)Contextual encode; CSP as defense in depthEncode/escape at serialization boundariesNever pass model text to eval, innerHTML, or a shell without a typed allowlist
HTTPS in transitTLS for browsers and callbacksTLS for clients and service-to-serviceTLS for MCP/HTTP tools and callbacks
Hash passwords (slow, salted, dedicated KDF)Login and session issuanceToken/password credential storesAgent-held user secrets: do not invent a store; escalate
Security headersCSP, HSTS, frame/referrer, nosniff as the app requiresSame on browser-facing responsesUI the agent emits still needs headers on the serving app
Secure cookiesSecure, HttpOnly, SameSite on session cookiesCookie and token issuance APIsDo not put session material in prompts or chat logs
Dependency audit before releaseLockfile + known-vuln scan in the release pathSame for API images and libsSame for skill/tool packages; tester owns the hook

If a change touches a boundary and skips a row, it fails the gate.

Ask first

TopicWhy it is a stopTypical surfaces
New authNew principals, factors, or session shapes change the boundaryLogin, magic links, API keys, service identity
New sensitive data classesPII, payment, health, credentials, location need a class and retention storyNew columns, logs, exports, agent memory
New integrationsNew egress, new trust, new failure modesOAuth apps, webhooks, MCP servers, vendors
CORSOrigin policy is a boundary; “* + credentials” is a vulnBrowser APIs, admin UIs
UploadsContent type, size, storage, and execution riskAvatars, CSV, skill zips, attachments
Rate limitsMissing limits are an abuse boundaryPublic APIs, login, agent tool loops
Mesh / network bindsWho can reach the process is a trust boundaryListen address, mesh expose, tunnel
Identity flowsAccount linking, impersonation, and reset change who a principal isSSO, invite, sudo, token exchange
  1. Stop before you add or widen a topic in the table.
  2. Get a decision. On the LLD, the operator or security decides. Elsewhere, the operator decides.
  3. Record the decision on the LLD or the ticket.
  4. Do not implement the widening in the same pass as an unrelated ticket.

Never

NeverWhyWeb / API / agent
Secrets in gitRotation theater; repo history is foreverEnv files, .pem, tokens in SKILL.md, “example” keys that work
Logging tokensLogs leak; agents paste logsAuth headers, cookies, magic links, session IDs
Trust client validationThe client is the attackerBrowser-only checks, agent “I validated it”
eval / innerHTML with user or model dataInjectionDOM sinks, eval, Function, shell eval
Sessions in localStorageXSS reads itPrefer httpOnly cookies; do not stash session JWTs in web storage
Stack traces to clientsLayout and secrets leakProd 500 bodies, agent error relays to untrusted chat
Public mesh / 0.0.0.0 bindsThe network becomes the clientDev servers, dashboards, agent runtimes on a public interface
Extra hosts / Windows outside the workspace without operator approvalHost lockDo not target, remote, or “just use” a personal machine
Personal finance, mail, or password-manager accessOut of agent scopeNo fetch, scrape, MCP, or “help me log in”

Host and personal-account locks are Never, not Ask first. There is no “supervised exception” in this skill.

Roles

RoleOwnsDoes not own
securityThe gate; skill intake per docs/INTAKE.mdMonthly vuln cadence; Monthly is not this gate
operatorVuln severity calls, extra hosts, personal-account exceptionsDay-to-day intake scans
testerCI secret-scan and dependency-audit hooksRewriting this skill or skipping security because CI is green
builderBuilding behind the gateSelf-review as the security PR gate
managerSDLC after-actApproving a ship that skipped security

Leave the CI secret-scan and dependency-audit hooks to tester; do not remint those jobs in this skill. A green CI hook is not a security clear. Escalate vulns to the operator. Never leave one in a “follow-up” with no ticket ID; name the ticket ID.

Workers (remote agents, local CLIs, mirrors) do not bypass security; the rule is in docs/SDLC.md Roles.

Review-skill discipline

Apply least privilege. Keep review skills read-only.

Never add write, deploy, or credential tools to a skill that reviews, intakes, audits, or hardens, even “to finish the review.” Read, report, and escalate instead. If the work needs a write, use a different skill and ask security separately.

Apply the same rule to this skill: use it as a gate only. Never use it as a pentest kit or a credentials broker, or as a reason to open bank, mail, or password stores.

Red flags

  • “The system prompt already forbids that”
  • “The model promised it would not”
  • “Client-side validation is enough for this form”
  • “It is only bound on 0.0.0.0 in dev”
  • “I will audit dependencies after release”
  • “Review will just fix the YAML / merge / rotate”
  • “The extra host is convenient”
  • “I need the password manager / mail / bank to verify”

Each of these fails the gate. Stop. Ask per Ask first, or treat it as Never. Do not ship.

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.