Analytics agents with bounded, aggregate-only access
Point an analytics agent at production with aggregate-only tools, capped scans, and masked identifiers — fast answers, no raw row dumps.
The problem
Analytics questions invite full-table scans and “select everything” behaviour. An LLM asked for “revenue by region” may pull every row and leak identifiers along the way, while a single bad query saturates the database.
With OrmAI
OrmAI can restrict an agent to db.aggregate with grouping and row caps, so it computes summaries server-side instead of exfiltrating rows. Budgets reject expensive queries before they run, which usually makes the agent faster too.
The primitives doing the work
Aggregate-first surface
db.aggregate returns grouped summaries; row-level pulls are capped or denied.
Compile-time budgets
Expensive queries are rejected before hitting the database, not after.
Identifier masking
Emails and IDs are masked so summaries never carry raw PII.
The policy, in a few lines
result = await toolset.execute("db.aggregate", {
"model": "Order",
"group_by": ["region"],
"measures": {"revenue": "sum(total)"},
}, ctx=run_ctx) # capped, budgeted, audited Keep reading
Other use cases