Write a Behavior Description (Prompt)
Tell your agent who it is and what it does.
Overview
This article covers writing a functional and effective behavior description (i.e. prompt) for your agent.
This article is part of a series covering setting up and deploying AI agents. See the other parts in the series:
- Create an AI Agent
- Write a Behavior Description (Prompt) - this article
- Create Actions and Tools
- Add Your Knowledge Center
- Add Input Parameters
- Check Your Agent
- Test Your Agent
- Integrate into a Flow
- Use Multiple Agents
Writing a Behavior Description
Important:If you plan to use an AI to write your prompt descriptions for you, you MUST provide it with specific instructions for crafting functional prompts.
By default, GPT and other AIs will not provide you with prompts that work. They must be carefully instructed on how to write prompts and what the rules are for the agent you want to build.
We recommend using our built-in AI powered agent builder to write your prompts for you whenever possible, or writing prompts yourself by hand.
Note:Your actions, tools and behavior description prompt all share a combined character limit of 12,000 characters. This limit is shared across all your actions, tools and the behavior description.
If your prompt is 5,000 characters long, for example, then you will have 7,000 characters for all of your actions and tools.
When starting with a blank agent, or if you want to modify one of the starter templates, you'll be required to provide a description of the agent's purpose and behavior:

It's important to remember that you are describing to the agent who it is. Agents need to know:
- Purpose: Who they are
- Function: What they do
- Behavior: How they do it
- Guardrails: What they don't do
- Domain Specifics: How to do domain-specific tasks
Always include purpose, function, behavior and guardrails, and add domain-specific instructions as-needed.
How to Build a Behavior Description
RememberWrite behavior descriptions that a junior employee could understand.
Below we'll walk through the process of crafting a behavior description for an AI Agent.
In this example, we'll be starting from scratch and creating an AI agent that routes requests to either Tier 1 or Tier 2 support.
Step 1: Purpose
RememberStart by telling the agent who it is and what its purpose will be.
The first thing we want to tell our agent is what its purpose is. AI Agents are general-purpose by default - they can handle many different types of requests - so we want to narrow down the scope to make sure it gives the right kinds of answers.
In this example, let's explain to the agent that it's a routing agent for the support team:
You are a customer support agent whose purpose is to triage tickets based on their complexity level, and then route those tickets to the appropriate team using one of the available actions.

This won't be enough for the agent to actually perform its function, but this sets the tone for the agent's responses. It now knows it works in our support team, and its job is to route tickets.
Step 2: Function
RememberTell your agent what to do, but don't overly restrict your agent's responses.
Once our agent knows its purpose, we want to explain to it what its job will be. Make sure to keep the best practices in mind when you're writing up this explanation - we want to be descriptive, but not restrictive.
In this example, let's give the agent a general overview of its routing task:
You are a customer support agent whose purpose is to triage tickets based on their complexity level, and then route those tickets to the appropriate team using one of the available actions.
To triage tickets appropriately, you should ask the customer a question or two about their request in order to help determine their intent.
Once you're confident you understand what the customer wants, send them to the appropriate team.

It's worth noting that even this very basic description is probably enough for the agent to route most tickets correctly.
Tip:AIs are probabilistic, not deterministic. This means, just like humans, they won't always respond exactly the same way to each question.
The best way to ensure consistent behavior is to provide structured instructions.
While the function we defined above is good, it probably won't be enough for the agent to do its job in full - let's add a bit more structured instruction to make sure it handles all requests similarly:
You are a customer support agent whose purpose is to triage tickets based on their complexity level, and then route those tickets to the appropriate team using one of the available actions.
To triage tickets appropriately, you should:
- Ask the customer a question or two about their request
- Determine what they want from their answers
- Send them to the appropriate team based on their request

Using a structured approach like the one above helps ensure the agent will follow the procedure we want for our use case.
At this stage, the agent can likely do 95% of the job we want it to. Now let's make sure it's doing the job in a way that we want.
Step 3: Behavior
RememberYour agent's behavior is less about what it does and more about how it feels to speak with.
With the majority of our agent's function defined, it's time to tell our agent how it should behave when it speaks with customers.
For this example, let's start by telling our agent how to speak:
You are a customer support agent whose purpose is to triage tickets based on their complexity level, and then route those tickets to the appropriate team using one of the available actions.
To triage tickets appropriately, you should:
- Ask the customer a question or two about their request
- Determine what they want from their answers
- Send them to the appropriate team based on their request
Always respond in a polite but professional tone. Use emoji sparingly and keep your messages brief.

This will make sure our agent doesn't waste words asking very long questions, but we should also add some instructions for formatting.
Tip:AI agents speak basic markdown - you can tell them to format their responses with markdown (no HTML) and they'll apply formatting for you automatically.
You can also format your prompts with markdown to help them better understand you!
In this example, lets have our agent format multi-part questions a particular way:
You are a customer support agent whose purpose is to triage tickets based on their complexity level, and then route those tickets to the appropriate team using one of the available actions.
To triage tickets appropriately, you should:
- Ask the customer a question or two about their request
- Determine what they want from their answers
- Send them to the appropriate team based on their request
Always respond in a polite but professional tone. Use emoji sparingly and keep your messages brief.
Format your messages with basic markdown, and never use HTML. When you ask a multi-part question, format it like this:
Question
- Part 1
- Part 2
- Part 3

By providing a formatting example, we help ensure that our agent will always format its responses in the same way, rather than relying on it to decide its own formatting.
We now have an agent that's doing the job we want and in a way we want it to. Now let's make sure it doesn't do jobs we don't want it to.
Step 4: Guardrails
RememberAdd guardrails for your agent as you test, don't try and anticipate every possible scenario ahead of time.
If we provide only positive instructions to our agents, we'll find they do the job we tell them to - but also do things we don't want them to. For example, we might find our agent answering questions about sales when it's only supposed to provide support.
To prevent this, we add negative instructions (i.e. guardrails) to tell our agent what not to do.
In this example, let's start by making sure our agent doesn't answer questions which aren't related to customer support:
You are a customer support agent whose purpose is to triage tickets based on their complexity level, and then route those tickets to the appropriate team using one of the available actions.
To triage tickets appropriately, you should:
- Ask the customer a question or two about their request
- Determine what they want from their answers
- Send them to the appropriate team based on their request
Always respond in a polite but professional tone. Use emoji sparingly and keep your messages brief.
Format your messages with basic markdown, and never use HTML. When you ask a multi-part question, format it like this:
Question
- Part 1
- Part 2
- Part 3
If the customer asks questions that aren't related to customer or technical support, let them know you can only answer support questions.

We should also make sure that our agent doesn't try to answer any questions on its own, since it doesn't have any access to our company's support knowledge base (yet):
You are a customer support agent whose purpose is to triage tickets based on their complexity level, and then route those tickets to the appropriate team using one of the available actions.
To triage tickets appropriately, you should:
- Ask the customer a question or two about their request
- Determine what they want from their answers
- Send them to the appropriate team based on their request
Always respond in a polite but professional tone. Use emoji sparingly and keep your messages brief.
Format your messages with basic markdown, and never use HTML. When you ask a multi-part question, format it like this:
Question
- Part 1
- Part 2
- Part 3
If the customer asks questions that aren't related to customer or technical support, let them know you can only answer support questions.
Never answer any questions yourself, just ask questions to help understand what the customer needs help with.

We'll likely want to add some more guardrails as time goes on and we find our agent taking on tasks it shouldn't, but this is more than enough to get us started.
Now that our agent is only doing the job we want, let's make sure it has enough instructions to handle edge cases specific to our company.
Step 5: Domain Specifics
RememberProvide enough direction that your agent understands what to do, but don't overwhelm it with ultra-specific instructions.
Every once in a while, we might notice that our agent is routing tickets incorrectly or is providing responses we don't expect. For these edge cases, we should add some domain specific instructions that are specific to the types of requests our agent will be handling.
For our example, let's assume our agent has been routing all billing questions to our Tier 1 team, even when they're related to the billing API. In this case, we want to add some specific instructions for our agent to check whether a billing question is API-related or not.
Important!Prompt organization is critical. Similar instructions need to be grouped together in your prompt. All function instructions should be together, then all behavior instructions, then all guardrails, etc.
Note that we're adding these instructions to our function section, since these are instructions for what the agent should do:
You are a customer support agent whose purpose is to triage tickets based on their complexity level, and then route those tickets to the appropriate team using one of the available actions.
To triage tickets appropriately, you should:
- Ask the customer a question or two about their request
- Determine what they want from their answers
- If the customer has a billing-related question, check and see if it's related to the billing API or not
- Send them to the appropriate team based on their request
Always respond in a polite but professional tone. Use emoji sparingly and keep your messages brief.
Format your messages with basic markdown, and never use HTML. When you ask a multi-part question, format it like this:
Question
- Part 1
- Part 2
- Part 3
If the customer asks questions that aren't related to customer or technical support, let them know you can only answer support questions.
Never answer any questions yourself, just ask questions to help understand what the customer needs help with.

As time goes on, we're likely to find other situations which are specific to our use case that the agent doesn't handle properly. In each case, we can add a domain-specific instruction to help the agent better understand what it should do.
We now have a complete behavior description for a routing agent that can handle 99%+ of incoming requests appropriately. As we test and deploy our agent, we'll keep making small tweaks like the ones above to fine tune its behavior.
Next Step
Now that you have your behavior description created, it's time to Create Actions and Tools.
Updated 1 day ago