← All resources

Building Agents

How to Write an Agent System Prompt

Design instructions that define purpose, boundaries, tool behavior, and escalation without becoming brittle.

Define the operating role

State the agent's job, intended users, and concrete definition of success. A narrow role helps the model prioritize relevant actions when several paths look plausible.

Separate policy from procedure

Policies describe constraints that always apply; procedures describe a preferred way to work. Keep critical security controls in code even when the prompt explains them.

Specify uncertainty behavior

Tell the agent when to ask, verify, refuse, or escalate. Examples of borderline cases are often more useful than long lists of abstract rules.