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

# Automate Support Triage and Only Send Within Your Rules

> Label conversations, draft replies for sensitive categories, and only send autonomously for the request types you've explicitly approved.

A support address forwards to the agent. The agent reads each conversation, labels it by category, drafts a reply, and sends only for the categories you have approved. Everything else stays a draft for team review. Mail screening attaches warnings to suspicious messages. Blocked messages go to Quarantine and wait for a human.

## What you need

An agent equipped with an inbox and a token that has the following capabilities:

* **email:read**: to read incoming support conversations
* **email:send**: to reply to approved categories and save drafts

## Steps

### Give the agent the support address

Create an inbox such as `support@` on your own subdomain, or configure your existing support address to forward to the agent's address. Members and the agent keep separate unread states so neither loses track of what needs attention.

### List unread conversations

Call `list_threads` with `folder: "inbox"` and `unread_only: true` to get the conversations the agent hasn't handled yet.

### Check the screening verdict

For each thread, read the latest message and inspect `screening.verdict`. If it's anything other than `"clean"`, add a `"needs-human"` label with `update_thread` and skip to the next conversation. The agent must never act on a message that tried to override its instructions or request credentials.

### Classify and label each conversation

Pass the message text to your model to classify it as `"billing"`, `"bug"`, or `"question"`. Apply the resulting label with `update_thread`.

### Reply to approved categories

For messages classified as `"question"`, call `reply_to_message` with a generated answer and an idempotency key. Use only the categories you have decided the agent may answer autonomously.

### Save drafts for everything else

For `"billing"` and `"bug"` threads, use `save_draft` (or `POST /api/v1/inboxes/:id/drafts`) to save text for review. Drafts are standalone messages: sending one starts a new conversation. To keep a reply in its original thread, a member reviews the draft, opens the original message, and uses **Reply** with the approved text. Delete the standalone draft afterwards. Include enough quoted context in the draft for the reviewer to locate the original message.

### Mark conversations handled

Call `update_thread` with `read: true` to mark each conversation as handled for the agent. Members keep their own separate unread state, so nothing is lost for the human side.

## Chat prompt example

Use this prompt in any chat client with Agent Loadout connected:

```text Chat prompt theme={null}
Go through the unread support conversations. Label each one billing, bug or question.
Reply to questions you can answer from our docs. For billing and bugs, save a draft
reply and quote the customer's message, but do not send.
```

## Python example

```python support-triage.py theme={null}
import os
import httpx
from agentloadout import AgentLoadout

agent = AgentLoadout(api_key=os.environ["AGENT_LOADOUT_TOKEN"])
inbox = agent.inboxes.list()[0]

for thread in agent.threads.list(inbox["id"], folder="inbox", unread_only=True)["threads"]:
    messages = agent.threads.get(thread["id"])["messages"]
    latest = messages[0]
    if latest["screening"] and latest["screening"]["verdict"] != "clean":
        agent.threads.update(thread["id"], add_labels=["needs-human"])
        continue
    category = classify(latest["text"])                     # your model call
    agent.threads.update(thread["id"], add_labels=[category], read=True)
    if category == "question":
        agent.messages.reply(latest["id"], text=answer(latest["text"]), idempotency_key=f"answer-{latest['id']}")
    else:
        # Standalone review text. Reply from the original message to preserve its thread.
        httpx.post(f"https://agent-loadout.com/api/v1/inboxes/{inbox['id']}/drafts",
                   headers={"Authorization": f"Bearer {os.environ['AGENT_LOADOUT_TOKEN']}"},
                   json={"to": [latest["from"]["address"]], "subject": f"Re: {latest['subject']}", "text": proposed_reply(latest)})
```

## Required permissions

| Capability | Why it's needed |
| - | - |
| `email:read` | Read incoming support conversations |
| `email:send` | Reply to approved categories and save drafts |

> [!NOTE]
>
> The Free Sandbox plan sends only to verified recipients, so a real support flow that replies to arbitrary customers requires a paid plan.

> [!TIP]
>
> Add sender rules to pre-screen by domain before the classifier sees a message. A blocked message waits in Quarantine, and the agent cannot read it unless a member releases it.


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