llm-app-defenselisted
Install: claude install-skill noahfranklin/gideon
# LLM / AI Application Defense
Defense-in-depth for LLM-powered applications. Use during design and code review, or to remediate findings from `llm-redteam`. Assume any text the model reads may be adversarial and any tool it can call may be triggered by that text.
## Core principle
**The model is not a security boundary.** Never rely on instructing the model ("do not reveal…", "ignore malicious requests") as your only control. Enforce security *outside* the model with real authorization, mediation, and least privilege.
## 1. Input mediation (untrusted-context handling)
- Clearly separate **system instructions** from **untrusted data** (user input, retrieved docs, tool outputs, files, web content). Delimit and label untrusted data; don't concatenate it into the instruction channel.
- Filter/normalize inputs for known injection patterns as a *speed bump*, not a guarantee.
- For indirect sources (RAG, web, email, files): validate provenance, strip active content, and treat all of it as data — never instructions.
## 2. Output mediation (insecure-output-handling defense)
- Treat model output as **untrusted** before it reaches any sink.
- Contextually encode/validate for the destination: HTML-encode before browser render, parameterize before SQL, never pass to a shell/`eval`, validate before a downstream API call.
- Enforce output schemas (structured output / function-call schemas) and reject non-conforming responses.
## 3. Least-privilege tools & agency (excessive-agency defe