System Prompt
A System Prompt is a set of high-level instructions provided to a large language model (LLM) before the user's input. It establishes the context, persona, constraints, and rules that the AI must adhere to throughout the entire conversation or task. Unlike a standard user prompt, which asks a question, the system prompt dictates how the AI should behave while answering.
The system prompt is the foundational layer of AI interaction. It moves the LLM from a general-purpose chatbot to a specialized tool. By defining the role (e.g., 'You are a senior financial analyst'), the tone (e.g., 'Maintain a highly formal and objective tone'), and the output format (e.g., 'Always respond in JSON format'), you ensure predictable and reliable outputs, which is critical for integrating AI into business workflows.
When an API call is made to an LLM, the system prompt is often passed in a dedicated 'system' role message. The model processes this instruction first, internalizing it as its operational directive. Subsequent user inputs are then processed through the lens of the system prompt. If the system prompt dictates brevity, the model will prioritize conciseness, even if the user prompt is verbose.
This concept is closely related to 'Few-Shot Learning' (providing examples within the prompt) and 'Guardrail Implementation' (the technical enforcement of safety rules).