AI and agent security
Understand models, retrieved context, tools, identity and authority before studying prompt injection.
Understand models, retrieved context, tools, identity and authority before studying prompt injection.
- Security foundations
- Identity and access
On this page
Start with the system, not the chat box
A large language model predicts tokens from context. An application decides which instructions, conversation, retrieved documents and tool results enter that context. An agent adds a loop that can select actions, call tools and use the result to choose another action.
The model is only one component. Security depends on the boundaries between data, instructions, identity and authority.
- A request and retrieved content enter the agent context.
- The model proposes an action.
- Policy and identity checks decide whether the tool call is allowed.
- The tool acts on a bounded external system.
- The result becomes data for the next decision.
Foundation vocabulary
- Tokens and context window: the finite input/output sequence the model can consider for one inference.
- RAG: retrieval adds selected external material to context before generation.
- Embeddings and vector databases: numerical representations and stores used to retrieve similar material; similarity is not authority or truth.
- System and user instructions: application-defined and user-provided directions. Their intended priority does not make untrusted content harmless.
- MCP: a protocol through which clients can discover and use server-provided tools and resources. Authentication and authorization remain deployment responsibilities.
Main failure classes
Prompt injection tries to alter intended behaviour through input. Indirect prompt injection arrives inside external data such as a document or webpage. Other risks include sensitive-data disclosure, poisoned data or models, unsafe handling of generated output and excessive agency—too many capabilities, permissions or autonomous steps.
Mini threat model
Choose one imagined agent with email and calendar tools. List the trusted instructions, untrusted data, identities, permissions and irreversible actions. Reduce its authority until it can complete the task but cannot silently expand the task.
Next stepPlace AI after its prerequisitesSee how operating systems, networks, security and identity feed into agent security.