System prompt
A system prompt is the initial instruction given to an LLM at the start of a session that sets behaviour, persona, output format, and constraints — distinct from user messages that follow. The system prompt is the primary mechanism for steering an LLM toward a specific use case without fine-tuning.
System prompts are the highest-leverage knob in production LLM applications. A well-designed system prompt: states the role precisely ('You are a code-review assistant'), defines the output format ('respond in JSON matching this schema'), enumerates constraints ('never recommend libraries not in our allowlist'), includes few-shot examples for unusual tasks, and uses structural tags (XML, markdown) to organise sections. The discipline is closer to product design than to engineering: iterate, measure, refine. Production prompts often span hundreds or thousands of tokens; the investment pays back across millions of inferences.
Related terms
- Prompt engineering for software teams
Prompt engineering for software teams is the discipline of writing prompts that consistently produce useful output from LLMs in engineering workflows — code generation, test authoring, PR review, technical writing.
- Few-shot prompting
Few-shot prompting provides the model with example input-output pairs in the prompt to demonstrate the desired pattern before asking it to handle the actual input.
- Structured output
Structured output is the LLM feature that guarantees the response matches a provided schema (JSON Schema, Zod, Pydantic) — eliminating the parsing failures and format drift that plagued early LLM applications.