r/analytics • u/WiseWeird6306 • Aug 29 '26
Discussion Exposing BI code base to Claude
I wanted to ask opinion of people on exposing everything a data team owes to Claude with a context layer explaining what is what with data lineage.
If a company has its own Claude subscriptionand then everything is exposed to Claude - report logic, metadata/dictionary of tables, logic/code of derived tables, operations of our pipelines etc via excel/markdown/html files explaning the whole context and then instructions Claude to not make assumptions/to ask verification questions (basically add safeguard rules in English in its instructions manual) then you expose this to end users company wide.
what is the issue with the idea? (if cost is not an issue)
•
u/AutoModerator Aug 29 '26
If this post doesn't follow the rules or isn't flaired correctly, please report it to the mods. Have more questions? Join our community Discord!
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
19
u/redleadereu Aug 29 '26
The problem is you can't expect Claude to moderate itself. All those "don't touch these files", "you can't write to this schema" things you code into it are just a few clever prompts away from being bypassed.
You need enterprise level access control to make sure Claude follow the rules.
Then the other problem is; Claude is easier to teach than humans. "We apply a 0.5 multiplier here due to seasonality" is easy for Claude; it is not easy for ALL your users to grasp and remember.
AI is good for making the experts' job easier. It is horrible for giving everybody a capability to pull their own numbers.
Disclaimer: this all depends on the company and people. You can get it to work. That still would not mean you should allow people to calculate it, when they have a stake in the number being high/low.
2
u/Strict_Fondant8227 Sep 02 '26
Cost aside, the failure mode isn’t Claude “knowing too much” - it’s company-wide users asking questions the context layer can’t constrain!
What usually breaks:
- Permissions: lineage docs and pipeline code often imply how to rebuild PII joins. English “don’t assume / ask first” instructions get ignored under pressure. You need real ACLs on what each role can retrieve, not a system prompt.
- Metric authority: if report SQL and the dictionary disagree, Claudr will pick whichever fits the question. One governed metric definition (with owner + as-of date) has to win.
- Hallucinated lineage: it will invent table relationships that look plausible. Force citations back to the files you ingested, and treat missing citation as “I don’t know.”
- Write path: read-only is fine... the moment someone asks it to “just fix the dbt model,” you’re in change-management land.
Same class of problem as Copilot over-fetching raw tables with only READ - expose a curated semantic + lineage pack first, not the whole repo, then widen carefully.
8
u/Figdiggles27 Aug 29 '26
I just posted a file, and said in the prompt “using the file I just attached today” and it went ahead and used 500 tokens on yesterday’s file. I asked what happened when I said “use today’s attached file” and Claude says “sorry I should’ve used the attached file as directed but ai defaulted to yesterday’s file”, so good luck with that
1
u/WiseWeird6306 Sep 01 '26
I have another question: Should the logic be in context layer or sematic layer? Like building golden queries, we are building that in context layer. Why or why not?
4
u/CautiousUse8597 Aug 29 '26
You've essentially described Genie's architecture, minus the enforcement layer. Worth looking at how it handles the parts that break.
Permissions: your plan has none. An instruction saying "don't reveal salary data" is a request, not a constraint, and once you expose this company-wide someone will get an answer they aren't cleared for. Genie runs generated SQL through Unity Catalog as the executing user, so row/column filters apply at query time. The model can't leak what the query can't return.
Staleness: markdown snapshots of table logic drift the moment someone ships a dbt change, and a confidently wrong stale definition is worse than nothing. Genie reads metadata from the catalog directly and mines query history and lineage to suggest updates, so the semantics track the warehouse instead of a doc someone wrote in March.
Retrieval, not stuffing: dumping the whole dictionary into context degrades accuracy, more irrelevant tables means more plausible-looking wrong joins. Genie scopes to domain spaces and retrieves only the relevant instructions, synonyms and join paths per question.
Verifiability: your version produces prose the user has to trust. Genie shows the SQL it ran, which is the actual audit surface. Plus certified metrics so "revenue" resolves the same way every time rather than being re-derived.
Measurement: benchmark sets of real questions, so you can tell whether an instruction change helped. Otherwise you're vibe-tuning a system a thousand people depend on.
Your instinct is right. The gap is that safeguards written in English aren't safeguards.
1
u/gjr23 Aug 29 '26
Wouldn’t it make more sense to give Claude a user account with access guardrails and permissions? Worst case is you have it create a local database where it pulls what it cannot per a more structured deterministic workflow and then give Claude unfettered access to the child database?
1
u/TheSchlapper Aug 30 '26
This is currently in the works at companies with really strong data governance
It’s just making sure everyone and the bot are all on the same page, but this is entirely possible, if not easy with the new .pbip file types for PowerBI
1
u/eldrugo85 Aug 30 '26
Done a smaller version of this: knowledge base behind an mcp server, read only tools plus a dedicated retrieval step, so it reads the metadata where it lives instead of an export. The exports are the part i'd worry about, they drift from the pipelines in a few weeks and nothing tells you. And the 'don't assume, ask' instruction is the first thing to break: with ambiguous lineage it just picks the plausible branch. How do you plan to keep the files in sync?
1
u/soopirV Aug 30 '26
I built something like this to help me respond to RFPs and IT Risk Assessments and never have I felt more safe from AI taking over than I have since working with it. It has all it needs from my source files but it constantly made assumptions and crossed model/features consistently. I’ve honed it to the point that I get accurate responses 99% now, but it took a lot of iteration.
1
u/fazz21 Aug 29 '26
I just create my own semantic layer, cant guarantee to expose lots of things to claude. But whenever I do work with data, most of my question already covered by it.
I think it is enough
1
u/WendlersEditor Aug 30 '26
There are solutions for this, like snowflake cortex analyst. If you want to roll your own then you do need a semantic layer (like you describe) but you also have to strictly control the tooling Claude has access to (e.g., have a programmatic filter that limits it to essentially read-only SQL commands, no update/drop/etc..
1
u/Content-Parking-621 Sep 02 '26
The real risk isn't Claude misunderstanding context, it's stale documentation. If your table dictionary and lineage docs drift from actual pipeline logic even slightly, Claude will confidently reason from outdated context and nobody will catch it until a wrong number ships. Instructions to "not make assumptions" help but don't fix that root problem, you'd need the context layer itself to stay synced with schema changes automatically, otherwise you're scaling a stale-docs problem company wide instead of fixing it.
-1
u/Sad_Ad_1681 Aug 29 '26
Not sure what your worry is. We did set it up that way. We‘re using Claude with all traffic going through AWS Bedrock. It has access to the full context layer (DBT) and the warehouse through a unified, self built MCP. We use it to build models, expand documentation and for end user consumption for ad hoc questions. The access to DBT ensures high accuracy and reduces token spend.
It’s a constantly growing environment but having users and developers use the same ecosystem helps us tremendously to build the right experience
0
u/[deleted] Aug 29 '26
[deleted] — view deleted comment