The practical definition
A system prompt is the highest-priority instruction supplied by an application to shape how a model should behave. It commonly defines the role, safety boundaries, tools, audience, and response style.
What belongs in it
Put stable behavior in the system layer: identity, non-negotiable constraints, evidence rules, and recurring output conventions. Put the changing task, source material, and user-specific variables in the user prompt.
A reliable structure
Write the role first, then the objective, boundaries, evidence policy, and response contract. Resolve contradictions explicitly. Keep business rules in application code when they must be enforced rather than merely requested.
How to evaluate it
Run a fixed set of normal, ambiguous, and adversarial inputs. Check instruction priority, refusals, format consistency, and whether sensitive configuration is exposed. Record the model and date because behavior changes.
Worked example
Reusable instruction:
You summarize support tickets. Use only the supplied ticket. Do not invent a resolution.
Task message:
Ticket: A customer reports that checkout stops after entering a coupon.
Return: issue, missing information, next diagnostic question.How to check the result
Check whether the product actually supports a persistent instruction field. Test an incomplete ticket and a ticket containing conflicting instructions. The desired answer should identify missing facts rather than invent a cause.