Contextflo Blog

Why ACL is the most underrated piece of an agentic analytics setup

Access controls aren't just for governance. In agentic analytics, ACL narrows the agent's context, making queries more accurate and cheaper to run.

June 9, 20264 min readVivek Sah

Access control lists get treated as a compliance checkbox. Something you bolt on before an enterprise deal closes. But if you're building agentic analytics, ACL is doing something far more valuable than governance: it's making your agent smarter.

The governance case (what everyone already knows)

When you connect an LLM to your data warehouse, it uses a single service account. Everyone gets the same access. The marketing intern and the finance director run queries with identical permissions. You need access controls to prevent unauthorized data access. This is table stakes for any production deployment.

Most teams get this. It's the first thing security reviews flag. But if governance is all you see in ACL, you're missing the bigger opportunity.

The part people miss: ACL as context narrowing

Anthropic recently published their approach to building self-serve analytics internally. One of the hardest problems they describe is context navigation: how does the agent find the right tables and metrics to answer a question when it's looking at hundreds or thousands of options?

Their solution is a sophisticated retrieval skill system. Domain-specific context gets loaded on demand through routing logic that decides which tables and metrics are relevant before the agent starts writing SQL. It works. But it's complex engineering, and it costs tokens at every query because the routing itself requires LLM calls.

There's a simpler way to achieve much of the same narrowing: access control rules. If someone in marketing only has access to marketing tables, the agent's search space is already scoped before it starts reasoning. No retrieval step needed for that narrowing. No routing logic. No extra tokens spent figuring out which domain the question belongs to.

This has real advantages over retrieval-based narrowing:

  • Deterministic. Retrieval can fail, returning irrelevant context or missing the right tables. ACL-based scoping cannot. The boundaries are set before the agent runs.
  • Token-cheap. No routing LLM call, no embedding lookups, no context selection logic consuming tokens on every query.
  • Already required. You need ACL for governance anyway. Getting context narrowing as a side effect means you're solving two problems with one mechanism.

Less context means fewer irrelevant tables. Fewer irrelevant tables means the agent spends less time reasoning about what's relevant and more time answering the question. The answers get better because the agent isn't distracted by tables it shouldn't be considering in the first place.

ACL layer scopes a marketing user to only marketing tables, blocking access to other teams' data

For power users who need cross-domain access (a CEO, a data admin, an analyst who works across teams), you layer additional context management on top. But for the 80% of users who work within a single domain, ACL handles the narrowing automatically. The expensive retrieval infrastructure becomes an optimization for edge cases, not a requirement for every query.

How Contextflo implements this

Contextflo sits between the LLM and your data warehouse. Your warehouse keeps a single service account. Governance and context scoping happen at the Contextflo layer.

Without an access layer, every user gets the same unrestricted access to the data warehouse through a single service account

Without an access layer, every user gets the same unrestricted access and the agent sees every table.

Contextflo adds a governance layer between your users and your warehouse, enforcing access groups and scoping agent context

With Contextflo, access groups scope what the agent discovers per user.

Access groups

Admins define who sees which tables using namespace patterns. Allow marketing tables, deny finance tables. New users inherit defaults from their group. Deny always takes precedence. No per-user warehouse credentials to manage.

Context scoping from the start

When a user asks a question, the agent calls Contextflo's discovery endpoints to find relevant tables and metrics. Contextflo applies the user's ACL rules and only returns resources the user is permitted to access. The agent never sees tables outside the user's scope, so it cannot reference or hallucinate data it doesn't know exists.

“What's our CAC by channel this quarter?”

Asked by a marketing analyst

What happens:

  1. The agent calls Contextflo's discovery endpoint to find relevant tables and metrics
  2. Contextflo checks the user's access group and returns only marketing tables: spend, campaigns, attribution
  3. Finance, HR, and sales compensation tables are never returned, so the agent doesn't know they exist
  4. The agent writes the SQL, calls Contextflo's query endpoint to execute it, and returns the answer

Contextflo serves the discovery and query endpoints. The agent does the reasoning and execution. Fewer tables in the agent's context means less ambiguity and faster, more accurate answers.

Query logs

Every interaction is logged: the question asked, the SQL generated, the tables accessed, and the result returned. Admins have full visibility into what each user and team is querying, making it straightforward to spot context gaps and refine business definitions over time.

Start with ACL from day 1

ACL is not just a governance feature. It narrows the agent's context, which directly improves accuracy and reduces token costs. If you are setting up agentic analytics, build ACL in from day one. You need it for governance anyway, and it makes the agent better at its job.

Related reading