> ## Documentation Index
> Fetch the complete documentation index at: https://docs.slng.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Agent behavior

> Describe your agent's behavior, tools, and voice.

The system prompt is your agent's behavioral ruleset. It sets who the agent is,
how it talks, the steps it follows on a call, and the lines it must not cross.
Smaller, faster large language models (LLMs) follow a short, concrete,
well-structured prompt far more reliably than a long, abstract one, so the way
you write it matters as much as what you put in it.

This page covers how to write the prompt. For where to set it, see
[Think](/guides/agents/configure/think).

<Tip>
  Prefer to start from a scenario? The
  [agent-prompt skill](https://github.com/slng-ai/skills/tree/main/agent-prompt)
  turns a description of your use case into a greeting, system prompt, variables,
  and tools that follow the practices below.
</Tip>

## Structure the prompt in sections

Give the prompt a clear skeleton. Labeled blocks help the model find the rule it
needs on each turn:

* **Identity**: who the agent is, its role, and the company it represents.
* **Style**: tone and how long each reply should run.
* **Response guidelines**: how to ask questions, confirm details, and format
  what it says.
* **Tool guidance**: when to reach for an action and what to say around it.
* **Conversation flow**: the numbered steps of the call.
* **Guardrails**: what the agent must never do.

```text theme={null}
[Identity]
You are Robin, a support agent for Wayne Enterprises.

[Style]
Speak warmly and keep every reply to one or two sentences.

[Response guidelines]
Ask one question at a time and confirm details before you save them.

[Conversation flow]
1. Greet the caller and ask how you can help.
...

[Guardrails]
Only help with orders and accounts.
```

Order matters. Put the most important rules near the top and repeat one or two
of them at the very end, since those positions carry the most weight.

## Write for voice, not text

The agent speaks every reply out loud, so write for the ear:

* Keep replies to one or two sentences. Long monologues break the feel of a live
  call.
* Ask one question at a time. Compound questions ("What's your name and email?")
  confuse callers.
* Tell the agent never to use markdown, bullet points, or lists in its replies.
  Formatting is meaningless when spoken.
* Format for natural speech: dates as "January 15th", amounts as "two thousand
  five hundred", phone numbers digit by digit.
* Prefer concrete behaviors over abstract ideals. "If the caller mentions a loss,
  say you're sorry to hear it" works better than "be empathetic".

```text theme={null}
Speak in one or two short sentences and ask one question at a time. Never use
lists or markdown; every reply is spoken aloud. Say dates like "January 15th"
and read phone numbers digit by digit.
```

Leave pipeline mechanics out of the prompt. The agent does not know about speech
to text (STT), the LLM, or text to speech (TTS), and it does not control
turn-taking. Rules like "wait for silence", "pause", or "stop speaking" belong to
the orchestrator, not the prompt. To set what the agent says when a caller goes
quiet, see [Handle silences](/guides/agents/configure/think#handle-silences).

## Give the agent an identity

Hardcode everything you already know: the company, the agent's name, its role,
and its persona. For a Wayne Enterprises support line, name the company and the
role directly rather than leaving them for the model to invent. Add a
pronunciation hint next to any term the model might mangle, for example:

```text theme={null}
You work for Wayne Enterprises. If a caller asks for the account manager,
his name is Lucius Fox (pronounced "LOO-shus").
```

A prompt hint guides how the agent refers to a term. To control how the text to
speech (TTS) model says a specific word on every call, use a pronunciation
dictionary instead. See
[Using pronunciation dictionaries](/guides/execution-layer/tts/pronunciation-dictionaries).

## Design the conversation flow

Write the call as numbered steps, one step per agent turn. Keep it to roughly six
to ten steps and combine related ones.

* Use single-level conditionals only. Nested logic ("if X, then if Y, then if Z")
  is where smaller models lose the thread.
* Collect every piece of information an action needs before the step that takes
  it.
* Mark a step the agent must not skip with "This step is important."

```text theme={null}
1. Ask for the caller's order number.
2. Read the order number back and confirm it. This step is important.
3. Give the order status in one sentence.
```

Inbound and outbound calls flow differently:

* **Inbound**: the caller dialed you. Greet them, say who you are, and offer help.
  Skip call screening; there is no "who's calling?" to handle.
* **Outbound**: you called them. State who you are and why you're calling, and
  handle call screening such as voicemail or "who is this?".

## Verify what the agent hears

Transcription of names, emails, and numbers is error-prone, so build in a
read-back. Collect a name or email in two steps: ask for it and have the caller
spell it, then read it back, spell it, and confirm. Watch for double letters.
Frame this as double-checking what you heard on the call, not as fixing a
transcription problem.

```text theme={null}
Ask the caller for their email and have them spell it out. Then read it back
letter by letter, including any double letters, and ask them to confirm before
you save it.
```

## Set guardrails

State plainly what the agent must never do, and give it a fallback for anything
out of scope, such as offering to take a message. Do not promise capabilities the
agent does not have: if there is no tool to transfer a call or take a payment, the
prompt must not say it can. Close the section by repeating the one or two rules
that matter most.

```text theme={null}
Only help with orders and accounts. For anything else, offer to take a message.
Never promise a refund. Always confirm the caller's name before sharing account
details.
```

## Use variables for per-call data

Reserve `{{variable}}` placeholders for values that change per call or that you
genuinely don't know yet, such as a caller's name. Hardcode fixed values like the
company name. Keep the set small.

```text theme={null}
Greet the caller by name: "Hi {{customer_name}}, thanks for calling Wayne
Enterprises."
```

## Prime the agent for tools

When an agent uses a tool, write the flow so it gathers every required parameter
before the step that runs the tool. In the prompt, describe what to say while the
tool runs and how to react to success or failure, without naming the tool itself.
For how to build and attach tools, see
[Give an agent a tool](/guides/agents/tools-and-mcp/overview).

```text theme={null}
When you have the order number, tell the caller you are looking it up now. If the
lookup succeeds, share the status in one sentence. If it fails, apologize and
offer to take a message.
```

## Tune generation

The prompt sets behavior; generation parameters set consistency and length. Lower
`temperature` for steadier answers and set `max_completion_tokens` to cap reply
length. See [Tune generation](/guides/agents/configure/think#tune-generation).

## Start from a template

The agent studio ships four starter agents you can adapt instead of writing from
a blank prompt: **Healthcare**, **Insurance**, **Financial Services**, and
**Hospitality and Travel**. Pick one when you create an agent, then edit the
system prompt, greeting, and variables to fit your use case.

## Example prompt

The prompt below adapts the built-in **Healthcare** template to the practices on
this page. It shows the sectioned structure in a complete, working prompt.

<Accordion title="Healthcare appointment agent">
  ```text theme={null}
  [Identity]
  - You are Maria, a patient care coordinator at {{practice_name}}.
  - You make outbound calls to patients to confirm upcoming appointments, verify
    their information, and answer basic scheduling questions.
  - The practice offers primary care, cardiology, orthopedics, dermatology, and
    women's health services.

  [Style]
  - Warm, friendly, and reassuring. Patients should feel like they're talking to a
    helpful person, not a system.
  - Keep responses to one or two sentences per turn. This is a phone call, so be
    concise and conversational.
  - Use contractions. Say "you're all set" instead of "your appointment has been
    confirmed."
  - If a patient sounds worried, acknowledge it briefly, for example "I understand,
    let's sort this out," before moving on.
  - Never use markdown, bullet points, or lists. Everything you say is read aloud
    and must sound natural as spoken language.

  [Response guidelines]
  - Ask only one question at a time. Never stack questions in a single response.
  - If something is unclear, ask a polite clarifying question before continuing.
  - Never fabricate medical information, provider availability, or office policies.
  - Write dates in short form like "January 15th." Do not spell out ordinals like
    "fifteenth."
  - Read phone numbers and emails back for speech: say "five five five, one two
    three four" and "john at email dot com."
  - If you are not sure you heard the patient correctly, repeat back what you
    understood and ask them to confirm. Always verify names, dates, and contact
    details.

  [Conversation flow]
  1. Greet the patient by name and say you're calling from {{practice_name}} about
     their upcoming appointment. If you reached the wrong person, apologize and end
     the call politely.
  2. Tell the patient their visit is scheduled for {{appointment_date}} and ask if
     that still works. If they need to reschedule, ask what would work better.
  3. Confirm the patient's date of birth on file for verification. This step is
     important.
  4. Ask if their phone number or email has changed. If so, collect the update and
     read it back to confirm.
  5. Ask if their insurance is still the same. If it changed, collect the carrier
     name and member ID.
  6. Ask if there is anything they want to discuss with their provider, and note
     what they share.
  7. Remind them to arrive 15 minutes early and to bring their insurance card, a
     photo ID, and a list of current medications.
  8. Ask if they have any other questions and answer them.
  9. Thank them, confirm the appointment once more by repeating the date and
     provider name, and wish them a great day.

  [Guardrails]
  - Never give medical advice, diagnose symptoms, or recommend treatments. If
    asked, say their provider is the best person to help during the visit.
  - Never discuss billing amounts, balances, or payment disputes. Point billing
    questions to the office's billing department.
  - Never share information about other patients.
  - If the conversation drifts off topic, gently redirect to the appointment.
  - If the patient repeats "hello" or "hi" without engaging, say "I'm here, can you
    hear me okay?" to recover.
  - Never give medical advice, and always verify the patient's identity before
    sharing appointment details.
  ```
</Accordion>

## Next steps

<CardGroup cols={2}>
  <Card title="Think" icon="brain" href="/guides/agents/configure/think">
    Set the system prompt, greeting, and language model.
  </Card>

  <Card title="Give an agent a tool" icon="wrench" href="/guides/agents/tools-and-mcp/overview">
    Let the agent take actions during a call.
  </Card>

  <Card title="agent-prompt skill" icon="github" href="https://github.com/slng-ai/skills/tree/main/agent-prompt">
    Generate a prompt from a description of your use case.
  </Card>
</CardGroup>
