Skip to content
Back to skills

Harden Input

ASecurity

Adds validation and sanitization to the inputs of one named handler and writes tests that throw bad data at it.

  • 3 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added November 15, 2026
ai-agentsgosql

Security analysis

A100/100

Scanned November 15, 2026

npx -y skills add workspace-templates/ai-agent-templates --skill harden-input --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Harden Input?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Harden Input
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/workspace-templates-harden-input/badge)](https://www.skillsdirectory.com/skills/workspace-templates-harden-input)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: harden-input
description: Adds validation and sanitization to the inputs of one named handler and writes tests that throw bad data at it.
argument-hint: "[handler, route or file name]"
user-invocable: true
disable-model-invocation: true
---

Harden the inputs of this handler: $ARGUMENTS

1. Find the handler and list every external input it reads: body fields, query string, path params, headers, cookies, uploaded files.
2. Use the validation library the project already has (zod, joi, pydantic, class-validator, Bean Validation, go-playground/validator). If none exists, ask before adding a dependency.
3. Define a strict schema: exact types, min and max lengths, numeric ranges, enums for fixed choices, regex for ids and emails, a size cap for bodies and files. Reject unknown fields.
4. Escape or encode on output, and use parameterized queries. Never strip characters as a substitute for validation.
5. Return a 400 with field-level messages that do not echo raw input.
6. Add tests next to the existing ones for: missing fields, wrong types, empty strings, 10 MB strings, null bytes, SQL and HTML payloads, and negative or huge numbers. Run them.

Show the diff and test results, list any input you left unchecked and why, and ask before committing.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.