---
title: "What Is a System Prompt?"
description: "A system prompt is the standing instruction that sets an AI model role, rules and behaviour before any user message, shaping how it responds all session."
type: "glossary"
locale: "en"
term: "System Prompt"
canonical: "https://agenticschool.dev/glossary/system-prompt"
dateModified: "2026-06-13"
---

# What Is a System Prompt?

- Definition: System Prompt
- Updated: 2026-06-13
- Keywords: system prompt, what is a system prompt, system prompt definition, system prompt vs user prompt, system prompt examples
- Canonical URL: https://agenticschool.dev/glossary/system-prompt
- Locale: en

> A system prompt is the standing instruction that sets an AI model role, rules and behaviour before any user message, shaping how it responds all session.

A system prompt is the standing instruction given to an AI model before any user message, telling it who it is, how to behave, what rules to follow and what format to use. Where a user prompt is the specific request you type, the system prompt is the persistent context that frames the entire conversation: the model role, tone, constraints and any tools or knowledge it should assume. It is set once by the developer (or by you in a settings file) and applies to every turn until it changes.

## System prompt vs user prompt

The two work together but do different jobs. The system prompt is the configuration; the user prompt is the task. Models are trained to treat the system prompt as higher-priority, standing guidance, so it is where you put rules that should hold no matter what the user asks.

- System prompt: role, rules, tone, format, constraints. Set once, applies throughout.
- User prompt: the specific question or instruction for this turn.
- The model weighs the system prompt as persistent, higher-priority context.

## What goes in a good system prompt

A strong system prompt states the role ("you are a senior TypeScript engineer"), the rules ("never use em dashes", "always run the tests"), the output format you expect, and any context the model should treat as given. Keep it clear and specific; vague system prompts produce vague behaviour. In agent tools, files like a project instructions file act as a system prompt that teaches the agent your conventions.

## System prompts in agents

In an agent harness, the system prompt is part of what the harness assembles every turn, and it counts against the context window, so it should be focused rather than bloated. Subagents take this further: each subagent gets its own short, specialised system prompt tuned to its single task, which is one reason they behave reliably. Because the system prompt is sent on every request, it is also a prime candidate for prompt caching to cut cost.

## FAQ

### What is a system prompt in simple terms?

It is the instruction that sets an AI model role and rules before you start chatting. It tells the model who to be, how to behave and what format to use, and it applies to the whole conversation rather than a single message.

### What is the difference between a system prompt and a user prompt?

The system prompt is the standing configuration (role, rules, tone) set once and applied throughout. The user prompt is the specific request for one turn. Models treat the system prompt as higher-priority, persistent guidance.

### Can I change the system prompt?

Yes, if you are building the app or using a tool that exposes it. In coding agents, project instruction files act as a system prompt you control. In a hosted chat app the system prompt is often fixed by the provider.

### Does the system prompt count toward the context window?

Yes. The system prompt is sent on every request and takes up tokens in the context window, so keep it focused. Because it repeats each turn, it is a good target for prompt caching to reduce cost.
