# Access Control

## What It Is

Access control determines who can chat with your public agent. By default, anyone with your public URL can start a conversation. You can restrict this so only invited people have access.

## Access Modes

Each public agent has one of three access modes:

| Mode | Who can chat |
|------|-------------|
| Open (default) | Anyone with the URL. No login required. |
| Gated | Invitation only. Visitors must be invited by you and authenticate before the chat loads. |
| Paid | Same as gated — visitors must be invited and authenticated. The label distinguishes paying clients from free invitees, for your own tracking. |

Gated and paid work identically — the difference is a label for your records. Both require visitors to authenticate before they can see the chat.

## How to Set It Up

Tell Maxy: "Set my public agent to gated access" or "Make the coaching agent invitation-only."

Maxy changes the access mode. The next visitor to your public URL will see a login screen instead of the chat.

## Inviting Visitors

Tell Maxy who to invite: "Invite sarah@client.co to the coaching agent" or "Give Tom access to my public agent — his number is 07700 900123."

Maxy creates an invitation and sends a magic link (email) or OTP (phone). The visitor clicks the link, sets a password, and gains access.

## What Visitors Experience

- **First visit (invited):** The visitor receives an email or message with a link. Clicking it takes them to your public URL where they set a password. After that, they're in the chat.
- **Return visits:** The visitor enters their email/phone and password to log in.
- **Expired access:** If their access period has passed, they see an expiry message with the date.
- **No invitation:** If someone reaches a gated URL without an invitation, they see a login screen with a note that access requires an invitation.

## Managing Access

All access management is done through conversation with Maxy:

- "Who has access to my coaching agent?" — lists active visitors
- "Revoke Sarah's access" — permanently deactivates her access
- "Extend Tom's access by 30 days" — pushes the expiry date forward
- "Set all access to expire after 90 days" — applies a default expiry to new invitations

Revoked access is permanent — the visitor cannot log in again unless re-invited.

## Visitor Identity

When a visitor is authenticated, your public agent knows their name and contact details. It can personalise responses ("Welcome back, Sarah") without needing to ask.
