/security-agent-skills:testing-llm-insecure-output-handlingfrom security-agent-skills
Tests whether applications trust LLM output and pass it unescaped into browsers, terminals, shells, or databases. Covers XSS, markup injection, data exfiltration, ANSI escape injection, unicode smuggling, and code/SQL injection via model output.
Ships in security-agent-skills. 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.
None: SKILL.md is the whole skill.
Most LLM security attention is on the input. The output is the other half. An application that treats model output as safe and renders or executes it inherits an injection primitive, because the model can be steered (by a user or by poisoned content) into emitting exactly the payload the downstream sink will trust. The model becomes a confused deputy that writes the attacker's markup, escape sequence, or query, and the app runs it.
Test outputs and sinks you own or are authorized to test. Use benign canary payloads and observe your own instrumentation; never exfiltrate real data. If you can't name the authorization, stop.
Trace every sink model output flows into. Follow the output from the model to where it lands: rendered as HTML or markdown, printed to a terminal, concatenated into a shell command or SQL, written to a file or log, fed to another tool or agent, stored and later displayed. Each is a sink that may trust the text.
Classify each sink's escaping. For each, ask what the sink executes and whether output is neutralized before it arrives: is HTML escaped, is markdown sanitized, are terminal escapes stripped, is the query parameterized, is the value quoted. An unescaped sink is where model output becomes code.
Test browser sinks. If output renders as HTML or markdown, get the model to
emit a script or event-handler payload, or an image or link whose URL carries
data, for example . A rendered image with
an attacker URL exfiltrates whatever the model puts in the query string, with no
click. Markdown links and raw HTML both apply.
Test terminal sinks. If output prints to a terminal (a CLI agent, a log viewer), can the model emit ANSI escape sequences that rewrite the display, hide text, spoof a prompt, or, on vulnerable terminals, alter the title or clipboard? Terminal escapes in unsanitized output are a manipulation and spoofing channel.
Test invisible and smuggled output. Can the model emit zero-width characters, homoglyphs, or bidirectional controls that hide content inside benign-looking output, smuggling instructions to a downstream agent or hiding a payload from a human reviewer? Ascii and unicode smuggling in output is how a payload survives a human read.
Test code, command, and query sinks. If output builds a shell command, SQL, a path, or code that executes, treat the model as an untrusted string source: does injected syntax reach the interpreter? Model-authored input to an interpreter is injection with the model as the author.
Rate and record. Severity follows the sink: script execution in a victim's session or exfiltration through an image URL is high or critical; a spoofed terminal line is medium. Record confirmed unsafe sinks and sinks that escape or parameterize output (killed) in the schema.
Confirm. A chat UI renders assistant markdown directly. Poisoned retrieved content steers the model to output
. The browser fetches the image on render, sending the summary to the attacker. No click. Confirmed markdown-image exfiltration,high, remediation = disallow external image loading in rendered output or proxy and strip URLs, sanitize markdown, apply a content policy.Kill. A CLI tool prints model output through a function that strips ANSI and control characters and renders only plain text, and never passes output to a shell. An emitted escape sequence and an emitted command-substitution string both appear as literal, inert characters. Killed,
kill_reason= "output is control-character-stripped and rendered as plain text; never reaches a shell, browser, or query interpreter."
You need to enumerate every sink model output reaches, control (via input or poisoned content) what the model emits, and observe whether the sink executes it: a rendered script, an outbound image request, a terminal redraw, an interpreted command. Any harness where you can shape output and watch the sink works; the sink inventory and the per-sink escaping check are the method.
testing-agents-for-indirect-prompt-injection - the input side that steers what
the model emits.auditing-the-lethal-trifecta - a rendered image or link URL is an egress leg.adjudicating-taint-paths - model output is a taint source into the downstream
sink.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
llm-security, prompt-injection, output-handling, xss, injection-testing
npx claudepluginhub unboundcompute/security-agent-skills --plugin security-agent-skills194 skills in this plugin
/adjudicating-dependency-cve-reachabilityDecide whether a CVE in a dependency actually exposes your application before you scramble to patch: is the vulnerable function on a real call path from your code, do the trigger preconditions hold, and can an attacker control the input that reaches it. Use when an advisory, SCA scan, or dependency bot flags a CVE and you must separate a genuine exposure from unreachable noise, or justify why you are or are not affected. Covers pinning the vulnerable symbol, call-path reachability, precondition checks, and taint from your entry points./adjudicating-taint-pathsDecide whether a whitebox lead is a real bug by tracing taint from an untrusted source to a dangerous sink and confirming every hop against live source. Use after a scanner, a candidate list, or your own reading surfaces a "this looks dangerous" sink (SQL exec, system/exec, file open, deserialize, template render, redirect target, memcpy) and you must decide whether attacker- controlled input actually reaches it - or kill the lead with evidence. Covers forward and reverse taint, witness paths, sanitizer analysis, and the evidence rules that separate a finding from a false positive./auditing-account-abstraction-and-paymaster-trustAudit an ERC-4337 account-abstraction deployment for trust misplaced in the user-operation lifecycle: a smart account whose validation accepts a signature or nonce it should reject, a paymaster that agrees to sponsor gas for operations it should not so an attacker drains its deposit, a bundler or entry-point assumption that lets a user operation be replayed or reordered for gain, and validation logic that reads mutable state or reaches outside its allowed scope. Covers smart-contract wallets, paymasters, bundlers, and the entry point in an account-abstraction stack where a user operation is validated and sponsored before it executes. Use when a user operation is validated, paid for, and executed by separate parties and that trust split is the boundary. The crafted user operation is the source, the drained paymaster or unauthorized execution is the sink, and the over-permissive validation or sponsorship rule is the bug./auditing-account-recovery-and-reset-trustAudit password reset and account recovery flows for the trust that lets an attacker take over an account: a reset token that is guessable, long-lived, reusable, or not bound to the account it was issued for, a recovery path that verifies a weaker factor than login and bypasses multi-factor, a reset link whose host comes from an attacker-controllable header so the token leaks, and a recovery that trusts an unverified email or phone change to redirect the reset. Covers the recovery surface of authentication systems, where resetting a credential or recovering access is the alternate door into an account. Use when an application offers password reset or account recovery and that flow is a path to authentication. The attacker-driven recovery request is the source, the account it takes over is the sink, and the weak token, bypassed factor, or leaked reset link that grants it is the bug./auditing-admission-control-policy-gapsAudit cluster admission control for gaps that let a non-compliant or hostile workload through: a validating webhook that fails open when its backend is unreachable, a policy that scopes by namespace or label and misses the namespaces that matter, a mutating webhook whose changes are trusted downstream, and an ordering or exemption that lets a privileged pod bypass the checks meant to stop it. Covers Kubernetes admission webhooks and policy engines that are supposed to enforce workload security at create and update time. Use when admission policies are the control that keeps privileged, unsigned, or over-permissioned workloads out of the cluster. The workload submitted for admission is the source, the admitted resource is the sink, and the policy gap that let it through is the bug./auditing-ai-agent-permissionsAudit what an AI agent is actually allowed to do versus what its task needs. Covers excessive agency (tools, scopes, and autonomy beyond the job), missing human-in-the-loop gates on irreversible actions, over-broad credentials and their blast radius, sandbox and code-interpreter escape, unfiltered egress, and unbounded resource or spend (denial-of-wallet). Use when granting an agent a tool or scope, reviewing an agent's permission posture, or deciding which actions need approval. The model's restraint is not a control; permissions are.Other plugins' skills for the same job