agentleFS
GhostwheeIGhostwheeI/Master-Planner/.cursor/skills/security-rollback/SKILL.md

security-rollback

Skill0 starsChanged 5 months agoMITView on GitHub

The High-Risk planning track. Adds a threat model, security boundaries, and a rollback plan to a spec when the work touches authentication, user input, data storage, payments, external integrations, or anything irreversible. Use for High-Risk plans or any feature that accepts untrusted data, manages sessions, or moves money/PII.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    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. Very specific:

    When a plan is High-Risk, security is not a later phase — it is a constraint on the design.

    line 9
  2. Distinctive:

    If you can't name the trust boundaries, the plan isn't ready to be secured (OWASP A04: Insecure Design).

    line 30
  3. Very specific:

    Never: commit secrets; log sensitive data.

    line 36
  4. Distinctive:

    Add to the spec a Deployment & Rollback section: deployment target, CI/CD approach, how to revert (the rollback procedure), what signals …

    line 44

≈ “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 & Rollback (High-Risk Track)

When a plan is High-Risk, security is not a later phase — it is a constraint on the design. This skill makes the master-planner add a threat model, hardening boundaries, and a rollback plan to spec.md before the plan is approved.

Adapts the threat-model-first, three-tier-boundary, and OWASP-prevention model from addyosmani/agent-skills security-and-hardening (MIT). See docs/ATTRIBUTION.md.

Step 1 — Threat model first (five minutes, like an attacker)

  1. Map trust boundaries — where untrusted data crosses in: HTTP requests, form fields, file uploads, webhooks, third-party APIs, message queues, and LLM output. Every boundary is attack surface.
  2. Name the assets — what's worth stealing/breaking: credentials, PII, payment data, admin actions, money movement.
  3. Run STRIDE over each boundary (a lens, not a ceremony):
ThreatAskTypical mitigation
SpoofingCan someone impersonate a user/service?authN, signature verification
TamperingCan data be altered in transit/at rest?integrity checks, parameterized queries, HTTPS
RepudiationCan an action be denied later?audit logging
Information disclosureCan data leak?encryption, field allowlists, generic errors
Denial of serviceCan it be overwhelmed?rate limits, input caps, timeouts
Elevation of privilegeCan a user gain rights they shouldn't?authZ checks, least privilege
  1. Write abuse cases next to use cases — for each feature, "how would I misuse this?" becomes the first test.

If you can't name the trust boundaries, the plan isn't ready to be secured (OWASP A04: Insecure Design).

Step 2 — Record the three-tier boundary set in the spec

  • Always: validate all external input at the boundary; parameterize DB queries; encode output (anti-XSS); HTTPS everywhere; hash passwords (bcrypt/scrypt/argon2); security headers (CSP/HSTS/X-Frame-Options); httpOnly+secure+sameSite session cookies; dependency audit before release.
  • Ask first (human approval): new/changed auth flows; storing new categories of sensitive data; new external integrations; CORS changes; file-upload handlers; rate-limit changes; granting elevated roles.
  • Never: commit secrets; log sensitive data; trust client-side validation as a boundary; disable security headers; eval()/innerHTML with user data; store auth tokens in client-accessible storage; expose stack traces to users.

Step 3 — Cover the high-frequency risks in the plan

Note the prevention approach for whichever apply: injection (parameterized queries/ORM), broken auth (hashing + secure sessions), XSS (framework auto-escaping / sanitize), broken access control (authorize per resource, not just authenticate), security misconfig (helmet/headers/CORS allowlist), sensitive-data exposure (field allowlists, env-var secrets), SSRF (allowlist scheme+host, reject private/reserved IPs, forbid redirects), and — if the app calls an LLM — treat model output as untrusted input, keep secrets/other-users' data out of prompts, and scope tool/agent permissions (OWASP LLM Top 10).

Step 4 — Rollback and operability

Add to the spec a Deployment & Rollback section: deployment target, CI/CD approach, how to revert (the rollback procedure), what signals indicate a bad deploy, and the data-migration reversal plan (if any). A "production-ready" claim without a rollback plan is [NO RELIABLE DATA].

Step 5 — Security review checklist (hand to plan-griller)

Authentication (hashing, secure sessions, login rate-limit, expiring reset tokens); Authorization (per-endpoint checks, users access only their own resources, admin role checks); Input (boundary validation, parameterized queries, output encoding, SSRF allowlist); Data (no secrets in VCS, sensitive fields excluded from responses, PII encrypted at rest); Infrastructure (security headers, CORS restricted, deps audited, no internal errors leaked); Supply chain (lockfile committed, npm ci in CI, new deps reviewed); AI/LLM if used (output treated as untrusted, secrets out of prompts, tool permissions scoped).

Anti-Rationalization

ExcuseReality
"It's internal, security doesn't matter"Internal tools get compromised; attackers target the weakest link.
"We'll add security later"Retrofitting is ~10x harder. Put the boundaries in the plan now.
"Threat modeling is overkill"Five minutes of "how would I attack this?" prevents the design flaws no control patches later.
"It's just LLM output, only text"That text can be SQL, a script tag, or a shell command. Treat it as untrusted input.
"We'll figure out rollback if it breaks"The middle of an incident is the worst time to design a rollback. Write it now.

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.