All glossary terms
Cross-cutting

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