Skip to content
Skills Library
Security · Building & coding

harden

/harden

Harden code where untrusted input enters the system. Use when implementing auth, handling user input, storing sensitive data, integrating external APIs, adding file uploads or LLM features, or crossing any trust boundary. Don't use for secret scanning (/safe-repo) or dependency CVEs (/deps-audit).

Licence
MIT
Last repository change
24.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 24.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Harden code where untrusted input enters the system. Use when implementing auth, handling user input, storing sensitive data, integrating external APIs, adding file uploads or LLM features, or crossing any trust boundary. Don't use for secret scanning (/safe-repo) or dependency CVEs (/deps-audit).

Original author description

Harden code where untrusted input enters the system. Use when implementing auth, handling user input, storing sensitive data, integrating external APIs, adding file uploads or LLM features, or crossing any trust boundary. Don't use for secret scanning (/safe-repo) or dependency CVEs (/deps-audit).

How it works

  1. Ask first — human approval required
  2. Validate at the boundary
  3. Defaults that are easy to forget
  4. AI / LLM features
  5. Verification
Original SKILL.md headings · 50 lines, 447 words
SKILL.md preview
---
name: harden
effort: xhigh
description: Harden code where untrusted input enters the system. Use when implementing auth, handling user input, storing sensitive data, integrating external APIs, adding file uploads or LLM features, or crossing any trust boundary. Don't use for secret scanning (/safe-repo) or dependency CVEs (/deps-audit).
user-invocable: false
---

# Harden

Security as a constraint on every line that touches user data, auth, or external systems. **Proactive**: applied during implementation, not after. Reactive scans belong to `safe-repo` (sensitive data) and `deps-audit` (CVEs).

## Ask first — human approval required

- New authentication flow or auth logic changes
- Storing new categories of sensitive data (PII, payment)
- New external service integrations
- CORS configuration changes
- File upload handlers
- Rate-limit / throttling changes
- Granting elevated permissions or roles

## Validate at the boundary

Validate at the **system boundary** (route handler, message consumer), not in business logic: a schema validator (Zod, Joi, pydantic, …) defines the contract; reject with 422 + structured error before business logic touches the data. Trust internal code; validate only at the edges.

## Defaults that are easy to forget

- Authorization per resource (ownership), not just authentication
- Queries parameterized; shell commands take argument arrays, never strings built from input; output encoded for its context (HTML, URL, JS)
- Passwords hashed with argon2, scrypt, or bcrypt; reset tokens single-use and short-lived
- OAuth with PKCE and `state`; redirect targets from an allowlist, never a raw user-supplied URL
- Third-party scripts pinned with Subresource Integrity hashes
- Session cookies `httpOnly` + `secure` + `sameSite`; auth tokens never in `localStorage`
- Strip sensitive fields from API responses by default
- Security headers (CSP, HSTS, X-Frame-Options, X-Content-Type-Options)
- Rate limit on auth endpoints
- Logs and error responses free of secrets, tokens, PII, stack traces
- File uploads: allowlist MIME types, enforce max size before processing, check magic bytes when the type matters, store outside the webroot
- Outbound requests: allowlist destinations; never fetch a user-provided URL unvalidated (SSRF)
- CORS: explicit origin allowlist from config; no wildcard on authenticated endpoints
- External integrations: verify webhook signatures, time out every external call, validate third-party response shapes before use; never deserialize untrusted input with unsafe loaders
- Log security events (auth failures, access denials, input rejections) — without the payloads
- Raw HTML from users only through a sanitizer (DOMPurify or equivalent)

## AI / LLM features

- Model output is untrusted input: validate it before it reaches `eval`, SQL, a shell, `innerHTML`, or a file path
- The prompt is not a security boundary; enforce permissions in code (prompt injection)
- No secrets or other tenants' data in prompts or retrieved context
- Agent tools scoped to the task; a human confirms destructive actions
- Token, rate, and recursion limits on every model call

## Verification

After security-relevant code: `deps-audit` shows no critical/high CVEs (or each documented with review date); `safe-repo --diff` clean; headers present (`curl -I`); authz checked on every protected endpoint.

Versions

RepositoryScoreLicence
This page · helderberto/agent-skills100MIT
Calvin-LLC/skills100MIT
alchemy-run/alchemy100Apache-2.0
kennykennethkkang/switchboard100Apache-2.0
hashintel/labs100MIT
akarachen/aghub100MIT
fengshao1227/ccg-workflow100MIT
voxtechnologies/transmute-framework100MIT
manpreet171/slopguard100MIT

Database snapshot: 13.11.2026 · package version 47ec308f344a (SHA-256 digest of the entire package)

Downloads in the last 30 days: 1 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100safe-repo
    Scan the repository for committed secrets and sensitive data; `--diff [<base>]` scopes to a branch's changes. Use when asked to "check for sensitive data", "scan for secrets", or verify no credentials or company data are committed. Don't use for code-level security (/harden),…
  • 95security-and-hardening
    Use this skill when auditing code for vulnerabilities, handling user input, authentication, data storage, or external integrations. Hardens code against OWASP Top 10 with a three-tier boundary system, dependency auditing, data privacy, and LLM safety.
  • 100security-and-hardening
    Use when writing or reviewing code that handles user input, authentication, access control, cryptography, error handling, file uploads, or dependency management. Also activates when a pull request touches any security-sensitive component.
  • 100attack-surface
    This skill should be used when the user asks to "map attack surface", "list entry points", "inventory API endpoints", "find all inputs", "enumerate routes", "discover exposed endpoints", or "map external interfaces". Also triggers when the user asks about exposed APIs, form…
  • 100security-and-hardening
    Hardens code against vulnerabilities. Use when auditing an input handler for vulnerabilities, when handling user input, authentication, data storage, or external integrations, or when checking a login flow is safe against the OWASP Top Ten. Use when building any feature that…
  • 100input-validation
    Validate untrusted input at every trust boundary with allowlists, canonicalization, and hard limits so malformed data never reaches logic. Use when accepting data from requests, files, uploads, or third-party APIs.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.