gsd-read-injection-scanner.js
PostToolUse hook that scans file content returned by the Read tool for prompt-injection patterns.
The source repository is archived by its owner, so it gets no more updates.
- Kind
- Hook
- Works with
- Claude Code, Gemini / Antigravity
- Languages
- TypeScript / JavaScript
- Source
- gsd-build/get-shit-done @ bdcaab2c752d
- Path
- hooks/gsd-read-injection-scanner.js
- Jobs
- Guardrails
- Topics
- Security audits, Guardrails & permissions
Credit
- Made by
- gsd-build
- Original
- github.com/gsd-build/get-shit-done/blob/bdcaab2c752d9a33a1a1c…
- License
- MIT
Listed by Skill Manifest; not made by us.
InstallCopy it from the source repository, or sign in and let the assistant adapt it for your project.
Install factsScanned 3 Nov 2026
- Adds
- Entries under `hooks` in .claude/settings.json
- Runs scripts
- Yes
- gsd-read-injection-scanner.js
- the component is a script
- Uses the network
- None found
- Needs secrets
- None found
- Reads outside the project
- /usr/bin/env (gsd-read-injection-scanner.js)
- Source revision
- bdcaab2c752d
- Licence
- MIT
- Last activity
- Archived by its owner
- Last push 31 May 2026
- Review
- Reviewed
Found by a static scan of the stored text; nothing is run. “None found” is not a guarantee, so read what you install before you run it.
#!/usr/bin/env node
// gsd-hook-version: {{GSD_VERSION}}
// GSD Read Injection Scanner — PostToolUse hook (#2201)
// Scans file content returned by the Read tool for prompt injection patterns.
// Catches poisoned content at ingestion before it enters conversation context.
//
// Defense-in-depth: long GSD sessions hit context compression, and the
// summariser does not distinguish user instructions from content read from
// external files. Poisoned instructions that survive compression become
// indistinguishable from trusted context. This hook warns at ingestion time.
//
// Triggers on: Read tool PostToolUse events
// Action: Advisory warning (does not block) — logs detection for awareness
// Severity: LOW (1–2 patterns), HIGH (3+ patterns)
//
// False-positive exclusion: .planning/, REVIEW.md, CHECKPOINT, security docs,
// hook source files — these legitimately contain injection-like strings.
const path = require('path');
// Summarisation-specific patterns (novel — not in gsd-prompt-guard.js).
// These target instructions specifically designed to survive context compression.
const SUMMARISATION_PATTERNS = [
…