Skip to content
All case studies
AI infrastructure Conversational agent Governed data

Ask your numbers a question in Slack

The finance team asked the same ARR and billing questions in Slack every week, and one analyst answered them by hand. Built a Claude agent that answers in the thread, reads from governed views only, and shows the query it ran.

In the thread

answers where the question was asked, follow-ups included

Read-only

it can see a curated layer and nothing else, enforced by permissions

Shows its work

every answer carries the query it ran and the view it read

Tested

past questions replayed and graded before every deploy, and every answer logged with its cost

The client

A B2B SaaS company whose finance, customer success and leadership teams live in Slack. The ARR model was solid and the dashboards existed, yet the same questions kept landing on the one analyst: what is this customer's ARR, which accounts grew last quarter, why did one region dip in July.

The problem

Every question was a context switch for the analyst and a wait for the asker. People had started pasting questions into a general-purpose AI assistant together with a raw export, and getting fluent answers that disagreed with the board pack. The warehouse held the right numbers. The route to them was a person.

How it ran

A question in Slack, an answer in the thread, and a guard chain in between.

Step 1

Ask in Slack

Tag the agent in a channel or a thread, in plain language, the way you would ask a colleague.

Step 2

Acknowledges

It reacts with an emoji within a second, so you know it is on it, then goes to work.

Step 3

Plans against the governed layer

Claude picks the governed view and writes a query against it. Those views are the only tables it knows exist.

Step 4

Passes the guard chain

Read-only check, allowed-view check, dry-run cost cap. A query that fails any of them never runs.

Step 5

Answers in the thread

A short answer, the figures, the caveats and the query behind them. Tag it again and it remembers the thread.

What I did

  • 01.Built the curated layer: a handful of governed views over the existing ARR model, one definition per metric, the same numbers the board pack reads.
  • 02.Built the agent loop on Claude (Vertex AI): tool use over the views, a system prompt that carries the business rules, and thread memory replayed as plain text so follow-ups work.
  • 03.Put a guard chain in front of BigQuery: single read-only statement, allowed views only, dry-run byte cap, and a dedicated service account whose permissions end at the curated layer.
  • 04.Split the Slack side into a receiver and a queued worker, so Slack's three-second acknowledgement always lands and a slow model call never drops a question. Deduplication at both layers.
  • 05.Turned every user correction into a numbered prompt rule and a regression case, built the offline eval suite that replays those cases before each deploy, and logged every answer with its queries, token usage and estimated cost.
  • 06.Piloted it with an allowlist of users, then opened it to the teams. It stays on the retainer, like the model underneath it.

Under the hood

How it stays trustworthy

  • •The permission boundary is IAM. The agent runs as its own service account, which can read the curated views and nothing else. The prompt rules sit on top of that wall.
  • •Every query is checked before it runs. It has to be one read-only statement, reference only allowed views, and pass a dry-run cost cap.
  • •One definition per metric. The views sit on the same ARR model the board pack reads from, so the agent cannot produce a second version of ARR.
  • •Thread memory is append-only and replayed as text, so a follow-up sees the earlier question and the figures it produced.
  • •Corrections become rules, and rules get tested. When a user flags an answer, the fix goes into the prompt as a numbered rule and the question goes into the regression suite. Before every deploy, the suite replays those questions through the real agent and grades each answer four ways: the format, the numbers against reference SQL run at the same moment, the queries it chose, and a second model judging tone and caveats against the case's own criteria. Each case runs more than once, because an agent that passes two times in three is a flaky agent.
  • •Cost is visible per answer. Each answer is stored with its token usage and estimated cost, so the monthly bill is a query away.

What it will not do

It will not touch a raw table, forecast, or answer outside the data it was given. A question it cannot answer from the governed layer gets a plain "I can't answer that from the data I have", with what it can offer instead.

InteractiveTry it

Ask a question. Watch it acknowledge, answer in the thread, then tag it again.

Sample company and figures, illustrative only

#finance-questions

Nothing here yet. Pick a question below to post it in the channel. The out-of-scope follow-up shows what a refusal looks like.

Post a question in the channel

Result

What the team got.

Answers where the question was asked

Finance and customer success get the figure in the thread, with the caveats, and can keep asking.

The analyst's week comes back

Routine lookups stop interrupting the modelling work. The hard questions still reach a person, with the easy part already done.

The same number everywhere

The agent, the dashboards and the board pack read one model, so an answer in Slack can be checked against the tile.

Quality and cost are a report

Every answer, its queries and its cost are logged. Reviewing a month of answers is a query, and so is the bill.

Tools used

BigQuery Claude on Vertex AI Python Cloud Functions and Cloud Tasks Slack API IAM-scoped service account

Your team asks in Slack. Who answers?

It usually starts with a short Spotcheck of the model underneath, then a scoped build, then it stays on the retainer with the rest of the stack.