/claude-kit:security-and-hardeningfrom Claude Kit SDLC
Finds and fixes vulnerabilities in code — input handling, auth, data storage, integrations. Use when asked to harden, secure, or security-review an implementation.
Ships in Claude Kit SDLC. 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.
Security-first development for any stack. Treat every external input as hostile, every secret as sacred, and every authorization check as mandatory — and in a multi-tenant system (if applicable), treat every tenant-scoped query without proper scoping as a data breach. Security isn't a phase; it's a constraint on every line that touches user data, auth, or external systems.
Companion rules: .claude/rules/code-organization.md (auth & dependency patterns), .claude/rules/design-patterns.md (service/repository boundaries), .claude/rules/documentation.md (security documentation). The security-reviewer agent (Phase 5.4 in .claude/rules/mandatory-workflow.md) enforces what this skill teaches.
This file carries the decision layer — boundaries, per-class rules, checklists, red flags. The code
patterns and deep-dive practices live in references/ (linked per section below) and load on demand.
HttpOnly=True, SameSite="lax", Secure=True in productionverify=False, rejectUnauthorized: false, NODE_TLS_REJECT_UNAUTHORIZED=0, or curl -k in app/CI code (see references/owasp-top10-prevention.md §Outbound TLS Verification)references/owasp-top10-prevention.md §Cross-Site Request Forgery)One rule per class — the code patterns, language examples, and full defense discussion live in references/owasp-top10-prevention.md:
HttpOnly +
SameSite=Lax + Secure in production.* with credentials); security
headers (X-Content-Type-Options, X-Frame-Options, HSTS, CSP) on every response.password_hash/tokens by construction; secrets
come only from environment/settings, never source.SameSite alone is a partial mitigation.verify=False or its equivalents.Code patterns in references/input-validation-and-uploads.md:
The full decision tree, plus SBOM generation, reproducible-build verification, and source-level missing-patch detection, live in references/supply-chain-and-dependencies.md:
dependency-verification skill (pre-install name check), the dependency-scanner agent's
integrity mode (post-resolve), an SBOM per release, and reproducible-build verification for what
you publish.dependency-scanner recommends, the
developer lane applies. Document any deferral with a reason and a review date.Apply rate limiting to authentication and public endpoints:
# Example with Redis-backed rate limiting
@router.post("/v1/auth/login", response_model=...)
async def login(
payload: LoginRequest,
_: None = Depends(rate_limit("auth:login", max_calls=10, window_seconds=900)), # 10 / 15 min
db: AsyncSession = Depends(get_db_session),
) -> ...:
...
register, login, forgot-password, reset-password..env files:
├── .env.example → committed (placeholder values only)
├── .env → NOT committed (real secrets)
└── .env.*.local → NOT committed
.gitignore must include: .env, .env.local, .env.*.local, *.pem, *.key
All config is read via the project's settings framework — never scattered environment reads.
# Before committing — check for staged secrets
git diff --cached | grep -iE "password|secret|api_key|token|SECRET_KEY|DATABASE_URL"
Applies only when your product builds an LLM/AI feature — it sends user (or tool/RAG) input to a
model, or uses a model's output. This is a different threat class from the OWASP Top 10 above (which
the mandatory security-reviewer gate enforces). These LLM guardrails are opt-in / advisory — the
Security Clear gate does not block on them — but the threats are real, so treat the guardrails as
the default for any model-backed feature and consciously decide before skipping (see Opt-in & bypass).
Distinct from
.claude/rules/agent-guardrails.md, which secures the Claude Code agent itself. This section secures the LLM features in the product you ship. Reference implementations are tool-agnostic — e.g. llm-guard (Python:scan_prompt/scan_output+ a PII vault), provider-native safety filters, or your own checks. The pattern matters more than the library.
A model is an untrusted, non-deterministic component — untrusted input goes in, untrusted output comes out. Put a guardrail layer on both sides of every model call:
user / RAG / tool input ──▶ [INPUT guardrails] ──▶ model ──▶ [OUTPUT guardrails] ──▶ app uses it
The guardrail specifics — input screening (injection, secrets scan, PII vault, token budget, canonicalisation), output handling (treat as untrusted, leak scan, SSRF allowlist, structured-output validation), least-privilege for model-invoked tools, and the OWASP LLM Top 10 map — live in references/llm-guardrails.md.
This layer is advisory, not a hard gate — you can ship without it. The warn-llm-io hook (when
enabled in your profile) reminds you when you edit model-calling code; it never blocks. To skip a
guardrail deliberately, record a one-line risk acceptance in the spec/PR — what you're skipping,
why, who accepted it, and a review date — so the decision is explicit and revisitable, not silent.
| If you skip… | You accept the risk of… |
|---|---|
| Input injection screening | Prompt injection → data exfiltration, unauthorised tool/actions, jailbreaks |
| PII anonymisation | User PII sent to a third-party provider → privacy/compliance (e.g. GDPR) breach, provider-side retention |
| Output handling (treat as untrusted) | XSS / SSRF / SQL or code injection / RCE downstream from rendered or executed output |
| Token / length limits | Cost blow-ups and model-DoS from unbounded or adversarial inputs |
| Tool least-privilege | An injected prompt driving real, destructive actions through over-privileged tools |
### Authentication
- [ ] Passwords hashed with a strong algorithm (argon2id, bcrypt, scrypt)
- [ ] Session cookies HttpOnly + SameSite=Lax + Secure(prod)
- [ ] Login + forgot/reset rate-limited
- [ ] Password-reset tokens expire
### Authorization & Tenancy
- [ ] Every endpoint uses the auth chain (authentication + authorization)
- [ ] EVERY tenant-scoped query filters by tenant/organization/account ID (multi-tenant systems)
- [ ] Users cannot reach another tenant's resources (no IDOR)
- [ ] Create schemas don't accept server-owned fields (id, tenant_id, etc.)
### Input
- [ ] All request bodies validated with typed schemas and constraints
- [ ] Queries parameterized (no string interpolation with user input)
- [ ] Frontend: no raw HTML rendering with user data
### Data & Logging
- [ ] No secrets in code or git history (environment variables / secrets manager)
- [ ] Read schemas exclude password_hash / tokens
- [ ] Logs never contain passwords, hashes, session ids, or PII
### Infrastructure
- [ ] CORS origins allowlist (no "*")
- [ ] Security headers set (X-Content-Type-Options, X-Frame-Options, HSTS, CSP)
- [ ] Dependency audits clean of Critical/High
- [ ] Error responses don't leak internals
- [ ] Cookie/session state-changing requests protected by an anti-CSRF token (not SameSite alone)
- [ ] No outbound TLS verification disabled (`verify=False` / `rejectUnauthorized:false` / `NODE_TLS_REJECT_UNAUTHORIZED=0` / `curl -k`); private CAs supplied via a CA bundle
### LLM / AI features (if any — see "LLM / AI Feature Security"; opt-in)
- [ ] Input screened for prompt injection; retrieved/tool content treated as data, not instructions
- [ ] No secrets sent to the model; PII anonymised before the model (restored via vault after)
- [ ] Model output treated as untrusted — never eval/render-raw/auto-run without validation
- [ ] Output scanned for leaked PII/secrets; emitted URLs allowlisted (SSRF); structured output validated
- [ ] Input/token limits bound cost & DoS; model-invoked tools are least-privilege
- [ ] Any skipped guardrail has a recorded risk acceptance (what / why / who / review date)
See .claude/skills/_references/security-checklist.md for the full pre-commit checklist.
| Rationalization | Reality |
|---|---|
| "This is an internal tool, security doesn't matter" | Internal tools get compromised. Attackers target the weakest link. |
| "We'll add security later" | Retrofitting is 10x harder. Add it now. |
| "No one would try to exploit this" | Automated scanners will find it. Obscurity is not security. |
| "The framework handles security" | Frameworks provide tools, not guarantees — raw queries and missing tenant filters still leak. |
| "It's just a prototype" | Prototypes become production. Security habits from day one. |
*, or no rate limiting on auth endpointsverify=False, rejectUnauthorized: false, NODE_TLS_REJECT_UNAUTHORIZED=0, curl -k), or a TLS-no-verify flag wired into a configSameSite=None cookies with no CSRF defense; a CSRF middleware that is defined but never enforcedAfter implementing security-relevant code:
references/aie-024-model-context-protocol-security-best-practices.md (opens in a new tab)references/aie-026-prompt-injection-in-production-agents-a-2026-taxonomy.md (opens in a new tab)references/aie-027-model-context-protocol-security-risks-and-mitigations.md (opens in a new tab)references/aie-028-ai-agent-data-leakage-secrets-management-and-privacy-risks.md (opens in a new tab)references/aie-030-llm-security-prompt-injection-data-leakage-and-compliance.md (opens in a new tab)references/input-validation-and-uploads.md (opens in a new tab)references/llm-guardrails.md (opens in a new tab)references/owasp-top10-prevention.md (opens in a new tab)references/supply-chain-and-dependencies.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
127 skills in this plugin
/accessibility-reviewUI accessibility (WCAG) review — keyboard operability, focus, ARIA semantics, color contrast, touch targets. Returns prioritized fixes. Distinct from performance/visual review./alembic-migrationsAlembic migration setup and patterns for async SQLAlchemy — async engine + run_sync in env.py, autogenerate, RLS/multi-tenant migrations. Use for alembic init, writing migrations, or debugging migration errors./anthropic-vertex-integrationClaude on Vertex AI via the AnthropicVertex SDK — lazy ADC client init, env-based project/region resolution, async helpers, backoff retry. Use when calling Claude via GCP Vertex AI (not direct Anthropic API).npx claudepluginhub ajyadav013/claude-kit --plugin claude-kitOther plugins' skills for the same job