← ClaudeAtlas

testing-llm-insecure-output-handlinglisted

Test what happens after the model speaks: whether an application trusts model output and passes it, unescaped, into a browser, a terminal, a shell, a database, or another system. Covers model-driven XSS and markup injection, data exfiltration through rendered markdown images and links, terminal and ANSI escape injection, invisible-unicode and ascii smuggling in output, and output used to build code, SQL, or shell commands. Use when reviewing any app that renders, executes, or forwards LLM output. The model's output is an untrusted string.
UnboundCompute/security-agent-skills · ★ 27 · AI & Automation · score 80
Install: claude install-skill UnboundCompute/security-agent-skills
# Testing LLM insecure output handling: the output is the other half 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. ## When to use - The app renders model output as HTML or markdown in a browser. - The output is printed to a terminal, written to logs, or shown in a CLI agent. - Model output is concatenated into a shell command, a SQL query, a file path, or code that gets executed. - Output is forwarded to another tool, agent, or stored and later displayed. ## Scope check 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. ## The loop 1. **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. 2. **Classify each sink's escaping.** For each, ask what the sink executes and whether