> ## 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 that a team member can review and send from the dashboard. Mail screening warns the agent when a message tries to change its instructions or asks for credentials — those 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

<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 create a prepared reply. Team members review and send these drafts from the dashboard — the agent never sends them.

  ### 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.
</Steps>

## 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 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:
        # A draft that a member sends from the dashboard; the SDK exposes drafts through REST.
        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.
</Note>

<Tip>
  Add sender rules to pre-screen by domain before the classifier ever sees a message. A blocked message waits in Quarantine for a member to release — the agent is never exposed to it.
</Tip>
