> For the complete documentation index, see [llms.txt](https://docs.patagon.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.patagon.ai/en/agent-optimization/how-to-create-an-ideal-prompt.md).

# How to write a great prompt

Your agent follows exactly what's in the prompt — nothing more, nothing less. A vague prompt generates inconsistent responses and wrong qualifications before you notice anything is wrong.

1. **Define the objective first.** Answer in one sentence: what is the one thing this agent needs to do?
2. **Write the full prompt in the Goals & Tone editor.** There are no separate fields: objective, tone, flow, and restrictions all go in one structured prompt.
3. **Use imperative language.** Write "Ask for monthly revenue" not "The agent may ask about revenue."
4. **Always write both paths.** What happens when the lead qualifies and what happens when they don't. An agent without a disqualification path will improvise.
5. **Test in the Playground before saving.** Go to Agent > Playground and send at least 5 test messages covering: a qualified lead, a lead that does not meet the criteria, an evasive lead, an out-of-scope question, and a prompt injection attempt. Click Clear between scenarios.
6. **Change one thing at a time.** When something breaks after an update, you need to know what caused it.

{% hint style="warning" %}
Do not publish without testing. An agent with an incomplete prompt can disqualify good leads and qualify bad ones — and the error won't be visible immediately.
{% endhint %}

## How to edit your agent's welcome message

Your agent's welcome message is the first thing a lead receives when they start a conversation. It sets the tone for everything that follows — a clear, direct opening message significantly improves engagement rates.

The welcome message is part of your prompt. To edit it:

1. Go to Agent > General and click the Goals & Tone tab.
2. In the editor, find the section that defines the first message or greeting, typically labeled as 'greeting', 'opening message', or 'step 1' in your conversation flow.
3. Edit the text directly in the editor.
4. Test the new message in Agent > Playground before saving.
5. Click Save.

What makes a good welcome message: uses the lead's name if available, states clearly who the agent is and what it can help with, asks one focused opening question, and matches the language and tone of your target audience.

{% hint style="warning" %}
Don't change the welcome message and other prompt sections at the same time. If engagement drops after an update, you need to know which change caused it.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.patagon.ai/en/agent-optimization/how-to-create-an-ideal-prompt.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
