Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add tmj-90/gaffer --skill security-input-validationgit clone --depth 1 https://github.com/tmj-90/gafferWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/tmj-90/gaffer/security-input-validation)<a href="https://agentmods.dev/skills/tmj-90/gaffer/security-input-validation"><img src="https://agentmods.dev/badge/skills/tmj-90/gaffer/security-input-validation/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/tmj-90/gaffer/security-input-validation"><img src="https://agentmods.dev/badge/skills/tmj-90/gaffer/security-input-validation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00074 | $0.01751 |
| Opus 5.5 | $0.00030 | $0.00700 |
| Sonnet 5.5 | $0.00015 | $0.00350 |
| Haiku 4.5 | $0.00007 | $0.00175 |
Grade B, and why
security-input-validation scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Cloud metadata endpointmediumServer-side request forgery
One request to 169.254.169.254 can return temporary IAM credentials.
and reject private, loopback, link-local and metadata addresses (`169.254.169.254`) Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.
How it starts
The opening of the file, as written. The whole thing — 117 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Validate and sanitize untrusted input
Everything that crosses a trust boundary is hostile until proven otherwise. That includes HTTP input, webhooks, message payloads, files, environment-sourced URLs and third-party API responses. The defence has two halves. Validate at the boundary, so malformed input is rejected. Encode or parameterise at every sink, so input that passes validation still cannot change the meaning of SQL, HTML, a shell command or a path. Validation alone never prevents injection (OWASP Input Validation Cheat Sheet; ASVS 5.0 V1 and V2).
Procedure
- Map the flow. For each new input, write down its source, the sinks it reaches
(DB query, HTML/template, shell, filesystem path, outbound URL, regex, log, CSV
export, email header, deserialiser) and its type. Call
search_lorefor the repo's validator, error envelope and sanitising helpers, then copy a sibling endpoint. - Validate at the trusted boundary with a schema (Zod, Pydantic, Bean Validation,
or the repo's own). Validate on the server, never only on the client (ASVS 2.2.2).
- Canonicalise once, then validate (ASVS 1.1.1): decode percent-encoding and charset once, and apply Unicode NFKC to identifiers before comparing them.
- Check syntax (type, format, length, range, enum, anchored allow-list regex), then semantics (end after start, quantity within stock, currency matches the account).
- Reject unknown fields and bind to an allow-listed DTO. This also prevents mass assignment.
- Reject with the repo's standard 400/422 (RFC 9457 problem details if the repo uses it). Do not echo the offending value back or leak internals.
- Bound everything. Set a body-size limit at the parser, maximum string length,
maximum array length and maximum nesting depth. Check length before running any
regex. Use anchored regexes with no nested quantifiers such as
(a+)+, or a linear-time engine, to avoid ReDoS (ASVS 1.3.12). Rate limits belong to therate-limitingskill. - Make each sink safe by construction.
- SQL/NoSQL: use parameters or the ORM. Identifiers such as sort columns go through an allow-list map. Never concatenate.
- Shell: pass an argv array with no
shell=Trueorsh -cinterpolation, and put--before user-supplied arguments. - Paths: never use a user-supplied name as a path. Generate the name. Otherwise resolve the real path and assert it stays under the base directory.
- Temporary files: use unique, unpredictable names from
mkstemp,fs.mkdtempor a UUID, never a user filename or a timestamp. Colliding temp names under concurrent requests shipped as HTTP 500s in past Gaffer builds. - HTML: rely on template auto-escaping. Use
innerHTML/dangerouslySetInnerHTMLonly on output from a vetted sanitiser such as DOMPurify. Use context-specific encoding for attributes, URLs and JS. Allow onlyhttp/httpsin user URLs. - Outbound URLs (SSRF, ASVS 1.3.6): allow-list scheme, host and port. Resolve DNS
and reject private, loopback, link-local and metadata addresses (
169.254.169.254) at connect time, and re-check on every redirect or disable redirects. - Parsers: disable XXE and external entities, use no unsafe deserialiser on
untrusted data (
pickle,yaml.load, Java native), and never build templates from input (SSTI). - CSV/XLSX export: prefix cells that start with
=,+,-,@, tab, CR or NUL (ASVS 1.2.10; OWASP CSV Injection). - Logs: strip CR/LF or use structured logging, so input cannot forge log lines.
- Redirect targets (
returnTo): relative paths or an allow-list only. - File uploads: follow the
file-uploadsskill.
- Treat third-party responses as input. Validate them with a schema before use. Verify webhook signatures with a constant-time compare before parsing the body.
- Test the boundary with table-driven cases that go through the real handler:
- Valid input at the minimum and maximum. Just outside each bound. The wrong type. An unknown field. An oversized body. An empty or null value. A non-canonical Unicode form.
- One payload per sink, asserting that the input is treated as data:
' OR 1=1--matches no extra rows,../../etc/passwdis rejected, and<script>alert(1)</script>renders escaped. An internal URL (http://127.0.0.1/,http://169.254.169.254/) is refused, and=cmd|' /C calc'!A0is neutralised in the export. - If concurrent requests write temp files or shared state, add a test that fires them in parallel and asserts that all of them succeed.
- For parsers and normalisers, use the
property-based-testskill.
- Evidence. Record the test command and summary as
test_outputthrough therecord-evidenceskill, then stop.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2mo ago Changed · +65 lines scan A → B d18cfbcb200a
- 3mo ago First seen · 52 lines · 74 tokens per session scan A 14da426078b7
security-input-validation is a skill published in the GitHub repository tmj-90/gaffer (1 stars, last pushed 4d ago), licensed Apache-2.0. It adds 74 tokens to every session and 1,751 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it B with 1 finding (cloud metadata endpoint). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
security-input-validation compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| security-input-validationtmj-90/gaffer | Skill | 1 | 4d ago | Apache-2.0 | B | 74 | Claude Code, Codex |
| bulwark-brainstormQBall-Inc/the-bulwark | Skill | 9 | yesterday | MIT | A | 50 | Claude Code |
| plan-creationQBall-Inc/the-bulwark | Skill | 9 | yesterday | MIT | A | 38 | Claude Code |
| anthropic-validatorQBall-Inc/the-bulwark | Skill | 9 | yesterday | MIT | A | 40 | Claude Code |
| create-subagentQBall-Inc/the-bulwark | Skill | 9 | yesterday | MIT | A | 42 | Claude Code |
| test-auditQBall-Inc/the-bulwark | Skill | 9 | yesterday | MIT | A | 0 | Claude Code |
| code-reviewQBall-Inc/the-bulwark | Skill | 9 | yesterday | MIT | A | 61 | Claude Code |