System Prompt
A set of instructions provided to a language model before the user's message that defines the model's persona, constraints, and behavioral rules for the entire conversation.
A system prompt is the set of instructions a model receives before it ever sees a user message. It defines persona, tone, formatting rules, constraint boundaries, and how the model should handle things it doesn't know. It's the product's constitution — the document that governs every interaction.
This is the cheapest, most powerful lever for shaping model behavior in production. Before you fine-tune or build retrieval pipelines, get the system prompt right. A strong prompt enforces formatting, reduces hallucination outside defined scope, establishes brand voice, and cuts the need for downstream guardrails. A weak one gives you a generic chatbot that drifts and makes things up.
Length is a genuine tradeoff. Longer prompts consume context window budget, increase latency, and add cost per request. The best prompts are as short as possible while remaining unambiguous — with explicit edge cases handled and minimal examples that actually carry weight.
System prompts are also the primary target of prompt injection attacks. They are necessary but not sufficient for safety. You still need architectural defenses that validate inputs and outputs independently of what the model was told, because a model can be instructed to ignore its own instructions. The best teams treat system prompts like code: versioned, tested with evals, reviewed in PRs, and iterated continuously. If yours lives in a spreadsheet or someone's head, that's the problem to fix first.