chapter two

2 Instructions for AI agents

 

This chapter covers

  • Instructions as high-level directives that shape model 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 context sources that LLM-based systems supply to the model. This chapter focuses on the first of those 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 context source in LLM-based systems. They define the model’s role, behavioral expectations, safety boundaries, formatting requirements, and policies across a conversation, session, or task run. Instructions provide the operating rules for the LLM-based system that deploys the model. They tell the model how to interpret subsequent context, how to handle routine choices, and which boundaries remain in force even when a user asks for something different. Instructions frame user intent so that the model can satisfy valid requests while following the intended task, organizational policies, and operational constraints [14].

2.2 The system prompt

2.2.1 Content of the system prompt

2.2.2 System prompts in products and APIs

2.3 Agent skills

2.3.1 The anatomy of a skill

2.3.2 Best practices for designing agent skills

2.4 Instruction artifacts

2.4.1 Instruction artifacts in coding agents

2.4.2 Best practices for designing instruction artifacts

2.5 Hands-on

2.5.1 Using system prompts

2.5.2 Creating custom agent skills

2.5.3 Using existing agent skills

2.5.4 Creating custom instruction artifacts

2.6 Summary