Analytics as a Data Primitive Not a Product for Teams Building on AI Stacks
Agents need governed, shared metric definitions, not another dashboard.

For API-first and agent-first teams, the right analytics backend is a headless, governed data layer that exposes shared metrics through APIs and MCP without requiring an opinionated frontend. Analytics must move from a dashboard product to a data primitive. With that architecture, teams can add usage analytics to an AI agent without a prebuilt dashboard UI, and humans and agents get the same definitions.
Why analytics infrastructure becomes load-bearing when AI agents enter the stack
A human who misreads a dashboard can notice the mistake and reconsider a decision. An agent acting on a stale or mis-defined metric at machine speed may execute before anyone can intervene. Traditional analytics assumes a person opens a dashboard, interprets a number, and decides what follows. Autonomous agents skip that review step as they run many queries and act on the results.
A snapshot from hours ago may show the business as it was then but give an agent the wrong basis for a decision now. Consistent definitions and scoped access become equally consequential because their failures now enter an execution path. A mismatched metric now affects more than a misleading chart, and an overly broad credential gives access to more than a person who chooses each request.
When definitions and queries exist only inside a dashboard or reporting add-on, agents lack a stable interface to that analytical model. They either cannot reach the data they need or fall back to querying production directly. The latter route exposes transactional systems through credentials that were not necessarily scoped for autonomous use.
What MCP standardized — and what it deliberately left unsolved
MCP replaces the N×M integration problem with an interface that agents and data sources share. Previously, each agent-framework and data-source pairing required a bespoke integration. Anthropic introduced MCP, which moved to the Agentic AI Foundation under the Linux Foundation. Support spans Claude, ChatGPT, Gemini, Microsoft Copilot Studio, and Cursor.
The 2026-07-28 specification made MCP stateless at the protocol layer, so remote servers can run behind a plain round-robin load balancer without needing sticky sessions, a shared session store, and deep packet inspection at the gateway. Its three primitives are Tools, Resources, and Prompts. Tools can run queries, Resources can supply governed context such as schemas and datasets, and Prompts provide reusable templates for analytical workflows.
A protocol that faithfully delivers everything an underlying credential can reach is a pipe. The access decision must account for the specific agent, requesting user, and task. That decision belongs in a governed layer between the agent and raw data, rather than being inferred from the existence of a working connection.
The governance gap that connectivity alone cannot close
The common failure begins with a credential that unblocks a pilot. Once the pilot succeeds, its access scope goes unrevisited, leaving an autonomous consumer with permissions granted for an earlier experiment. Recorded Future’s research identifies agents accumulating standing access that was never meant to be permanent. This is a predictable outcome when teams treat a working connection as the goal for deployment and leave authorization for later.
A shared credential gives the agent everything the connection can reach, while a governed MCP server limits access to what the requesting user is entitled to see. When long-lived credentials have no expiration or per-request checks, their broad connection permissions give agents standing access. Authorization must precede execution. Even with model alignment and retrospective evaluation, deterministic enforcement is needed at the tool-call boundary.
The Open Agent Passport paper, published on arXiv in March 2026, describes the need to authorize agent actions before execution. Its adversarial testbed found that social engineering succeeded in 74.6% of attempts under a permissive policy, while a comparable population of attackers achieved no successes under a restrictive pre-action policy. That result distinguishes enforcement from reliance on model behavior. Structured, tamper-proof audit transcripts must also come from infrastructure. Together, these controls make governed analytics reliable enough to act on, rather than adding administrative overhead to an otherwise complete system.
Why metric drift is the silent failure mode that governance must prevent
Correct permissions do not guarantee a correct analytical answer. Two consumers can read records they are entitled to see and still report contradictory results. Consider an engineer who calculates Q2 revenue with SUM(revenue) while another uses SUM(amount_captured). Both queries may read valid records, but the answer depends on which definition runs. Access control cannot resolve that disagreement.
An agent connected directly to tables introduces another interpretation unless a shared semantic layer constrains what revenue means. The agent’s answer and the CFO’s dashboard can then diverge on identical source data. Nothing needs to fail visibly for trust to erode. The records remain available, queries return results, and each consumer presents a number that appears authoritative.
A data dictionary provides the minimum foundation for agreement. Every metric needs a documented source, a single definition, and organizational agreement about its meaning. To make that agreement operational, metrics should be pre-calculated and modeled into governed datasets.
A dashboard can enforce definitions within its own interface without making those definitions available to an agent over MCP. The correction is to put the analytical meaning in shared infrastructure.
What analytics-as-a-primitive looks like architecturally
The design pattern has four layers with distinct responsibilities. The Data Substrate supplies verified, permissioned, refreshable data with documented provenance. The Reasoning Layer supplies semantic schemas, governed metric definitions, and documented relationships. This is where revenue acquires its canonical meaning. Separating these responsibilities distinguishes confidence in the underlying records from agreement about what those records measure.
The Delivery Layer exposes the governed definitions through APIs and MCP endpoints without exposing the production database. The Decision Layer connects those results to an action, an owner, and an outcome. Its outputs can include reports pushed to Slack, workflow alerts, or an agent acting on a pre-modeled KPI. Each layer has a separate job to perform. MCP provides transport, and a server exposing permissioned raw tables remains a scoped pipe.
One concrete implementation uses governed Parquet datasets queried through DuckDB. Agents query that copy instead of production, and the query engine absorbs analytical work without consuming the transactional connection pool. The stateless specification fits this separation because each tool call is a discrete HTTP request with its own authentication context. Rate limits and per-agent quotas can be enforced at the MCP server.
Enterprise platforms illustrate the direction without prescribing a vendor stack. Salesforce Headless 360, announced at TrailblazerDX on April 15, 2026, exposed Salesforce data, workflows, and business logic through APIs and MCP tools, with more than 60 new MCP tools at launch. Informatica announced fully headless data management through native MCP support at Informatica World 2026, held May 19–21, 2026, in Las Vegas. Its scope included metadata search, data quality checks, and lineage tracking through IDMC.
Why Supabase and Postgres teams face this problem earliest and most concretely
Supabase makes direct database access especially tempting because Postgres is already present and row-level security is already configured. Adding an MCP connection can seem to complete the integration. Analytical queries hold connections longer than transactional queries, creating connection-pool exhaustion risk, while agents using service-role credentials bypass row-level security entirely. These are separate failures, and correcting one does not correct the other.
Even when RLS is set up correctly, teams need to check how queries run. Calling auth.uid() directly can cause evaluation for every row because the planner may not optimize the bare STABLE function call in certain RLS plan shapes. Wrapping it as (select auth.uid()) lets the planner evaluate it once. On large tables, that distinction can separate a millisecond query from a timeout. RLS configuration alone is therefore not evidence that an analytical workload is ready for scale.
For teams approaching this decision, the recommended pattern separates analytical work before it compromises transactional traffic. DuckDB against Parquet or a read replica can absorb that work while each MCP request retains its own authentication context. Visibility must begin before a user-facing performance problem appears. p50/p95 latency dashboards need query-level detail, connection-level activity and waiting, and system-level CPU, memory, IO, and replication lag.
The pg_stat_statements extension is a place to start when checking what is wrong with a query. Available on most managed Postgres but requiring explicit enablement, it records mean and total execution time and call count for each query. A critical query’s p95 latency exceeding its threshold signals the need to move expensive reporting work to a replica, a materialized view, or a governed analytical copy outside the transactional path.
What analytics backend works best when you want full API control and no opinionated frontend?
Headless analytics names the architecture that separates governed analytical data from any single frontend. Its backend exposes shared metric definitions and datasets through APIs and MCP endpoints, while dashboards and agent workflows remain consumers. A database with an API provides access to records, but headless analytics also provides the agreed meaning of the numbers derived from them.
Headless CMS offers a direct architectural parallel. It separated content management from presentation so the same content could reach different frontends. Headless analytics keeps metric definition and governance separate from how numbers are shown, so a dashboard, agent, Slack report, and API caller can all get the same governed numbers. MCP makes the backend reachable across agent frameworks, while pre-modeled data makes its answers consistent.
For API-first and agent-first teams, the selection criteria follow from that separation. The backend needs raw API access to governed datasets and metrics, shared definitions across consumers, scoped authorization, and analytical workload isolation from production. A prebuilt dashboard is not the defining capability. Usage analytics for an agent can be delivered through the same interfaces without requiring a dashboard UI or allowing the agent to invent its own metric logic.
Human delivery can also become push-first, with pre-calculated metrics reaching inboxes, Slack, and mobile without duplicating definitions for each destination. For startups and growing teams, a governed layer extending an existing Postgres project can serve both human and agent workflows. That pattern can replace the need for a dedicated data team establishing a separate warehouse.
What designing analytics as a primitive requires teams to decide upfront
Metric ownership must be settled before granting agent access. ARR, churn, and active users each need a canonical definition in a data dictionary with a single source of truth. Otherwise, sales, finance, product, and agents can compute competing versions of business performance. Agreement must precede automation of those calculations. The governed dataset is where that agreement becomes consumable across interfaces.
Teams also need to set up workload separation and agent identity before going into production. Analytical traffic should be separated from transactional traffic at the data layer before an incident. Each agent should be an independent, identity-bearing entity with scoped, time-bound permissions. Those choices establish both the execution path and the permission boundary. Neither should depend on which dashboard or agent framework happens to request the data.
Audit infrastructure must be ready at the same point. Agent-data interactions need tamper-proof transcripts collected by infrastructure, because records an agent can modify or omit cannot establish dependable provenance. For people, teams should favor pushing pre-calculated metrics to Slack, email, or mobile over waiting for someone to open a dashboard.
These decisions belong together because each constrains how shared data becomes action. Making them once in the data layer avoids implementing metric meaning, permissions, and delivery separately for every consumer. One governed data layer replaces a patchwork of tools with competing definitions with a common foundation that humans and agents can use without disagreeing about what the numbers mean.


