2 Instructions in AI agents
This chapter covers
- Instructions as high-level directives for agents' behavior
- System prompts as the initial instruction layer
- Agent skills as modular, reusable expertise packages
- Instruction artifacts as project-specific guidance
Chapter 1 introduced context engineering and the six sources of context that shape agents' behavior. This chapter focuses on the first of these sources: instructions, which establish the rules, constraints, and behavioral expectations under which a model operates. Every interaction with an LLM-based system is interpreted in the presence of one or more instruction layers. Instructions are delivered through different mechanisms in AI agents, including the system prompt, agent skills, and instruction artifacts.
2.1 Instructions
Instructions are the foundational source of context in LLM-based systems that define the model’s operating role, behavioral expectations, safety boundaries, formatting obligations, and policies across a conversation, session, or task run. A useful way to view instructions is as an operating contract between an application and the model. The contract tells the model how to interpret later context, how to resolve routine choices, and which boundaries remain in force even when a user asks for something different. Instructions frame user intent so the model can satisfy valid requests while remaining aligned with the application, organization, and product environment [10].