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

# Widget behaviour, instructions, handoff and domains

> Set chat history, source links, auto-open and typing delay, write the agent's instructions, set live-agent hours, and limit which domains load your widget.

# Widget behaviour and settings

These settings are on the **AI Agent** page. Click **Publish** (or **Save changes**) after you change
them.

## General tab: widget behaviour

Under **Widget behavior**:

* **Max Messages per Session:** how many messages a visitor can send in one chat (10–200, default 50).
* **Typing Delay (ms):** a short pause before the agent's reply appears (0–5000, default 800).
* **Save chat history for returning visitors:** keeps the conversation when the visitor reloads the
  page or comes back later in the same browser.
* **Show knowledge source links in answers:** adds links to the pages the answer came from.
  **Max Sources Shown per Reply** sets how many (1 to 3).
* **Auto-open widget on page load:** opens the chat window when the page loads.

<Frame caption="Illustration of Save chat history for returning visitors: yesterday's chat is still there today.">
  <img src="https://mintcdn.com/zynfoai/TpFuLv_P_rJXw8fL/images/ui/chat-history-1.png?fit=max&auto=format&n=TpFuLv_P_rJXw8fL&q=85&s=ef08d197fc412986e9df6179f67b4dfd" alt="Chat widget showing messages from yesterday and today, with the Save chat history for returning visitors setting ticked" width="1008" height="576" data-path="images/ui/chat-history-1.png" />
</Frame>

## Behavior tab: the agent's instructions

* **Role / Job Title:** for example "Customer support for Acme Bikes".
* **Primary Goal:** what the agent should try to achieve, such as answering product questions or
  booking a call.
* **System Prompt (Instructions):** the tone and rules the agent follows, for example "Never promise
  delivery dates" or "Reply in the customer's language".

## Live chat tab

* **Live chat:** lets customers ask for a person. Turn it off and the agent keeps answering on its own.
* **Working hours:** when on, a person is offered only inside your hours. Set the **Time zone** and the
  **Weekly Schedule**.
* **Reply when a person isn't available:** what the AI says when a customer asks for a person outside
  your hours, or when nobody on your team is online.
* **Routing** (owners and admins): who gets new chats, how long a teammate has to accept, and what
  happens when nobody is online. Below it, **Team availability** shows who is online.

See [Live chat](/inbox/human-handoff) for every setting and what happens after a customer asks for a person.

## Security tab: allowed domains

Add the domains where your widget may load (for example `www.example.com`) and click **Add Domain**.
While the **Allowed Domains** list is empty, the widget loads on any site that uses your agent's
snippet.

<Frame caption="Illustration of the Security tab with three allowed domains.">
  <img src="https://mintcdn.com/zynfoai/TpFuLv_P_rJXw8fL/images/ui/website-chat-widget-3.png?fit=max&auto=format&n=TpFuLv_P_rJXw8fL&q=85&s=65bcdf319f9529c2225bb44beb51e85e" alt="Security tab with an Allowed Domains field and a list of added domains" width="1008" height="548" data-path="images/ui/website-chat-widget-3.png" />
</Frame>

## Related topics

* [Chat widget text and appearance](/agent-management/content-and-appearance)
* [Live chat](/inbox/human-handoff)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.