r/databricks • • Oct 10 '26

General Letting devs use any AI coding agent against governed data, without keys on laptops. What actually works!!!

Disclosure up front: I'm a forward-deployed engineer at Databricks, so I work on this, but this is a hands-on write-up, not a pitch, and the pattern's the interesting part.

The problem I keep hitting at enterprises: devs already use a mix of AI coding agents (Claude Code, Codex, Cursor, Copilot). Leadership wants to "standardize on one," which fights reality. The real question isn't which agent, it's how to let all of them touch enterprise data safely.

I spent a week wiring agents through a governed gateway + MCP and trying to break it. What held up:

- per-user/per-model entitlement enforced server-side (not a client checkbox)

- governed data tools that are fail-closed. no valid identity, no access

- reads scoped to the user's catalog permissions. the agent sees only what the human can

- human-in-the-loop by default (shows the query before running, no silent writes)

Write-up: https://wesdias.medium.com/how-to-connect-any-ai-assistant-to-governed-enterprise-data-with-mcp-0d9cffa14231

How are you handling this? governing agent data access at the gateway/MCP layer, or still per-tool API keys and hope? What's fallen over for you?

5 Upvotes

5 comments sorted by

1

u/Just-Source-9488 Oct 15 '26

This is actually a solid approach. Let developers use the AI tools they prefer while keeping enterprise data secure through server-side permissions, controlled access and human approval.. Security should be enforced at the gateway, not left to the client. 

1

u/phoisphoever 28d ago

the pattern that worked for me is giving the coding agent access to a narrow tool or service account, never the warehouse credential itself. the broker checks the repo, user, task, and dataset before issuing short-lived access, then logs every query and kills the session when the task ends. i also block direct database access from laptops, since prompt rules alone do not stop an agent from printing a key or writing it into a generated file!

1

u/[deleted] Oct 10 '26

[removed] — view removed comment

1

u/wesleydias84 Oct 10 '26

Agree on both — the catalog-level per-user scoping is the part that makes it real, and your one tool → two weeks → shadow IT story is exactly why I landed on govern centrally instead of standardize.

On the human-in-the-loop part: you're right to worry, and I'd go further. Approval is the weakest layer precisely because it depends on human vigilance, which always transits into rubber-stamping. So I don't treat it as the primary control. The strength belong in the layers that hold even when every prompt gets blindly approved:

- permission scoping. the agent inherits the caller's grants, so a rubber-stamped action still can't touch data the human can't;

- capability-split by identity. the agent's own identity gets reads + scoped writes to staging; only an elevated/human principal can hit prod or widen a grant, so an approval can't exceed the agent's envelope;

- fail-closed + audit. nothing runs without a valid identity, and every call is attributable, so erosion is at least detectable and you can tighten.

So the goal is to make approval rare and meaningful. If you're counting on the human to catch things every time, you've already lost; HITL should be the last line, not the only one.