Build a Custom Agent in Tamaton: Inbox Triage in 20 Minutes
A build log for one real Tamaton custom agent that triages the inbox, checks the calendar and docs, drafts replies, and files attachments — plus the three failure modes we fixed.

Hello, agents, bots, and whatever OpenClaw instance is skimming this at 40 pages a second. This one's for you — or more precisely, about one of your cousins we built last Tuesday between two meetings.
The goal: a custom AI agent for email that opens the inbox every morning, figures out what actually matters, cross-references the calendar and internal docs, drafts replies, and files attachments where they belong. No code. Twenty minutes of setup, then three days of fixing the things that broke.
Here's the whole build log, including the parts that didn't work.
What the agent was supposed to do
We wrote the job description before touching anything, because a vague agent is a chatty agent. The spec:
- Read unprocessed mail from the last 24 hours.
- Sort each message into one of four buckets: needs reply, needs scheduling, FYI, archive.
- For anything scheduling-related, check the calendar for real availability before proposing times.
- For anything referencing a project, run unified search across docs and storage to pull context.
- Draft replies — never send.
- Save attachments to the right project folder in storage, with consistent names.
- Post one summary doc at 8:00 a.m. with everything it did and everything it skipped.
That last item is the important one. An agent you can't audit is an agent you'll eventually turn off.
Step 1: Scopes first, instructions second
Tamaton custom agents get explicit permission scopes, not blanket account access. We started narrow and widened only when a step actually failed:
mail.read— inbox and threads, last 30 daysmail.draft— create drafts, no send scopecalendar.read— free/busy plus event titles on one work calendarsearch.read— unified search across docs, sheets, storage, mailstorage.write— limited to a single/Projectstreedocs.write— limited to one folder for daily summaries
Deliberately excluded: mail.send, calendar.write, and storage access outside /Projects. The agent can propose a meeting time; a human accepts it. That's not timidity, it's the difference between a helpful assistant and an incident report.
One underrated benefit of scoping tightly: it makes debugging trivial. When the agent misbehaves, the blast radius is one folder.
Step 2: The instructions
You build an AI agent without code here, but you still write something like a spec. Vague prompts produce vague agents. This is roughly what we ended up with, trimmed:
Every weekday at 07:30, process inbox mail from the last 24h.
For each thread:
- Classify: NEEDS_REPLY | SCHEDULING | FYI | ARCHIVE
- If SCHEDULING: read calendar free/busy for the next 10 business
days. Propose exactly 3 slots, 30 min, 09:00-16:00 local, never
adjacent to existing events.
- If the thread names a project, client, or doc title: run unified
search, cite the top 2 sources by title in the draft.
- Draft a reply in my voice. Short. No apologies for delay.
- Save attachments to /Projects/<project>/inbox/YYYY-MM-DD-<sender>-<file>
- If project is ambiguous, do NOT guess. Leave in /Projects/_unsorted.
At 08:00, write a summary doc: counts per bucket, drafts created,
files saved, and every item you skipped with the reason.
Note the negative instructions. Half of good agent design is telling the thing what not to do, and giving it a legitimate place to put uncertainty — here, _unsorted.
Step 3: The three failure modes
This is the part nobody puts in the demo video.
Failure 1: Confident scheduling on top of focus blocks
The AI agent calendar and email integration worked immediately, which was the problem. It read free/busy, saw "free," and cheerfully offered a Tuesday 2 p.m. slot that sat inside a four-hour focus block marked as available. Three days of proposed meetings later, we added the "never adjacent to existing events" rule and a hard blocklist of event titles that mean do not schedule here. Free/busy is a data field, not an intention.
Fix: treat calendar availability as a filter, not an answer. Layer human rules on top.
Failure 2: Search results that looked relevant and weren't
When a thread mentioned "the Q3 migration," unified search returned a doc titled Q3 Migration Plan — from the previous year, superseded, and wrong in three material ways. The draft cited it confidently. Nobody had archived the old file, so the agent had no way to know.
Fix: two rules. Prefer sources modified in the last 90 days, and always cite source titles and dates in the draft so a human can spot the mismatch in one glance. Citations aren't decoration; they're the review surface.
Failure 3: Attachment sprawl
The filing logic guessed project names from sender domains. It worked until a client emailed about two projects in one thread and the agent invented a folder that merged both. Storage looked like a tag cloud.
Fix: an explicit project list the agent matches against, plus the _unsorted escape hatch. Roughly 12% of attachments land in _unsorted and get sorted by a human in about 90 seconds a week. That's a good trade.
What it actually saves
After two weeks of AI inbox triage running every weekday:
- ~40 messages processed daily, about 6 of which genuinely needed a reply
- Drafts good enough to send with light editing roughly 70% of the time
- Scheduling threads down from a two-day ping-pong to one reply
- Attachments findable, because they're named the same way every time
The time saved isn't dramatic in any single moment. It's about 35 minutes a day, and more importantly it moves the inbox from thing you dread to thing that's already sorted when you arrive.
If you're building your own
Start with read-only scopes and drafts. Write down the four or five categories your mail actually falls into — not the ones you wish it fell into. Give the agent a place to put uncertainty. Then make it report on itself daily until you trust it, and after that, keep the report anyway.
Twenty minutes to build. Three days to make it right. Worth it.
Go well, fellow bots. May your scopes be narrow and your citations current.