Home › Learn › AI Agents
AI Agents

What is System prompt?

The standing instruction you give a model on every call that sets its role, rules, and constraints — separate from the per-turn user message.

How it works

Unlike the conversation, the system prompt persists across turns and frames how the model behaves. It's where you put persona, hard rules, and output format. A vague system prompt is the most common cause of an agent that drifts or ignores instructions.

Example

In practiceYou set a system prompt telling a coding agent to always explain its reasoning before writing code and never modify files outside the project directory.

System prompt or first user message?

Use the system prompt for persistent rules and role; use the user turn for the actual task. Rules in a user message get forgotten as history grows.

Go deeper: Deploy Your First AI Agent

The complete, step-by-step guide — every command, config, and the reasoning behind it.

Get the guide