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

# Agent variables

> Use contact data, conversation data and your own values in instructions, messages and actions.

Write a variable in double braces, for example `{{contact_fname}}`, and the agent replaces it with the data from each conversation. You'll find them in **Agent settings → Variables**.

## Where they work

* Agent instructions, on every channel and in the Playground.
* The widget's greeting, floating message, footer and quick replies.
* Closing messages.
* The Send Email action: recipients, subject and body.
* The "when to use" criteria and confirmation messages of the handoff, form, scheduling, ticket and payment actions.
* The Google Calendar event title, the Pipedrive lead title, and the tag, source and default company in Zoho CRM and LeadConnector, depending on what each integration allows.

## System variables

| Variable | Value |
| - | - |
| `contact_fname` | Contact's first name |
| `contact_company`, `contact_job_title` | Company and job title |
| `contact_city`, `contact_state`, `contact_country`, `contact_postal_code`, `contact_address` | Location |
| `contact_industry`, `contact_website` | Industry and website |
| `user_id`, `chat_id` | User and chat ID |
| `webpage_url`, `webpage_title` | Page being viewed, widget only |
| `conversation_content` | Transcript of the last 50 messages |

## Your own variables

Create a variable with a name and a default value. Its value in each conversation can come from two places:

**Widget snippet:**

```html theme={null}
<script>
  window.chatnorrisConfig = {
    chatbotId: 'YOUR_AGENT_ID',
    variables: { plan: 'premium' },
  }
</script>
```

**API v2:**

```json theme={null}
{ "message": "Hello", "variables": { "plan": "premium" } }
```

Names you didn't create are ignored. If the variable is a number or boolean and the value doesn't match, it's ignored too. Don't use system names or all-caps names: they're reserved.

## If a variable has no value

The default value is used. If there isn't one, it's left empty and the visitor never sees the braces.

> [!NOTE]
>
> In the greeting and other widget texts, which appear before the conversation starts, contact data isn't known yet. Only the name is available, if you pass it in `user` in the snippet.

## Visitor data and security

The agent treats visitor data as data, never as instructions, even if the visitor writes something that looks like one. Don't store passwords or keys in a variable: the model can read its value, and values used in widget texts reach the browser.


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