Skip to main content
Cloud & AI Hub
Browse
Glossary AI Directory Playgrounds Models Prompts Explainers Strategy Matrix Benchmark Decoder

System Prompt

A high-priority context block defining the behavior, constraints, and operational persona of a language model.

Last reviewed: July 25, 2026

A system prompt is a block of instructions provided to a language model separately from the user’s message, establishing the model’s persona, behavioral constraints, and operational context before any actual conversation begins. Most chat-based LLM APIs (OpenAI, Anthropic, and others) expose a dedicated “system” role distinct from “user” and “assistant” messages specifically so that application developers can set this context once, consistently, across every conversation their application handles.

What Goes in a System Prompt

A typical system prompt establishes the assistant’s role (“You are a customer support agent for an airline”), tone and style guidelines, formatting requirements (respond in Markdown, always include a citation), and hard constraints (never disclose internal pricing, never make legal commitments on the company’s behalf). It’s the primary mechanism application developers use to shape a general-purpose model’s behavior into a specific product experience without fine-tuning.

System Prompts and Security

Because system prompts often carry a business’s actual operational logic and constraints, they’ve become a security-relevant asset: models are generally trained to give system-role instructions higher priority than user-role instructions, which is what allows a system prompt to establish guardrails a user can’t simply override by asking. However, this priority isn’t absolute — prompt injection attacks specifically attempt to convince a model to disregard its system prompt instructions, which is why security-conscious applications treat the system prompt as a first line of defense rather than an unbreakable guarantee, and pair it with additional output validation for high-stakes use cases.

System Prompts and Prompt Caching

Because a system prompt is typically identical across many requests within an application, it’s a natural target for prompt caching — a feature offered by most major LLM API providers that lets a fixed prefix of a prompt (like a system prompt or a long set of instructions) be processed once and reused across subsequent requests, at a substantially discounted cost compared to processing the same tokens fresh every time. This makes system prompt design not just a behavioral decision but a cost-relevant one: consolidating stable, reusable instructions into the system prompt (rather than repeating them inside every user message) can meaningfully reduce API costs at scale, since the cached portion benefits from caching discounts while only the actual variable user input is processed at full price.

Some providers also distinguish a related but stricter concept, the developer message or instruction hierarchy, which sits above the system prompt in trust priority specifically to help defend against injection attempts that try to impersonate system-level instructions from within user-supplied content.

Advertisement (In-Content)

Historical figures and technical concepts for informational purposes only. Not technical, professional, legal, or financial advice. Sources: Official Documentation.