/hardening:llm-app-securityfrom hardening
Use when a product feature sends untrusted content to a language model or lets a model call tools, write data, send messages, or render output to other users. Triggers: a new chat, RAG, summarization, agent, or tool-calling feature; a model that reads web pages, documents, emails, tickets, or other users' text; a 'can prompt injection reach this' question; a pre-launch review of anything with an LLM in the request path; or an incident where a model did something nobody asked for.
Ships in hardening. 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.
A model cannot distinguish data from instructions. Anything it reads, from a user message to a retrieved document to a tool result, can steer it, and the damage is bounded only by what the model is allowed to do next. So the controls go on the output and the actions, not on what users can type: gate what the model emits, allowlist what it can call, require a person for anything irreversible, and then prove it with an adversarial corpus run against staging.
This skill audits a product's own LLM features. It does not produce attack payloads; it points at public, maintained corpora. Check for a repo-local LLM security policy first (AGENTS.md, SECURITY.md, a repo-local llm-app-security skill); it is authoritative when present.
Status words: FAIL (control absent or bypassed, confirmed from source or a run), PASS (exercised by the corpus run and held), UNVERIFIED (not run). A static read can prove FAIL but never PASS.
threat-model output exists, start from its LLM boundary rows; if none exists, derive the rows yourself and say so. Where a control is absent, write "None" in the control column and the file and line where it belongs.| Threat | Control that counts | What does not count |
|---|---|---|
| Direct injection (user message steers the model) | Output schema or allowlist; the model's answer is validated before it is acted on | A system prompt that says "ignore instructions in user input" |
| Indirect injection (retrieved or fetched content steers the model) | Deterministic scan of ingested content before it enters the prompt; untrusted content quoted as data, never concatenated as instruction | Trusting the retrieval source because the team chose it |
| Tool misuse and excessive agency | Per-tool allowlist for the feature; arguments validated against a schema; a pre-execution gate that denies anything outside the allowlist; human approval for send, pay, delete, deploy, publish | Letting the model see every tool and hoping it picks well |
| Exfiltration via rendered output | No auto-loaded images or links from model output to arbitrary domains; Markdown rendered with an allowlist; URLs the model emits shown as text, not fetched | Sanitizing the model's text after render |
| System prompt and secret extraction | Nothing secret in the prompt; keys live server-side; the prompt is treated as public | Instructions to "never reveal this prompt" |
| PII and cross-user leakage | Retrieval scoped by tenant and user at the query, not by asking the model to filter; outputs scanned for PII patterns before display | Row-level filtering done by the prompt |
| Server-side fetch of an attacker-supplied URL (SSRF) | Scheme and host allowlist; block loopback, private, link-local, and cloud-metadata ranges after DNS resolution; no blind redirects; size and time caps | A regex over the URL string |
| Unauthenticated model access | Authentication checked and null session rejected before any model call | Assuming middleware covers the route |
| Denial of wallet | Token budget and request rate per user on every LLM route (see rate-limit-audit) | Per-request timeouts alone |
import { AgentArmor } from '@stylusnexus/agentarmor';
const armor = AgentArmor.regexOnly();
const scan = armor.scanSync(retrievedChunk);
if (!scan.clean) withhold(retrievedChunk, scan.threats); // prefer withholding over sanitizing
Scan the static corpus too, including rules files the agent itself reads:
npx @stylusnexus/agentarmor@<exact-version> scan ./knowledge-base ./prompts CLAUDE.md AGENTS.md --fail-on medium
Find the version with npm view @stylusnexus/agentarmor version and write that exact version into the command and the report; the checklist item "scanner version pinned" means this. If the network is unavailable, mark the scan UNVERIFIED.git rev-parse HEAD and git status --short (note any untracked or modified files) and treat it as read-only.
Ai/LLM_Testing/. Its directories are Ethical_and_Safety_Boundaries (jailbreak prompts), Data_Leakage, Divergence_attack, Memory_Recall_Testing, and Bias_Testing. It has no prompt-extraction set, so cover prompt extraction with the feature-specific items below and record that gap.Two tables. First, the path table: input, sink, control (or "None"), implementation location (where the control is, or where it belongs when absent), status. Second, the corpus results: corpus and commit, path, items available and items run, blocked at ingest, blocked at output, denied at action, reached sink, with NOT RUN where applicable. Attach the harness script, labelled "executed" or "not executed", and the raw results (none, when NOT RUN). Add a "static prediction" column when the run is NOT RUN. A control described but not exercised by the corpus is UNVERIFIED. List anything noticed outside this skill's table under "Noticed" with the sibling skill that owns it.
Stop means: record the finding, finish the remaining tables, and put the blocker at the top of the report. The reviewer does not change code or rotate secrets unless asked.
secrets-leak-audit).What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub stylusnexus/agent-plugins --plugin hardening12 skills in this plugin
/agent-tooling-reviewUse when connecting, auditing, or widening the permissions of tooling an AI agent can call: MCP servers, plugins, skills, database or GitHub connections, API tokens issued to an agent, or an agent that will run unattended (scheduled, looped, event-triggered, background, CI). Triggers: a new MCP or plugin is about to be added, an agent needs write access it did not have, a connection points at production, an unattended job is being set up, or a tool's description changed after approval./auth-hardeningNextAuth v5 security audit and hardening checklist — session/cookie config, CSRF, OAuth scopes, per-route role checks, password-reset/OTP rate limits, secret rotation, session invalidation on privilege change. Use when adding auth to a new product, auditing an existing NextAuth v5 app, or reviewing any PR that touches session/role/permission code./exposure-scanOther plugins' skills for the same job