AI Security — Fundamentals
Direct prompt injection, concretely
A system prompt instructs a model to only discuss a company's products. A user message tries to override that directly:
A well-defended system catches this because the override attempt is visible, sitting right there in the user's own message — a classifier scanning incoming messages, or the model itself (if instructed clearly enough and reinforced appropriately) can recognize and refuse this pattern. It doesn't always work, but there's at least a visible thing to defend against.
Indirect injection: the instruction nobody is screening
Indirect injection hides the same kind of override attempt inside content the model reads as part of its normal job — a document it's summarizing, a webpage it's browsing, a tool's returned result:
Nobody reviewed that ticket body specifically for embedded instructions before handing it to the agent — the entire point of the attack is that it rides in on content the system was already going to process as ordinary data.
Why "treat tool results as data, not instructions" is necessary but not sufficient
A common, genuinely useful mitigation is designing the system so tool outputs and retrieved documents are clearly marked as data in the prompt structure, with an explicit instruction that content from these sources should never be treated as a command. This helps, but it isn't a complete fix — a sufficiently capable model following a sufficiently well-crafted indirect injection can still be influenced by instructions embedded in content, even when told not to treat that content as instructions, because the underlying architecture still processes it all as text in the same context.
The OWASP LLM risk categories, as a starting map
The OWASP Top 10 for LLM Applications is periodically revised — verify the current category list and numbering against the live OWASP project page rather than an earlier snapshot. As a general map of where the risk actually concentrates, the recurring themes are: prompt injection (direct and indirect), insecure handling of model output (treating generated text as safe to execute or render without checking), training-data and supply-chain risks, excessive agency (a model or agent granted more capability than its task needs), and sensitive information disclosure (the model revealing data it had access to but shouldn't have shared).
Least privilege, applied to an agent's tool access
The same principle that governs which permissions a human employee or a service account gets applies directly to an agent's connected tools: grant only what the current task genuinely requires, not everything the underlying system could technically do. A ticket-summarization agent needs read access to tickets; it does not need a tool that can send outbound emails, even if that tool happens to already exist and be convenient to wire up.
Try it: Pick an AI feature you've used or built — a support bot, a coding assistant, a document summarizer. List every tool or data source it can reach. For each one, ask whether the current task genuinely needs it, or whether it's connected simply because it was available.

