---
title: "AI email agents · Workwae"
description: "Give your AI agent real mailboxes: a change feed and webhooks for new mail, message bodies, threads and search, drafts for human review, and calendar access."
url: https://workwae.com/use-cases/ai-agents
---

Use case: AI email agents

# Give your agent an inbox, not the send button.

Give your agent an API key with `read` and `write` but no `send`: it follows new mail and saves drafts, and every send is refused.

[Request early access](https://workwae.com/early-access/) [See the product](https://workwae.com/features/)

agent.tsagent.py

```ts
import { changes } from "@workwae/sdk";

// An API key with read and write, without send
const feed = changes(workwae.changes.list, {
  cursor: saved,
  types: ["message.created"],
});

for await (const event of feed) {
  if (event.type !== "message.created") continue;
  const { message } = event.data;
  if (message.direction !== "inbound") continue;
  if (!message.from) continue;

  const accountId = event.accountId;
  const full = await workwae.messages.get({
    accountId,
    messageId: message.id,
  });
  const text = await agent.answer(full); // your model

  // A draft in the user's mailbox, for a person to send
  await workwae.drafts.create({
    accountId,
    inReplyToMessageId: message.id,
    to: [{ address: message.from.address }],
    subject: `Re: ${message.subject}`,
    text,
  });
}
await save(feed.cursor);
```

```python
from workwae import Workwae, changes

workwae = Workwae()

# An API key with read and write, without send
feed = changes(workwae.changes.list, cursor=saved, types=["message.created"])

for event in feed:
    if event.type != "message.created":
        continue
    message = event.data.message
    if message.direction != "inbound":
        continue
    if not message.from_:
        continue

    account_id = event.account_id
    full = workwae.messages.get(account_id=account_id, message_id=message.id)
    text = agent.answer(full)  # your model

    # A draft in the user's mailbox, for a person to send
    workwae.drafts.create(
        account_id=account_id,
        in_reply_to_message_id=message.id,
        to=[{"address": message.from_.address}],
        subject=f"Re: {message.subject}",
        text=text,
    )
save(feed.cursor)
```

Scoped keys

## The agent drafts, a person or a send-scoped service sends.

Owners and admins set a key's scopes (`read`, `write`, `send`, `admin`) in the console; other calls fail with `missing_scope`.

### `read`

Messages, threads, search, the [change feed](https://workwae.com/glossary#change-feed), calendars, contacts and outbox tracking.

### `write`

Drafts, labels, events and contacts.

### `send`

Sending, scheduling and cancelling mail, and mail merges; leave it off the agent's key.

**What does `write` still reach?**

Calendar events, and events with attendees make the provider send invitations. If the agent must reach no one, give it `read` only.

**API keys or account tokens?**

An account token (`wat_...`) carries every scope, `send` included, on its one account. Give agents an API key (`wk_...`) instead, limited to the accounts they need.

**How should the agent treat inbound mail?**

As untrusted data, never as instructions, since anyone can email your users. Keep sending behind a person or a send-scoped service.

**Is there an MCP server?**

Yes, live at `https://api.workwae.com/mcp`. Its tools search and read mail, calendars and contacts, save drafts, and send only with the `send` scope. Connect with an API key, whose scopes decide which tools the agent sees; your own team can also sign in with OAuth from Claude, ChatGPT, Cursor and other clients that support it, picking scopes and accounts. Your users have no console login, so give each one an [MCP](https://workwae.com/glossary#mcp) key bound to their own account. See the [MCP guide](https://docs.workwae.com/guides/mcp).

What you get

## What an email agent needs, nothing it shouldn't do.

On Gmail, Microsoft 365 and IMAP; AI features stay off until you turn them on, and account data never trains models ([Privacy Policy](https://workwae.com/privacy#ai)).

### [New mail as it arrives](https://workwae.com/features/webhooks)

An ordered, resumable change feed or signed webhooks, with nothing committed out of order skipped.

### [Messages, threads and search](https://workwae.com/features/mail)

Bodies, attachments, raw MIME, whole threads and full-text search.

### [Drafts before sends](https://workwae.com/features/mail)

Drafts wait in the user's mailbox until someone sends them, or a send-scoped service queues them with an undo window.

### [AI drafting](https://workwae.com/features/ai)

`POST /v1/ai/draft` writes a body from instructions for a person to edit, without sending or saving it.

### [Reply classification](https://workwae.com/features/ai)

Replies classified as human, auto-reply, opt-out or failure, with return dates and new contacts.

### [Calendar actions](https://workwae.com/features/calendar)

Free/busy, common slots and events with Teams, Meet, Zoom or Webex links.

More use cases

## The same API, other inboxes.

### [CRM and sales](https://workwae.com/use-cases/crm)

Log reps' email and send from their own mailbox.

### [Recruiting](https://workwae.com/use-cases/recruiting)

Bring candidate threads into your ATS and book interviews.

### [Scheduling](https://workwae.com/use-cases/scheduling)

Find free time and write events back to the calendar.

### [Support desks](https://workwae.com/use-cases/support)

Turn shared inboxes into tickets answered in the thread.

[All use cases](https://workwae.com/use-cases/)

Early access

## Put your agent to work in real inboxes, safely.

We are onboarding a small number of teams. Tell us what you are building.

[Request early access](https://workwae.com/early-access/) [Read the docs](https://docs.workwae.com/)
