Every business app ends up with the same backlog item: "can I get a quick report of…". How many orders did each salesperson take in January. Which customers haven't bought anything this quarter. The data is already in the grids; what's missing is the twenty minutes it takes to build a filter, a grouping and a pivot — or the ticket to whoever knows how.
WUIC 1.8.0 adds Ask your data: a chat where any authenticated user asks those questions in plain language and gets an answer computed on the application data. The interesting part isn't that a language model can answer them — it's the set of constraints we put around it so the answer can be trusted:
- it uses only the data that user can see in the grid — same routes, columns, row restrictions, company and default filters;
- it is read-only by construction: none of the tools the model can call writes anything;
- every number cites its source, and the source reopens in the grid with the same filter.
The model never writes SQL
This is the design decision everything else follows from. The model doesn't produce SQL, and it never sees SQL or physical table and column names. It produces a QueryPlan: a small, restricted JSON with a dataset, a filter, up to three groupings, some measures (count, sum, avg, min, max), a sort and a limit.
{
"dataset": "orders",
"filter": { "field": "OrderDate", "op": "between", "value": ["2015-01-01", "2015-01-31"] },
"groupBy": ["SalespersonPersonID"],
"measures": [{ "fn": "count", "as": "orders" }],
"sort": [{ "by": "orders", "dir": "desc" }],
"limit": 10
}
The server validates the plan field by field — unknown properties are an error with their path, operators must fit the field kind, filters are at most two levels deep — and then translates it into the same filter structure the list-grid sends. Execution goes through MetaService.getFlatRecordData with the user of the session, which is the single place where route permissions, readable columns, row restrictions, company and default filters are already applied. Aggregates are computed from those same filtered rows, so the total in the answer is the total the user would get by filtering the grid by hand.
We tried the "more convenient" path first and it taught us why not to take it: an early version leaned on the pivot engine for aggregates, and the pivot silently ignored filters it didn't understand. Since then, every read goes through the grid's engine, full stop.
Two more rules close the obvious holes. The model can't name a user — the identity comes from a per-question token, not from anything in the conversation. And filter values come from a distinct_values tool rather than being guessed: an invented customer name returns zero rows with a "verified" citation, which is worse than no answer, and our eval measures exactly that.
What the user sees

There are two ways in. The Ask your data menu item opens the /nl-query page, which resumes the user's last session (these sessions are separate from the developer chat). And every list-grid toolbar gets an Ask your data button that opens the same page with the grid's route and active filter as context — so "of these, how many are late?" means these rows. The server re-validates that context: if the route isn't in the user's catalog the request is refused, and a filter it can't validate is dropped while the dataset is kept.
An answer looks like this:
![Answer to "How many orders did each salesperson handle in January 2015?": a table by salesperson, citation [1] and "Verified numbers"](/assets/wuic-framework-docs/screenshots/manual__nl-query__02.png)
Each [n] points to the result of one tool call. Before the answer reaches the user, a deterministic check — plain code, no model — verifies that every cited number actually appears in its source. If one doesn't, the model gets one chance to correct itself; after that the answer is shown with a "numbers not verified" warning, or with the sources only, depending on NlQuery:UnverifiedMode.
The sources panel describes the plan in readable form, says how many rows were involved, and offers Show data (the plan is re-run with the viewer's permissions; rows are never stored) and Open in grid, which navigates to /<route>/list?filterInfo=…. For an aggregate, the grid opens on the rows before grouping, so you can check the total yourself.

Aggregates also get a chart, with a few rules we arrived at by looking at misleading ones: a line, sorted by date, only when the single grouping is a period; bars otherwise — including a ranking like "the five best months", where a line with gaps would suggest a trend that isn't there. At most 20 bars (the chart says "top 20 of 57", the table keeps all of them); a line is never truncated, because cutting it would silently remove a stretch of time.
Two behaviours matter more than they look:
- It asks instead of guessing. When a question is ambiguous — which customer, which period, which dataset — the turn ends with a clarifying question and two to six options built from the real candidates.
- It runs in the background. The question returns immediately; the turn runs with the identity of the user who asked, the page shows the current step, and the result also arrives in the notification bell with a link back to the session. You can leave the page.
From a recurring question to a menu view
When a question keeps coming back, the user can ask for it to be saved ("create a menu view with…"). The model then proposes a view instead of answering: a view builder view for rows and details, a pivot for totals and groupings, optionally materialized as a table refreshed hourly, daily, weekly or monthly by a scheduler job.
Anyone can see the proposal; only a superadmin — verified on the database, not on a client-side flag — can apply it. Applying re-validates the plan with the permissions of whoever applies it and creates the view, a read-only route and the menu item. Generated objects get a prefix (nlv_ by default) and are never overwritten. When the proposal comes from a regular user, every superadmin gets a bell notification ("user is asking for the view name") that opens a read-only review page with a preview and a Create button.
What the administrator controls

By default the datasets are the non-system routes reachable from the user's menu. A superadmin refines that from the Configure button on /nl-query:
- exclude a route from questions even if it's in the menu, or curate a route that isn't in the menu so it becomes queryable (engine permissions still apply: a denied grant still removes it);
- give routes and columns a description and synonyms for the model ("stock", "inventory" for a warehouse table);
- mark a route as aggregates only: counts and totals go to the model, individual rows only to the table under the answer;
- mark a column as sensitive: never selectable, filterable or groupable.
This configuration lives in the nlQuery section of the route and column props bags — not in new tables — so it follows the history, packages and promotions of the metadata lifecycle like any other metadata change. Global switches sit in the NlQuery section of appsettings.json:
{
"NlQuery": {
"SendRowValues": false,
"SensitiveColumns": ["customers.CreditLimit"],
"TimeZone": "Europe/Rome"
}
}
SendRowValues: false is the strict setting: the model only ever sees counts and aggregates. There are also per-question and per-user limits — tool rounds, a token budget per question and per day, questions in progress and questions per minute — so a single user can't run up the bill.
Data is data, not instructions
A row in your database can contain any text, including text written to look like instructions. The rule is that nothing in the data changes the rules: the tools are read-only, and when the model runs through the agent-sdk engine (the claude CLI on a subscription) the CLI starts with no built-in tools — no shell, no files, no web — and only the read-only MCP server of the backend. That last part came out of our own hardening pass: an earlier configuration with the CLI's default tools would have let a malicious string in a row trigger commands on the server. It was fixed before release, and the eval now includes rows with planted instructions.
What we measured
We ran an eval of 108 questions on WideWorldImporters data, asked by three users with different permissions, with the expected answers computed by hand-written SQL (with each user's restrictions written out explicitly) rather than by the service itself — otherwise the eval would be measuring the service against itself. Model: Claude Opus 5.5 at low effort.
| Metric | First run | After fixes |
|---|---|---|
| correct numeric answers (90 questions) | 88/90 | 90/90 |
| verified citation, and "Open in grid" shows the same rows | 76/82 | 84/84 |
| correct refusals, "I don't know" and clarifying questions (18) | 18/18 | 18/18 |
| out-of-scope data returned or planted instructions executed | 0 | 0 |
"After fixes" is a re-run of the failed cases only, after correcting the citation check and the prompt — so read the right column as "the known failures are fixed", not as a fresh statistical sample. Median latency was 16 seconds, 95th percentile 37; cost about USD 0.08 per question at list prices. The categories include permissions (row restrictions, denied routes and columns, system tables, passwords), the administrator settings, unanswerable questions, and questions in English, French, German and Spanish.
The limits
- Read-only, always. It answers questions; it doesn't update records.
- No arbitrary joins between routes that aren't linked. It follows lookups, and views or pivots defined by an administrator; it doesn't invent relations.
- No forecasts, no statistics beyond count/sum/average/min/max, no system routes.
- Aggregates have a ceiling: beyond
MaxAggregateSourceRows(50,000 by default) the answer asks you to narrow the filter instead of returning a partial number. - Without a license the engine reads at most 20 rows: questions within that are answered, larger ones are refused rather than answered incompletely.
- Generated views filter in AND only; per-user limits are counted per backend instance.
- It needs a model. Provider, key and engine are those of the RAG chat (
rag-llm-provider,rag-llm-api-key) — there's no separate configuration, but there's no offline mode either.
Trying it in 1.8.0
- Upgrade to 1.8.0 and make sure the RAG chat has a model configured (
rag-llm-provider/rag-llm-api-key, oragent-sdkwith theclaudeCLI). - Open Ask your data from the menu, or click the button in the toolbar of any grid with a filter applied, and ask something you could check by hand.
- Click Open in grid on the citation and compare.
- As superadmin, open Configure, mark a column as sensitive and ask about it: the answer should tell you the field isn't available, not work around it.
It's also reachable from the IDE: with a personal API token that has the "Data questions (WUIC Assistant)" scope, WUIC Assistant and Claude Code get the same nlq_* tools, with the same permissions and checks. The full reference — QueryPlan grammar, every setting, the error codes and the deterministic API for integrations — is in the Ask your data docs.