WRITING02/ AGENTS IN THE PRODUCT

An AI assistant that works the account, and asks first.

Aloware's Admin app has a chat panel that answers from the account's own data and makes changes in it. I built it in two weeks on the same tools our MCP server gives Claude, and measured each fix before keeping it.

2026-11-02 · Written with Claude from the code, commit history and product docs.

The short version

What it does

A company admin opens the panel from any page and asks in plain English. It answers from the same data the app's pages show, in text, tables, charts, downloadable files and written documents. It knows the page you are on, so “this line”, “this contact” or “here” mean the record on screen.

What it covers:

When it can't do something, it says so in one sentence and offers a feature request, rather than pretending.

One set of tools for Claude and for our own panel

Aloware already had an MCP server that lets Claude and other assistants work in an account. The panel uses the same server. Each answer builds the user's own tool list from it and runs every tool in-process, signed in as that user. A tool sees only what the user sees, and every call is logged with who made it and from where.

Many tools replay the page's own request instead of reaching into the database, so validation, permissions and the audit trail match what a click on the page would do. A fix to a tool reaches Claude users and the panel at once.

How an answer runs

  1. The panel sends the message. The server checks the account's daily cap and refuses a second message while an answer is still running.
  2. A queue job runs the answer. It has one try, because a retried answer would run its tools again.
  3. The job signs in as the person. It scopes everything to their account, then undoes that afterwards, since the worker goes on to other jobs.
  4. Claude answers with tools. Up to 12 steps, each tool call checked against the approval rules below.
  5. The answer streams back. The job writes the stream to a shared cache; the web request relays it, and the panel picks the stream back up if the connection drops. Closing the panel doesn't stop an answer: it finishes and is saved.

Asking first

By default, any tool that changes something waits for a card that shows exactly what it will do. Nothing happens until the person clicks Approve. Paid lookups and emailed exports ask in every mode, so text the model reads can't spend the account's credits.

Auto mode lets routine changes run without a card. Hard rules come first and always ask: anything that deletes, restores, reaches contacts, buys, changes something live, or isn't on a 31-tool routine list. A new tool asks until someone adds it to the list. What's left goes to a classifier, which runs it only when it reads the call as routine, buying nothing, with every value given by the person. It fails closed: an error or an unsure answer asks. The evaluation of that gate has its own post.

An approval the browser forges is refused, and a call never runs with arguments the browser changed.

Treating what it reads as data

The assistant reads a lot of text it didn't get from the person: transcripts, texts, contact fields, documents. Four rules keep that text from steering it:

What made it work

Most fixes came from replaying a captured moment several times and counting, not from reading one bad answer.

ProblemFixMeasured
Every message sent every toolLoad the common tools; put the rest behind tool search76 tool definitions (~22K tokens) down to 18 (~6K)
Long flow builds were expensiveMove the cache point with each stepOne flow build: $0.99 to $0.52
Time and page in the instructions broke cachingFixed instructions per chat; time, page and mode go in each message's contextThe build turn: $0.181 to $0.058
One question made 200+ tool callsAt most 20 calls per tool per answer109 s and 628K tokens down to 26 s and 83K
The web server killed answers at 120 s, mid flow buildRun answers in a queue job and relay the streamWhole flow builds finish, even with the panel closed
The model wrote the onboarding checklist wrongThe panel draws a card from what the server knowsThe model's version failed 3 of 3 runs
Answers came back empty after a tableTell the model the fact the server knows: “your reply is still empty”48 of 48 replays answered, against 38 to 42 of 48
A repeated opening line around tablesSame approach15 of 30 replays down to 0 of 30
Stop could repeat a changeA stopped answer that already ran a tool stays answered“Answer again” can't run a change twice

The pattern behind most of them: stop asking the model to judge something the server already knows. The gate's hard rules, the onboarding card and the empty-reply notice are the same idea.

For Aloware's own staff

Two variants serve our team. On an account's Super Admin page, a chat reads the account the way one of its admins would and changes nothing. While impersonating a company admin, our staff get a panel of their own: the customer never sees their chats, every change is audited under the staff member's name, and their usage doesn't count against the customer's cap. The same read-only reader answers in Slack as Aloware Bot.