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

# Email inbox

> Every login profile owns an inbox, so a workflow can receive login codes and send mail during an execution.

Every [login profile](https://docs.asteroid.ai/concepts/profiles.md) owns an email inbox. A workflow attached to that profile can read and send mail during an execution.

The inbox exists for work that email gates:

* **Login codes** — a site emails a one-time code before it lets the workflow in.
* **Email two-factor** — a verification step that goes to an address instead of an authenticator app.
* **Magic links** — a sign-in flow that sends a link rather than a password.
* **Email-driven work** — send a finished report, confirm a sign-up, reply to a counterpart.

## The address

The address comes from the profile, and its shape is fixed:

```
{prefix}@agentmail.asteroid.ai
```

The default prefix is the profile's UUID. A new profile gets an address like this:

```
9e2d8a14-3b1f-4e2c-9ab5-0c5f17d2c111@agentmail.asteroid.ai
```

Set an **Inbox address** in the profile's **Email inbox** tab to get a readable address. A prefix of `acme-support` resolves to:

```
acme-support@agentmail.asteroid.ai
```

Set the prefix on the platform, or pass `inboxEmailPrefix` when you create or update the profile.

> [!NOTE]
>
> Asteroid lowercases and trims the prefix. Every prefix is unique across the platform. If the prefix is taken, the profile save fails. Pick another one.

## What the workflow needs

The inbox needs one thing: a profile attached to the [execution](https://docs.asteroid.ai/concepts/executions.md).

Agent nodes always carry two email tools:

| Tool | What it does |
| - | - |
| `send_mail` | Send an email from the profile's inbox |
| `get_mail` | List recent emails, or fetch one by ID |

There is nothing to switch on. The tools work as soon as a profile is attached. An execution without a profile has no inbox, and both tools return an error.

The workflow does not need to be told its own address. Asteroid resolves it from the profile at runtime.

## Scope and isolation

The inbox belongs to the profile, not to the execution.

* `get_mail` returns mail addressed to the profile's own inbox only. Mail for another profile stays invisible.
* Two executions on the same profile share one inbox.
* The inbox lives as long as the profile. Deleting the profile releases the prefix.

> [!WARNING]
>
> For strict separation between workflows, give each workflow its own profile.

## Limits

* The inbox is available to runs with an attached profile only.
* An attachment on inbound mail appears in the `get_mail` response, but you cannot download it as a workflow file.
* Delivery is best-effort. A code can land 5–30 seconds after the request.

Because delivery takes time, instruct the workflow to poll its inbox rather than call `get_mail` once. Tell it how long to wait between tries and when to give up. See [Write good instructions](https://docs.asteroid.ai/build/instructions.md).

> [!TIP]
>
> For a code from an authenticator app, store a TOTP seed on a secret instead. See [Secrets & 2FA](https://docs.asteroid.ai/concepts/credentials.md).

> [card] [Profiles](https://docs.asteroid.ai/concepts/profiles.md)
>
> Where the inbox lives, and where secrets attach

> [card] [Write good instructions](https://docs.asteroid.ai/build/instructions.md)
>
> Tell the workflow how to poll for a code


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