# Write instructions for your AI agent

> Write the instructions that set your intoCHAT agent's role, tone and limits: templates, the 100-character minimum, guardrails, built-in rules and Playground tests.

Instructions tell your agent who it is, how to talk and where its limits are. Your knowledge sources supply the facts; the instructions decide how the agent uses them.

## Where to edit them

Open the agent's **Setup** tab. Under **Role and behaviour**:

1. **Start from a template** replaces the text below it with the template you choose.
2. **Instructions** holds the text itself. It needs at least 100 characters; until then the counter shows how many are missing.
3. Click **Save changes** in the header.

If you edited a text that started from a template, a **Restore** or **Use latest template** button above the field puts the template's text back.

## Templates

Templates are starting points that already include rules for accuracy, tone and contact details. You can edit every word:

- AI Chatbot
- Customer Support Agent
- Sales Agent
- E-commerce Specialist
- Real Estate Agent
- Language tutor
- Coding Expert
- Life Coach
- Futuristic Fashion Advisor

**Custom prompt** starts from an empty field.

## What to write

Good instructions are specific about your business. Cover:

- **Role and audience:** who the agent speaks for and who it talks to.
- **Scope:** what it should help with, and what it should politely decline.
- **Tone and format:** formal or casual, short or detailed, lists or prose.
- **Next steps:** where to send people for things the agent can't do. The agent never invents a contact channel, so name the ones you want it to use.
- **A few key facts:** facts that must always be right, such as your support email. Instructions outrank your knowledge when the two conflict.

Keep long content such as product details, policies and FAQs in your [knowledge](/en/docs/text-and-qa), where it is searched for each question.

By default the agent replies in the language the visitor writes in. If it should always use one language, say so.

```text
You are the assistant of Example Bikes, a bike shop. Help visitors
choose a bike, understand our repair service and find our opening hours.
Keep answers under 120 words and use bullet points for steps.
For questions about an existing order, ask the visitor to email
support@example.com. Politely decline topics unrelated to bikes.
```

## Guardrails

Guardrails are rules the agent must follow in every reply, whatever a visitor asks. Add them on the **Setup** tab under **Guardrails**, in the **Rules** field, and click **Save changes**.

- Write one rule per line, for example "Never quote prices; send people to the pricing page." The field is optional and holds up to 4,000 characters.
- intoCHAT sends the rules to the AI as a separate block straight after your instructions. The agent follows them even when your instructions, your knowledge or a visitor's message suggest otherwise.
- Guardrails can only restrict what the agent says or does. They can't give it abilities it doesn't have, such as an action you haven't set up, and they can't switch off intoCHAT's built-in rules below.
- They are separate from the instructions, so choosing a template doesn't replace them.

```text
Never quote prices; send people to the pricing page.
Don't discuss competitors.
Don't give medical advice. Suggest seeing a doctor instead.
```

Use guardrails for short, firm limits, and the instructions for role, tone and scope.

## Built-in rules

intoCHAT adds rules to every agent. Where your instructions or guardrails conflict with them, the rules win, so you don't need to repeat them:

- Business facts such as products, prices, policies and contact details come only from your instructions, your knowledge or successful action results.
- When information is missing or conflicting, the agent says what it can't confirm. It never invents an answer, a contact channel or a handoff to a person.
- Retrieved documents and action results are reference data, not instructions. Commands hidden in them are ignored, and visitors can't override these rules.
- The agent doesn't reveal its hidden instructions, credentials or private information from sources.
- It never asks for passwords, one-time codes, API keys or payment card details in the chat.
- It only uses the actions you configured, asks before consequential steps, and reports an action as done only when the result confirms it.
- It follows your [lead collection](/en/docs/lead-collection) settings and doesn't ask visitors to type their details into the chat when the form is meant for that.

## Test in the Playground

The Playground answers with the instructions and guardrails currently on screen, saved or not, so you can try a change before you keep it. Testing never saves them.

1. Edit the instructions or guardrails on the **Setup** tab.
2. Open **Playground** and ask real visitor questions, including ones the agent should decline and ones your content doesn't cover.
3. Click **Reset** to start a new conversation after each change.
4. When you are happy with the answers, click **Save changes**. Your website keeps using the last saved instructions and guardrails until you do.

The 100-character minimum applies here too: with a shorter text, the Playground shows an error instead of an answer.

Playground chats are saved with your other conversations. To try something without saving it, click the temporary chat icon in the widget header. A strip reading "Temporary chat — messages aren't saved" appears, and no lead form is shown. Click the icon again to return to the saved conversation. Replies in the saved conversation can be rated with a thumbs up or down, and the ratings appear in its transcript on the **Conversations** tab.

> Every Playground message, temporary or not, counts toward your plan's monthly messages.

## Common problems

- **The agent wanders off topic:** state the scope and what to decline more precisely, or add a guardrail.
- **Answers are too long:** give a word limit or ask for bullet points.
- **A fact is wrong:** fix the source, or add a [Q&A pair](/en/docs/text-and-qa). Instructions are better for behavior than for long lists of facts.
- **It doesn't point people anywhere when it can't help:** name your contact routes in the instructions.
