What is System Prompt?
System Prompt — The foundational instructions given to an AI model that define its persona, constraints, and overarching goals.
System prompts set the behavior, personality, and constraints for an AI model. They run before every user interaction and establish rules the model should follow. Well-crafted system prompts dramatically improve output consistency and safety in production applications.
Frequently Asked Questions
What should a system prompt include?
The AI’s role and persona, behavioral constraints, output format requirements, topics to avoid, and instructions for handling edge cases. Be specific and explicit.
Can users override system prompts?
They can attempt to through prompt injection. Defense strategies include instruction hierarchy (system > user), input validation, and output filtering to enforce system prompt rules.
How long should a system prompt be?
As concise as possible while covering all necessary instructions. Typical production system prompts range from 200 to 2,000 tokens. Longer prompts increase cost and may dilute important instructions.