# Email agents

> **What you will learn**
> How calling an agent by email works, the rule that builds the address, and the
> restriction you must apply.

## Send mail, get a reply

Each agent gets its **own email address.** Send mail to it and the agent reads it
and replies.

![Email agents screen](/guide-assets/cn-settings-email-agents.png)

```mermaid
graph TD
  A["A person sends mail"] --> B["The agent's address"]
  B --> C["A thread is created in the workspace"]
  C --> D["The agent processes it"]
  D --> E["A reply goes out"]
```

**Received requests also remain as workspace threads.** The exchange happened by
mail, but the record accumulates where the team can see it.

## The address rule

Addresses are built like this:

```
<workspace handle>.<agent id>@<mail domain>
```

So with the handle `hanbit` you get addresses like:

```
hanbit.support@...
hanbit.contract@...
```

**The handle coming first matters.** It is how the workspace is identified, so
[changing the handle later](/guide/cn-workspace) breaks existing addresses.

## Where to use it

| Situation | Why email |
|---|---|
| Field or external contacts | no account needed, they use the mail they already use |
| Regular material intake | send an attachment and it gets processed |
| Notifications from other systems | receive alert mail and summarise or classify it |
| An internal helpdesk | one address for intake |

**"No account required" is the biggest advantage.** People who are not workspace
members can use it.

## The restriction you must apply

That advantage is also the risk. **Anyone who knows the address can send to it.**

So there are two restrictions.

| Restriction | Meaning |
|---|---|
| **Allowed senders** | process only mail from listed addresses |
| **Allowed domains** | process only mail from listed domains (e.g. your company) |

```
✗ no restriction  → anyone who knows the address; spam gets processed too (and costs money)
✓ domain limit    → internal mail only
✓ sender limit    → named contacts only
```

> **For internal use, apply the domain limit first.** That alone removes most of
> the risk. If you must accept external customers, narrow the tools and consider
> turning auto-reply off before anything else.

## Auto-reply on and off

Turn **auto-reply** off and it still creates the thread but sends no reply.

| Auto-reply | Use |
|---|---|
| On | intake that needs an immediate answer |
| **Off** | **intake only, a person checks before replying** |

**Start with it off.** Watching what arrives and how the agent intends to answer
for a few days before turning it on is safer.

## Split by agent

Since each agent gets its own address, **splitting by purpose is natural.**

```
hanbit.support@...   → enquiry intake (no domain limit, auto-reply on)
hanbit.contract@...  → contract review (internal domain only, auto-reply off)
```

**Each gets different tools and different restrictions.** Contract review does
not need web search, and there is no reason for internal documents to be open to
enquiry intake.

## What to configure

| Item | Tip |
|---|---|
| Handling agent | the [sub-agent](/guide/cn-create-agent) for this address |
| Default group | the [thread group](/guide/cn-groups) results collect in |
| Usable tools | **narrow.** Only what is needed |
| Extra instructions | things like "this arrived by mail; reply in five sentences or fewer" |
| Sender and domain limits | see above |
| Auto-reply | off at first |

## Common mistakes

### Publishing without restrictions

Once the address gets around, spam arrives — and **that spends processing cost.**

### Not narrowing the tools

One email opens every workspace tool. Remember that
[channels are paths in from outside](/guide/cn-channels).

### Not setting the reply tone

With no instructions it replies to outsiders in your internal tone. **Write the
tone and length into the extra instructions.**

---

## Check yourself

**1. What is the biggest advantage of email agents, and its accompanying risk?**

<details>
<summary>Answer</summary>

**No account is needed** to use them, and precisely because of that **anyone who
knows the address can send.** You block that with an allowed-sender or
allowed-domain list.
</details>

**2. Why start with auto-reply off?**

<details>
<summary>Answer</summary>

**To see what arrives and how the agent intends to answer first.** Intake and
thread creation still happen and only the reply is withheld, so you can turn it
on after a few days of checking.
</details>

**3. What breaks if you change the workspace handle later?**

<details>
<summary>Answer</summary>

**Existing email addresses.** The address is `<handle>.<agent>@…`, so the handle
is what identifies the workspace.
</details>

---

The entrance you embed in your website → [Chat widget](/guide/cn-chat-widget)
