System Prompt
Top-of-context instructions that define an agent's role, behavior, constraints, and output format, sent on every API call.
Last updated: April 26, 2026
Definition
The system prompt is the part of the LLM input that defines persistent agent behavior. It typically includes: role and identity ("you are a customer support agent for Acme"), capabilities ("you can look up orders and process refunds under $50"), constraints ("never disclose internal pricing rules"), output format ("respond in JSON with these fields"), and tone ("friendly and concise"). System prompts are sent on every call and are usually the most-cached part of the context (via prompt caching). They are the single biggest lever for shaping agent behavior, and the discipline of writing them is what context engineering replaced "prompt engineering" with.
Good production system prompts share three properties. First, they are specific: "respond in JSON with fields {orderId, status, refundAmount}" beats "respond in a structured format." Second, they are short: under 1500 tokens for most agents. Long prompts dilute attention and increase latency. Third, they include negative examples of what not to do, which the model often follows more reliably than positive instructions. Cache the system prompt aggressively (Anthropic prompt caching cuts cached input cost by 90 percent), since it is sent unchanged on every call.
When To Use
Every agent has a system prompt, even if minimal. Write it explicitly, version it like code, test it like code.
Building with System Prompt?
I've shipped this pattern in real production systems. If you want a second pair of eyes on your architecture, that's what I do.