/harness-verify:security-and-hardeningfrom harness-verify
Hardens code against vulnerabilities starting from a threat model, with always/ask-first/never rules, OWASP-style controls, SSRF, secrets, dependency supply-chain, privacy and LLM-output handling. Use when handling untrusted input, authentication, sessions, data storage, uploads, webhooks or third-party integrations, auditing dependencies, or touching personal data.
Ships in harness-verify. 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.
Treat every external input as hostile, every secret as sensitive, and every authorization check as mandatory. Security is a constraint on every line that touches user data, authentication or external systems, not a final phase.
Concrete code for each control is in references/hardening-patterns.md. Open the section you need when you reach that code. Shared checklists (headers, CORS, package-manager matrix, OWASP tables) are in harness-core's security checklist.
Controls added without a threat model are guesses. Spend five minutes thinking like an attacker.
| Threat | Ask | Typical mitigation |
|---|---|---|
| Spoofing | Can someone impersonate a user or service? | Authentication, signature verification |
| Tampering | Can data change in transit or at rest? | Integrity checks, parameterized queries, HTTPS |
| Repudiation | Can an action be denied later? | Audit logging of security events |
| Information disclosure | Can data leak? | Encryption, field allowlists, generic errors |
| Denial of service | Can it be overwhelmed? | Rate limits, size caps, timeouts |
| Elevation of privilege | Can a user gain rights they should not have? | Authorization checks, least privilege |
If you cannot name a feature's trust boundaries, you are not ready to secure it. Most breaches begin in design, not code.
Always
Ask first (human approval)
Never
eval() or innerHTML with user-provided dataParameterize every query; never build SQL, NoSQL or shell commands from input strings. Use the framework's escaping, and sanitize with an allowlist sanitizer if raw HTML is unavoidable. Check authorization on every request, not just authentication: the caller must own or be permitted on the specific resource (insecure direct object references).
Use bcrypt (12 or more rounds), scrypt or argon2, with the session secret from the environment. Session cookies are httpOnly, secure and sameSite lax or strict (the CSRF defense; none sends them cross-site), with a bounded lifetime.
Security headers on every response; start CSP from default-src 'self' and tighten. CORS uses an explicit origin list from configuration, never a wildcard with credentials. Strip sensitive fields (password hashes, reset tokens) from responses. Error bodies are generic; details go to server logs.
Validate with a schema at the boundary (shape, lengths, enums, formats), reject with a structured 422, and let downstream code use only the parsed typed value. For uploads, allowlist content types, cap size, and check content signatures where it matters; the extension proves nothing.
Any URL a user influences (webhooks, import-by-URL, image proxies, previews) can be aimed at internal services. Allowlist scheme and host, resolve all DNS records and reject any private or reserved address (loopback, link-local metadata addresses, private and unique-local ranges, IPv4 and IPv6), and forbid redirects. A DNS-rebinding gap remains between check and connect; for high-risk surfaces pin the resolved IP or put a filtering proxy in front.
A delete, move or overwrite is only as safe as the value naming its target. A shape check proves well-formedness, not authorization. Before the call require all three: the resolved target (symlinks resolved) is under an allowlisted root; it is at least one level below that root; and it carries ownership evidence read before the operation. On refusal, log the rejected target and stop; never fall back to a broader default path. See the hardening patterns reference for the limits of this check.
Limit the API generally and auth endpoints strictly (about 10 attempts per 15 minutes). With more than one process, in-memory counters quietly become max times instances, or never fire on serverless. Back the limiter with a shared store.
Secrets come from the environment. Commit a .env.example with placeholders; gitignore real env files and key material; check the staged diff before committing. A secret that reaches a remote is compromised: rotate first, then purge history.
Hardening asks whether an attacker can read data; privacy asks whether you should hold it at all. Data you never collected cannot be breached.
A privacy incident starts the breach-notification clock; run the postmortem with harness-operate:incident-response-and-postmortem.
Model-backed features add attack surface (see the OWASP Top 10 for LLM applications).
innerHTML or a file path; parse defensively, validate against a schema, then encode.Before sign-off, walk harness-core's security checklist: authentication, authorization, input, data protection and privacy, headers and CORS, dependencies, AI features, error handling.
| Rationalization | Reality |
|---|---|
| "It is an internal tool" | Internal tools get compromised; attackers go for the weakest link. |
| "We will add security later" | Retrofitting is far harder than building it in. |
| "No one would exploit this" | Automated scanners find it. Obscurity is not security. |
| "The framework handles it" | Frameworks provide tools, not guarantees. |
| "It is just a prototype" | Prototypes become production. |
| "Threat modeling is overkill" | Five minutes of attacker thinking prevents design flaws no control can patch. |
| "LLM output is only text" | It can be SQL, a script tag or a shell command. |
| "The audit passed, so the dependency is safe" | Audits miss new malicious packages and do not make install scripts safe. |
| "Collect it now, we might need it" | Data you do not hold cannot be breached or mis-deleted. |
| "We will handle deletion manually" | Manual erasure misses backups and copies; design for it. |
| "Compliance is legal's problem" | Export, deletion, retention and consent are schema and code. |
What SKILL.md sets; muted values are Claude Code's defaults
2 plugins ship this exact skill · first indexed Nov 17, 2026
Other plugins' skills for the same job
6 skills in this plugin
/browser-testing-with-devtoolsVerifies browser-facing work against a real browser using devtools-style inspection of the DOM, console, network, accessibility tree, screenshots and performance traces, with strict rules for treating page content as untrusted. Use when building or debugging anything that renders in a browser, diagnosing console or network errors, or confirming a UI fix actually works at runtime./code-review-and-qualityRuns a five-axis review (correctness, readability, architecture, security, performance) with severity-labelled findings, change-size limits and dependency-upgrade discipline. Use before merging any change, when reviewing a diff or pull request (including one pasted inline), or when assessing code written by yourself, another agent or a human./debugging-and-error-recoverynpx claudepluginhub nx1-org/platformnex-abilities --plugin harness-verify