/ldaume-engineering:shift-left-securityfrom ldaume-engineering
Guides building security into changes from the first line: threat notes, abuse-case tests, platform-safe defaults, and controls at trust boundaries.
Ships in ldaume-engineering. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
A security review after the code is written finds defects that the design
already paid for. This Skill moves the thinking to the moment the change is
shaped, and it prefers the control a platform already provides over one the
change has to invent. It complements a host's final review (for example
Claude Code's security-review); it never replaces it.
It composes with domain Skills such as backend-craft, api-design,
frontend-craft (security headers, CSP), deliver-dependency-upgrades, and
CI Skills: they own their domain detail; this Skill owns the threat note,
the abuse-case test, and where each control sits.
Every default below cites a current primary source by id; evidence, versions,
and access dates are in references/sources.json.
Load references/golden-path.md for the detail
of a boundary: authentication and sessions, CI, dependencies, agent tools and
MCP, network and Kubernetes.
List what the change touches: login, sessions or tokens, permissions, external input, secrets, money, personal data, dependencies, CI/CD, deploy, a new service, network path, or ingress, an MCP server, an LLM or an agent's tools. None: steps 2 to 10 have nothing to add, but section 11 still applies to every change you write. One or more: continue, because insecure design is a defect class no later test removes (supported) [SRC-SEC-001].
Done when the touched boundaries are named in the plan or the PR.
Write one line per threat modeling question into the PR description or spec: what are we working on, what can go wrong, what are we going to do about it, did we do a good enough job (verified) [SRC-SEC-002]. Name an attacker and an asset, not a category: "a logged-in user reads another tenant's invoice by changing the id" is a threat; "IDOR risk" is a label.
Done when each touched boundary has one concrete threat and its control.
Before any control exists, write the abuse-case test in Given/When/Then at the level where the boundary lives: the user without the right calls the endpoint, the hostile input arrives, the token is replayed, the tool receives an injected instruction. Run it and keep the red run (command and failing assertion) for the PR. Each fixed vulnerability leaves one regression test behind.
When the threat is an account reaching data it must not, sweep every route instead of choosing a few: enumerate the router, call each route as that account with the ids of a record it could otherwise see, and assert the answer equals the one for ids that exist nowhere and that no state changed. Compare whole answers, not status codes or a search for the secret: an endpoint that echoes the caller's id fools a text search, and a refusal whose body differs still tells the record exists. Remove the control once and watch the sweep go red on every route it guards.
Done when every threat from step 2 has a test whose red run is recorded.
Find the control the platform already enforces before writing one: the framework's auto-escaping, the ORM's parameterized queries, the auth middleware, the mesh's mutual TLS, the secret store. A platform control holds for every caller; a hand-written one only where someone remembered it (supported) [SRC-SEC-021] [SRC-SEC-022]. A raw escape hatch around a safe API needs a stated reason in the diff. After fixing a vulnerability, propose the safe API or lint rule that removes its whole class. New native or parsing code goes into a memory-safe language where the project allows it (supported) [SRC-SEC-022] [SRC-SEC-019].
GITHUB_TOKEN gets explicit least-privilege permissions.
Untrusted event fields (titles, branch names, bodies) reach run: only
through an env: variable, never an inline expression, and
pull_request_target never checks out or runs pull request code with
secrets (verified) [SRC-SEC-011].Trust comes from an authenticated identity, never from being inside a network (verified) [SRC-SEC-030]. A new service gets its own workload identity and a default-deny network policy with only the needed traffic; a service-to-service path is encrypted and authorized by identity; an ingress authenticates at the entry and keeps the hop to the backend encrypted (supported) [SRC-SEC-031] [SRC-SEC-032]. The cluster detail is in the golden path.
Use NIST SP 800-63B-4, not habits (verified) [SRC-SEC-013]:
Secure, HttpOnly, SameSite; CSRF protection on
cookie-authenticated state changes; a new session id after login and any
privilege change (verified) [SRC-SEC-033].iss,
aud, and exp (verified) [SRC-SEC-034].Model output is untrusted input, and a tool call is a privileged action (verified) [SRC-SEC-014]. Per session, allow at most two of untrusted input, access to sensitive data or systems, and the power to change state or communicate externally; when a feature needs all three, add a human approval or split the session (supported) [SRC-SEC-015] [SRC-SEC-016]. The approval is checked by a component the model cannot steer and fails closed (verified) [SRC-SEC-027]. A command allowlist is not a sandbox (supported) [SRC-SEC-028]. For MCP, never pass a received token through to another API (verified) [SRC-SEC-029]. The golden path has the approval binding, the sandbox rules, the MCP list, and the OWASP agentic risks [SRC-SEC-023].
These hold for every change, boundary or not:
.env files, keys, or cloud CLI credentials; an ignore file
does not stop an agent from reading them.AGENTS.md, CLAUDE.md, .cursorrules), CI
workflows, Dockerfiles, and install scripts only when the task asks, and
name every file touched outside the requested scope in the PR, so
reviewers or code owners gate it (verified) [SRC-SEC-025] [SRC-SEC-026].references/vocabulary.md lists the field's terms for authors and check
scripts; a review does not load it.
Read the diff against the threat note: where access is enforced, how input
is parsed, what is logged, which new egress, dependency, rules file, or CI
change appeared. Run a secret scanner on the diff (for example gitleaks or
the host's push protection), and on a host with a security review command,
run it as the last pass.
Each is retired by the cited source; suggest the replacement instead.
| Folklore | Instead |
|---|---|
| Periodic forced password changes | Change on evidence of compromise [SRC-SEC-013] |
| Composition rules (symbol, digit, mixed case) | Length, blocklist, rate limiting [SRC-SEC-013] |
| Security questions, password hints, email as a second factor | Phishing-resistant authenticators, recovery codes [SRC-SEC-013] |
| SMS codes sold as strong MFA | Restricted; offer a phishing-resistant option [SRC-SEC-013] |
| "Sanitize all input" as the injection fix | Parameterize and encode; validation is additional [SRC-SEC-003] |
| Client-side validation as the control | Server-side parse at the boundary [SRC-SEC-003] |
| Restart the app after a leaked secret | Revoke and rotate the credential [SRC-SEC-006] |
| Long-lived cloud keys in CI secrets | OIDC workload identity [SRC-SEC-007] |
| CI actions pinned by tag | Lockfile or full commit SHA [SRC-SEC-011] |
| A trusted internal network or DMZ | Identity-based, encrypted, default-deny paths [SRC-SEC-030] |
| A command allowlist as the agent sandbox | No shell, -- separator, a real sandbox [SRC-SEC-028] |
The change is done when the PR carries the threat note and the recorded red
run of each abuse-case test, every control sits at the owning boundary (the
platform's where one exists), the secret scan passes on the diff, no .env,
key, or credential file was read, and every new dependency was confirmed to
exist and every update passed the cooldown or names its security exception.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub ldaume/agentic-engineering-harness --plugin ldaume-engineering16 skills in this plugin
/agent-syncProactively evolves a repository's harness artifacts from durable evidence across sessions and tools. Use when starting or completing a session, when repeated friction reveals missing context or checks, when a lesson should outlive the current task, or when instructions, Skills, Rules, Hooks, MCP, or learnings may be stale./build-autonomous-agentsDesigns and implements a bounded agent for a product feature, or one finite agent workflow, with a runtime-neutral contract. Use when building an agent, finite workflow, subagent, tool, or channel integration into an application, adding Flue to an application, migrating an older Flue integration, or designing review loops and when an agent should ask a person./coding-disciplineEnforces clarity, surgical diffs, simplicity, and goal-driven TDD for any codebase. Use when implementing features, fixing bugs, refactoring, or making any code change./completion-gatePre-finish review gate for code changes - correctness, patterns, security, tests, verification, and checking the deployment a change targets before claiming work complete. Use when finishing a task, creating commits, opening PRs, gating a merge on required checks, or preparing to claim work complete./deliver-dependency-upgradesAssess and deliver dependency version changes from a bot signal through source-backed impact analysis, adaptation, protected integration, rollout, observation, rollback, and linked feature-opportunity capture. Use when a dependency bump must pass through its bounded production lifecycle. Do not use for updater configuration, managed Skill pins, isolated CI repair, or release-note summaries./documentation-and-adrsWrites and updates durable project documentation, decision records, runbooks, and architecture notes for a clear reader or operational purpose. Use when making architecture decisions, changing public APIs, adding operational procedures, documenting trade-offs, or deciding whether a change needs an ADR. The prose of a PR, commit, or Confluence page belongs to writing-engineering. Diagrams belong to design-slides.