Day 13 of 1560 minExploit ArchitectHands-on lab

Day 13: Model Output Reaches Classic Sinks

Taught by Mr Elite Updated

By the end of today you can

  • Explain why model-generated text must be treated as untrusted input by databases, shell commands and browser rendering layers.
  • Identify text-to-SQL injection risks when model output is used to construct database queries.
  • Recognise command injection risks when model-generated tool arguments reach shell interpreters.
  • Identify cross-site scripting risks when model output is rendered as HTML without context-appropriate encoding.
  • Review how indirect injection, agent privileges and approval controls from earlier lessons connect to classic application security sinks.

Over the previous lessons, we've looked at prompt injection, tool misuse, agent permissions and human approval. Today we're going to follow the data one step further. What happens after the model produces an answer or a tool argument?

A model response might look like ordinary text, but the application may pass it into a database query, a shell command or a browser page. Those destinations are classic security-sensitive sinks. If the application treats model output as trusted code or markup, a prompt-injection problem can become a SQL injection, command injection or cross-site scripting issue.

The central lesson is simple: the model is not a trusted user, and its output is not automatically safe because it came from your own AI system. We'll trace the flow from model output to the final sink, practise identifying unsafe construction patterns, and review how the earlier lessons on indirect injection, agents and approvals fit into the same security picture. All practical checks should use the supplied isolated labs, synthetic data and harmless test markers.

In this lesson

  • Model Output Is Untrusted Input
  • Text-to-SQL Injection
  • Tool Argument Command Injection
  • Rendered Model Output as Cross-Site Scripting
  • Connect the Three Sinks and Review Earlier Lessons

Premium course

$27 one-time, lifetime access

This day is part of the full course. Unlock it to read every lesson, do every mission and track your progress to the end.