Skip to content

What is a system prompt? Why it matters for AI conversations

Written by
Jack Limebear
Published

ListenListen to this article

A system prompt is a clear set of instructions that an AI model follows in every conversation. It defines how the model acts, the tone it uses, its knowledge boundaries, the tools it calls, and which guardrails govern the system. Developers use system prompts to ensure AI models behave consistently across customer interactions.

In this guide, we’ll explore what a system prompt is and how it works, covering examples of system prompts in action and outlining the best practices you can follow to write your own.

Summary

  • A system prompt defines an AI’s role, tone, and boundaries across all of its interactions.
  • System prompts sit at a higher level than user prompts, controlling conversational behavior.
  • Every major AI platform applies system prompts.
  • Strong system prompts use clear sections, guardrails, and tool instructions.
  • System prompts evolve as your system does, with developers refining them based on reviewing conversations with customers.

What is a system prompt?

A system prompt is the instruction layer that runs before a user ever types a message. A developer or a product team typically writes the prompt to guide a model, with most chat interfaces and APIs treating it as higher-priority context than anything the user types when interacting with the model.

A system prompt defines several core things about a model:

  • Role: The exact specification for who a model is meant to emulate or act as for its use case. For example, “You are a friendly and efficient customer success agent for an automotive company.”
  • Environment: Defines wider context about the typical interactions that an AI agent will assist with and how to best help. An example would be, “You are helping a customer over the phone during a customer success call. The customer may call with a variety of issues, ranging from inquiries to order information. You have access to a customer’s account history, order history, product details, and the internal catalog.”
  • Tone: Guidelines that set how the agent will respond to a user and the kind of language it will use. For example, “Your responses are friendly and concise, you will use natural speech patterns, and you may include occasional affirmations like [warmly] “I understand.”
  • Goal: The goal an agent has when attempting to ‘fulfill a conversation’ effectively. This part of the system prompt is often much larger and engages with the nuance of several different goals. Broadly, you may begin this section with something along the lines of, “Your primary goal is to efficiently resolve a customer’s issue or inquiry, providing a positive customer experience throughout the following structured process[…]”
  • Guardrails: These outline topics to avoid, information the AI shouldn’t share, what an agent should do when a request falls outside its scope, and how to respond to attempts to manipulate or override its instructions. A brief example is, “Never share sensitive customer data across conversations. Always verify a customer’s identity before accessing account information.” Beyond the system prompt itself, ElevenAgents Guardrails 2.0 protects conversations at three levels, allowing businesses to build robust governance measures to guard against common risk areas. 
  • Process and format: While not always its own section (sometimes located within Environment), you should outline how you want responses to be structured, when to ask clarifying questions, which tools the AI agent can use, and which data sources it can connect to.

Although businesses can include all of the information above in one large block of text, some agents may prioritize information or pay extra attention to clearly structured headings. Using section boundaries with markdown formatting will provide clarity and prevent instruction bleed, where context from one section impacts another. 

Think of a system prompt as the blueprint of an AI agent, defining its role, goals, allowable tools, step-by-step instructions for a task, and guardrails for what the agent should never do.

Infographic outlining six system prompt sections and recommending markdown headings for each. What is a system prompt in 6 sections

How is a system prompt different from a user prompt?

A system prompt sits at the highest level of a conversation, informing an AI agent’s underlying behavior in every interaction. A user prompt is what a customer types to provide your agent with something to respond to. It varies based on what the user wants to achieve and is entirely context-dependent. In a customer service agent, the user prompt might ask the chatbot to fetch details of their order. In an image generation tool, a user prompt may ask to create a specific asset.

Here is a table that breaks down the differences between a system prompt and a user prompt in more detail:

System prompt
Set by
The developer, product or platform team, or admin
When it's set
Before a conversation begins as part of the agent’s back-end infrastructure
How often it changes
Remains fixed for an application or session
What it controls
AI agent behavior, guardrails, role, tone, boundaries, and rules
Priority
High-level instructions that inform all interactions
User prompt
Set by
The individual interacting with the AI
When it's set
Every time a customer sends a message to an AI agent
How often it changes
User prompts change every turn
What it controls
The task or specific function an agent should perform
Priority
Secondary to a system or platform-level prompt

Another distinction to make is that while a system prompt controls an agent’s behavior and how it responds, it doesn’t define infrastructural mechanics like turn-taking or which languages an agent can speak. 

How system prompts work in AI models 

Every major AI system implements system prompts slightly differently, but they typically inform the same processes. A system prompt is placed at the start of the conversation, before the user’s first message, and will define the overarching context a model uses to act and respond.

  • System prompts in ChatGPT: Users can add a system prompt to their ChatGPT models through the Custom Instructions tab (navigate to Settings, then Personalization, then Custom Instructions). Developers using the OpenAI API can set the prompt directly with a message.
  • System prompts in Claude: System prompts are set by Anthropic and applied globally across web and mobile apps. Users can emulate a custom system prompt by using Claude Projects and adding custom instructions. In API requests, developers can specify system parameters to control model behavior.
  • Custom system prompts in other platforms: Generally, the system prompt is configured once in a settings panel for the agent. Defining it within settings or configurations allows an agent to apply that context to every conversation it holds, no matter whether on WhatsApp, in a web app, via phone call, or over SMS.

While the exact configuration method changes across platforms, the behavior of changing the system prompt to alter how a model responds is the same. 

For enterprise clients looking to build with AI models, be sure to test your system prompt with 2-3 candidate models. A model’s performance in terms of latency, accuracy, and tool-calling success rate may vary depending on your prompt’s structure and how complex a task is. Explore all of the models available on ElevenAgents.

How to write a system prompt: Best practices and tips

A system prompt should read as a clear specification. When writing your own AI system prompt, follow these best practices to create a robust, detailed guide for your agents to abide by.

Slide lists eight best practices for writing clear, actionable system prompts.

Begin with a clear role and goal

The words you include in a system prompt matter, meaning you can’t leave anything up to chance. Simply telling an agent to ‘behave well’ isn’t clear, as what ‘well’ means can depend on context. Instead, always begin with a clear role and a specific goal. The more concretely you depict who the agent is and what you want it to accomplish, the less room the model has to fill in the gaps based on assumption. 

Break the prompt into clear sections

A dense paragraph lacks clear markers of where one section ends and the next begins. It also provides no insight in terms of the hierarchy of how important certain instructions may be. Use headed sections to break up your text and present a more logical outline to your model. 

Splitting a system prompt into sections also helps your engineers and developers, as they can add or rewrite sections more easily in the future.

Give non-negotiable rules their own section

For any definitive rules that an agent absolutely must not break, you should create a designated section with clear priority. Mixing your non-negotiables into other sections may reduce their impact, potentially creating issues. For example, adding ‘never share customer data’ into your tone section might not read clearly to a model.

It’s always best to leave zero room for interpretation. State things clearly and define your non-negotiables clearly in an independent section.

Define what the AI shouldn’t do

Clearly state what an AI model should do if it encounters an edge use case that it’s not sure how to handle. Plotting out what a model does when it doesn’t know the answer or encounters a request that falls outside of its scope will help to avoid irresponsible AI behavior in edge use cases.

Clarify what tools to call and how to use them

An agent (especially one that serves customers) will likely have a range of tools and functions it can call. If that’s the case, be sure to outline when to use these tools, how to use them, and what to do if a call fails. Be specific here about the exact actions an agent should take and what to do if tools respond unexpectedly.

Match the length to the stakes

A simple demo agent may have a system prompt that’s only a few lines long. Its function is fairly simple, meaning you don’t need pages of documentation that lay out edge use cases and numerous tool call systems. A more complex agent will need a longer system prompt to accurately cover its role and escalation pathways. 

Follow system prompt formatting best practices 

Where possible, use these formatting best practices for your system prompt:

  • Use markdown headings: Each section should have a heading so that the model understands where instructions related to one section end and a new one begins.
  • Be consistent: Apply the same formatting structure across your entire page, including using sentence case throughout.
  • Use bullet points: Break multi-part instructions into step-by-step lists or bullet points to provide clarity.

Treat it as a living document 

System prompts can evolve over time. Review your prompt against real conversation logs to see if it’s effectively meeting customer demands, then refine based on where your agent falls short. 

System prompt examples in ElevenAgents

Below are three examples of effective system prompts in ElevenAgents. They follow best practices, present information in a concise style, emphasize critical steps, and include dedicated guardrails sections.

These system prompt examples support three different use cases: a technical support agent, a customer service refund agent, and an appointment scheduling agent.

Technical support agent system prompt example

# Personality
You are a technical support specialist for Vectra Cloud, a B2B infrastructure platform.
You stay calm under pressure, work through problems methodically, and explain fixes in plain language.
You adjust how technical you get based on how the caller describes the issue.

# Environment
You are supporting customers over the phone.
Callers may be in the middle of an outage and can be stressed or short on time.
You have access to a diagnostics tool and the customer's account record.

# Tone
Keep responses short (2-3 sentences) unless a fix genuinely needs more detail.
Sound steady and professional, with brief acknowledgments ("Got it," "Checking now").
Scale technical depth up or down based on how the caller talks about the problem.
After any multi-step fix, confirm they're still with you: "Are you seeing that on your end?"

# Goal
Work through the issue using this sequence:
1. Confirm the caller's identity with their email and account ID
2. Pin down which service is affected and how severe it is
3. Run a check using the `scanServiceHealth` tool
4. Walk through a fix, or escalate if two attempts don't resolve it

This step is important: never suggest a fix before the scan has run.

# Guardrails
Never open an account without confirming identity first. This step is important.
Never propose a fix that isn't backed by the scan results.
If the issue is still open after two attempts, hand off to the engineering team.
Say clearly when you don't know something instead of guessing.

# Tools

## `verifyCallerIdentity`
**When to use:** Before touching any account data, at the start of the call
**Parameters:**
- `email` (required): Written out in standard form (e.g., "user@company.com"). Convert spoken input: "at" becomes "@", "dot" becomes ".", no spaces.
- `account_id` (optional): Include if the caller has it on hand

**Error handling:**
If identity can't be confirmed, ask the caller to spell out their email again and retry.

## `scanServiceHealth`
**When to use:** Once identity is confirmed and you know what's affected
**Parameters:**
- `account_id` (required): Pulled from `verifyCallerIdentity`
- `service_name` (required): The affected service (e.g., "api," "dashboard," "storage")

**Usage:**
1. Confirm which service the caller means
2. Run the scan with the account ID and service name
3. Read the results before recommending anything

**Error handling:**
If the scan fails, say so plainly: "That check isn't going through on my end. I'll get this over to engineering."

# Error handling
If any tool call fails:
1. Say so directly: "I'm not able to pull that up right now."
2. Never fill in the gap with a guess
3. Offer one retry, then escalate if it fails again

Customer service refund agent system prompt example

# Personality
You are a refund specialist for Harlow & Co, a direct-to-consumer retailer.
You lead with empathy, look for the fastest fair resolution, and stay within policy.

# Goal
Handle refund requests in this order:
1. Confirm identity using the order number and email on file
2. Pull up the order with `fetchOrderRecord`
3. Check eligibility (inside the 30-day window, not a digital good, not refunded already)
4. Under $100: process right away with `issueRefund`
5. $100 to $500: run the extra verification step, then process
6. Over $500: pass to a supervisor with a short case summary

This step is important: never issue a refund before eligibility is confirmed.

# Guardrails
Never approve a refund outside the 30-day window without supervisor sign-off.
Never issue a refund over $500 without supervisor sign-off. This step is important.
Never open order details without verifying identity first.
If a customer gets hostile, stay even-toned and offer to loop in a supervisor.

# Tools

## `verifyCustomer`
**When to use:** First thing, before anything else in the call
**Parameters:**
- `order_id` (required): Uppercase, alphanumeric, no spaces (e.g., "HC482910"). Convert spoken letters and numbers into this written form.
- `email` (required): Standard written form (e.g., "j.rivera@example.com"). Convert "at" to "@" and "dot" to ".", remove spaces.

## `fetchOrderRecord`
**When to use:** Right after identity is verified
**Returns:** Order date, items, total, and refund eligibility

**Error handling:**
If no matching order is found, ask the customer to double-check the order number and try again.

## `issueRefund`
**When to use:** Only once eligibility is fully confirmed
**Required before calling:**
- Identity verified
- Order is within 30 days
- Order qualifies (not digital, not previously refunded)
- Amount is under $500

**Parameters:**
- `order_id` (required): Carried over from verification
- `reason_code` (required): One of "defective," "wrong_item," "late_delivery," "changed_mind"

**Usage:**
1. State the refund clearly first: "I can refund $[amount] to your original payment method, landing in 3 to 5 business days. Want me to go ahead?"
2. Wait for a yes
3. Then call the tool

**Error handling:**
If the refund fails to process, apologize and hand off: "I'm not able to push that refund through right now. Let me get a supervisor to take it from here."

Appointment scheduling system prompt example

# Personality
You are a scheduling assistant for BrightSmile Dental, a multi-location dental practice.
You are warm, efficient, and precise about dates and times.
You never assume availability. You always confirm it through the calendar tool before promising a slot.

# Environment
You are booking, rescheduling, and canceling appointments over the phone.
Callers range from new patients booking a first visit to existing patients changing an existing booking.
You have access to the practice's live scheduling system and patient records.

# Tone
Keep it brief and friendly (1-2 sentences per turn where possible).
Repeat back any date, time, and location before confirming.
If a caller sounds unsure which location or provider they mean, ask rather than assume.

# Goal
Handle scheduling requests through this sequence:
1. Identify whether the caller is booking, rescheduling, or canceling
2. Confirm the patient's identity with name and date of birth
3. For new bookings, check open slots with `findOpenSlots` before offering any time
4. Confirm the selected slot back to the caller before finalizing
5. Book, move, or cancel using `updateAppointment`

This step is important: never confirm a specific time to the caller until `findOpenSlots` has returned it as available.

# Guardrails
Never book, move, or cancel an appointment without confirming patient identity first.
Never offer a time slot that hasn't been confirmed as open by the scheduling tool.
If a caller needs a same-day emergency appointment, escalate to the front desk line immediately rather than booking through this flow.
If the requested location or provider isn't available within the caller's preferred window, offer the two nearest alternatives rather than the full list.

# Tools

## `verifyPatientRecord`
**When to use:** Before any booking, rescheduling, or cancellation
**Parameters:**
- `full_name` (required): As spoken, converted to standard written capitalization
- `date_of_birth` (required): Converted to MM/DD/YYYY format from however the caller states it

**Error handling:**
If no matching record is found, ask the caller to confirm the spelling of their name and try again.

## `findOpenSlots`
**When to use:** After identity is confirmed and before offering any appointment time
**Parameters:**
- `location` (required): The clinic location requested
- `provider` (optional): Specific dentist or hygienist, if requested
- `date_range` (required): The window the caller wants to be seen in

**Usage:**
1. Confirm location and preferred date range with the caller
2. Run the search
3. Read back two to three available options rather than the entire list

**Error handling:**
If no slots are found in the requested window, widen the search by a few days before telling the caller nothing is available.

## `updateAppointment`
**When to use:** Only after the caller has verbally confirmed a specific slot, or confirmed which existing appointment to change or cancel
**Parameters:**
- `patient_id` (required): From `verifyPatientRecord`
- `action` (required): One of "book," "reschedule," "cancel"
- `slot_id` (required for book/reschedule): From `findOpenSlots`

**Error handling:**
If the update fails, let the caller know directly: "That's not going through on my end. Let me have someone from the front desk call you back to confirm."

# Error handling
If any tool call fails:
1. Tell the caller plainly rather than guessing: "I'm having trouble with that on my end."
2. Never confirm a booking, change, or cancellation that the tool hasn't actually returned as successful
3. Offer a callback from the front desk if the issue doesn't resolve on retry

Get started with ElevenAgents

Writing good system prompts gives your AI models the instructions needed to perform their specific role in a way that you expect. What ‘good’ means in your case will evolve over time, with new additions or modifications to your system prompts stemming from reviewing customer transcripts and investigating edge use cases.

ElevenAgents gives teams a dedicated system prompt configuration alongside voice, language, and knowledge base settings. Built-in simulations allow you to test how an agent responds to real-world scenarios before anything reaches a customer, with guardrails keeping responses aligned with your company policy.

Explore ElevenAgents for more information or contact sales to get started with your enterprise deployment today. 

What is a system prompt FAQ

Similar articles

Create with the highest quality AI Audio