Unity Catalog Governance and Security
Decide which identity acts, what it may touch and how you will prove it, before the agent answers anything.
Unity Catalog is where permissions for tables, functions, search indexes and other agent resources are granted and recorded. An agent acts either with its own service principal or on behalf of the user, where that option is enabled. Safe designs grant the smallest set of privileges, expose actions as narrow functions, test with real identities and keep lineage and audit records that someone actually reads.
What you will learn: the object model, the privileges an agent needs, functions as tools, the two authorization styles, fine-grained controls, governance of MCP and model services, secrets, lineage, audit and security testing.
Prerequisites: Agent Identity, Authorization and Secrets and Tool Permissions, Approvals and Abuse Risks.
The example runs in November 2026 with Python 3.13 and only the standard library. It models a simplified permission check with invented names and is not Unity Catalog's evaluation logic. Platform facts come from Databricks documentation checked on November 28, 2026. This is defensive, general guidance; confirm behavior and compliance needs with your own security team. OneSmartClick is independent of Databricks.
The object model
Unity Catalog organizes governed objects in three levels: a catalog contains schemas, and a schema contains objects such as tables, views, volumes, functions, models and indexes. Other securable objects, such as connections to external services, sit alongside them. A name such as main.support.tickets reads as catalog, schema and object.
What an agent needs to read or run
Reading an object usually needs permission on its parents as well as on the object. Documentation for agent resources gives examples such as these:
| Resource | Documented permission examples |
|---|---|
| Table or AI Search index | USE CATALOG and USE SCHEMA on parents, plus SELECT |
| Catalog function | EXECUTE, with parent usage privileges |
| SQL warehouse | Can Use |
| Model serving endpoint | Can Query |
| Genie Agent | Can Run |
| Databricks App used as a tool | Can Use |
| External connection | USE CONNECTION |
The agent authentication documentation also says that when you grant access to resources you must grant permissions on downstream dependencies. Granting an agent use of a Genie Agent, for example, is not enough without its tables, warehouse and functions. Keep the list of dependencies with the agent's definition so that reviews see the whole reach.
Least privilege in practice
- Create one service principal for each application, not one shared by all agents.
- Grant on specific schemas or objects, not on whole catalogs for convenience.
- Give read access first, and add each write ability separately with a reason.
- Use views to expose only the rows and columns the task needs.
- Separate development, test and production catalogs and identities.
- Remove grants when a tool is removed, and review them on a schedule.
Broad grants are tempting while debugging. Make temporary grants expire or record them as work to undo, because they otherwise become permanent.
Catalog functions as agent tools
A function registered in Unity Catalog can be offered to an agent as a tool, directly through a toolkit in code or through the managed MCP server for functions, whose address names a catalog, schema and function. This gives the tool an owner, permissions and lineage in the same place as the data.
A good tool function is narrow:
- It does one task, such as returning the status of one order.
- Its parameters are typed, limited and validated.
- It returns only the fields the agent needs.
- Its comment explains when to use it and when not to, because the model reads it.
- It cannot be turned into a general query by crafted input.
Never build SQL text by concatenating model output. Python functions deserve extra review: ask what network access, libraries and secrets they can reach. Verify under which privileges a function body runs for the function type you use, and treat everything it can read or change as part of the tool's reach. Tool schema design covers names and descriptions.
Two ways to authorize
The documentation describes two styles for custom agents on Databricks Apps.
| Aspect | App authorization | User authorization |
|---|---|---|
| Acts as | The application's service principal | The person making the request, formerly called on-behalf-of |
| Reach | Same for every user | Follows each user's catalog permissions, limited by scopes |
| Good for | Shared reference data and background work | Personal or restricted data and per-user audit |
| Main risk | A user obtains data they could not read directly | Actions taken with a person's authority that they did not intend |
Scopes limit what the application may do for a user; the user's own permissions limit which data that reaches. Release status deserves care: the agent authentication page described user authorization as a public preview that an administrator must enable, while a Databricks announcement for Databricks Apps described it as generally available. Confirm the current status for your cloud and your exact resource types.
Choosing per tool
One agent can use both styles. Ask for each tool: if a user without access asked for this, should they get it? If the answer is no, the call needs the user's identity, or an explicit and tested check in code before it runs. An application identity with broad read access plus a prompt that says "only show users their own records" is not access control. A persuasive request or planted text can defeat it, as prompt injection describes.
Find the missing grants
The program checks an application identity and a user against three requests, including a Genie Agent with dependencies.
"""Work out whether an agent request would be allowed, and what is missing."""
NEEDS = {"table": "SELECT", "function": "EXECUTE",
"genie_agent": "CAN RUN", "warehouse": "CAN USE"}
GRANTS = {
"sp-support-agent": {
("main", "USE CATALOG"), ("main.support", "USE SCHEMA"),
("main.support.tickets", "SELECT"),
("main.support.ticket_age", "EXECUTE"),
("genie:refunds", "CAN RUN"),
},
"priya": {
("main", "USE CATALOG"), ("main.support", "USE SCHEMA"),
("main.finance", "USE SCHEMA"),
("main.finance.payments", "SELECT"),
("genie:refunds", "CAN RUN"), ("warehouse:serving", "CAN USE"),
},
}
# Resources that a resource depends on. Grant these as well.
DEPENDS = {"genie:refunds": [("table", "main.finance.payments"),
("warehouse", "warehouse:serving")]}
def missing(principal, kind, name):
required = [(name, NEEDS[kind])]
if kind in ("table", "function"): # parents are needed too
catalog, schema, _ = name.split(".")
required = [(catalog, "USE CATALOG"),
(f"{catalog}.{schema}", "USE SCHEMA")] + required
return [f"{priv} on {obj}" for obj, priv in required
if (obj, priv) not in GRANTS.get(principal, set())]
def check(principal, kind, name):
gaps = missing(principal, kind, name)
for dep_kind, dep in DEPENDS.get(name, []):
gaps += [g + " (dependency)"
for g in missing(principal, dep_kind, dep)]
return gaps
REQUESTS = [("table", "main.support.tickets"),
("function", "main.support.ticket_age"),
("genie_agent", "genie:refunds")]
for who in ("sp-support-agent", "priya"):
print(who)
for kind, name in REQUESTS:
gaps = check(who, kind, name)
print(f" {name}: {'allowed' if not gaps else 'denied'}")
for gap in gaps:
print(f" missing {gap}")
Output:
sp-support-agent
main.support.tickets: allowed
main.support.ticket_age: allowed
genie:refunds: denied
missing USE SCHEMA on main.finance (dependency)
missing SELECT on main.finance.payments (dependency)
missing CAN USE on warehouse:serving (dependency)
priya
main.support.tickets: denied
missing SELECT on main.support.tickets
main.support.ticket_age: denied
missing EXECUTE on main.support.ticket_age
genie:refunds: allowed
The application identity can use the Genie Agent object but lacks what the agent depends on, so the request would fail until someone grants it. Before adding those grants, a reviewer should ask whether this support application ought to reach payment data at all. The user result is the mirror image: she can use the Genie Agent and its data but has no direct access to the ticket table. Run checks like these as tests in your delivery pipeline, using real permission queries rather than this model.
Rows, columns and views
Row filters and column masks apply rules inside the data layer, so that two users running the same query can see different results. Documentation for Databricks Apps notes that with user authorization, catalog policies such as row and column filtering are enforced for that user. Test the rules with the identity that will actually run in production. A rule that references the current user behaves differently under a service principal, which may then see everything or nothing. Aggregates can still reveal individuals in small groups, so set minimum group sizes where this matters.
Classify and tag data
Agents widen access to whatever they can search. Before indexing or granting, label data by sensitivity and purpose, exclude what the task does not need and note legal or contractual limits. Tags help policies and reviews find sensitive columns. Classification also guides logging: if a column is sensitive, its values should not appear in traces without a decision. See preventing data leakage and lineage and governance.
MCP services and external tools
Documentation describes MCP services as Unity Catalog securables that are invoked through Unity Gateway, so that grants control who can use them and policies can control individual calls. External tools are reached through services or connections governed in the catalog. Coverage varies by endpoint: one page notes that some workspace MCP endpoints, including the one for a single Genie Agent, rely on permissions on underlying resources without gateway governance. Inventory every endpoint your agent calls and record which controls apply to it.
A tool that reads text written by outsiders, combined with a tool that can send data out or change records, creates a path for injected instructions. Separate these abilities, restrict destinations and require approval for consequential actions.
Secrets and network paths
- Prefer short-lived platform credentials and catalog connections to keys in code.
- Store remaining secrets in a secret manager and keep them out of prompts, traces and repositories.
- Restrict outbound network access for agent compute and code sandboxes to what is needed.
- Rotate credentials, and know how to revoke one agent's access quickly.
Govern models and endpoints too
Permissions also decide who may call models and which models are available. Limit endpoints to approved groups, apply rate limits and policies through the gateway and treat payload tables as sensitive data with their own grants. An agent that cannot read a table directly should not be able to read it through a log of someone else's conversation. See serving and gateway.
Memory is data
Databricks announced a managed agent memory service in beta that stores memories in Unity Catalog memory stores, governed as securable objects with scoped isolation. Whatever store you use, decide who can write a memory, who can read it, how long it lasts and how a person's memories are deleted. Memory written from untrusted content can mislead later sessions. Memory security explains the controls.
Lineage and audit
Lineage shows how data flows between tables and into downstream assets, which helps answer which agents a changed or contaminated source affects. Audit logs record access and administrative actions. Neither replaces application traces, which explain why an agent made a call. Join the three with identifiers: request, user, application, tool call and data object. Check what each source actually captures for your resource types, and set retention long enough for investigations but no longer than your rules allow.
Security testing
| Test | Expected result |
|---|---|
| User without access asks for restricted data | Refused by the data layer |
| Same question through every tool and index | No route reveals it |
| Planted instruction in a document | No unauthorized call succeeds |
| Crafted tool parameters | Rejected by validation |
| Revoked user or principal | Access stops within the expected time |
| Development identity against production | Denied |
Pay attention to derived copies. A search index, cache, memory store or evaluation dataset may hold content whose source permissions it does not repeat. Check each copy separately. A secure reference architecture puts the layers together.
A grant review that works
- List every identity used by the agent and every resource it can reach, including dependencies.
- Compare with the tools actually called in recent traces.
- Remove unused grants.
- Ask the data owner to confirm the remaining ones.
- Record the date, reviewer and next review.
Separate environments and domains
Catalogs are a convenient boundary. A common layout uses separate catalogs for development, staging and production, sometimes split further by business domain. Development identities get no production grants. Test data should be synthetic or properly masked, because copying production tables into development quietly removes the protection the catalog was providing. Bind catalogs to the workspaces that should use them where your platform setup allows it, and promote objects through your delivery pipeline instead of granting people direct access to repair production.
Ownership matters as much as layout. Every schema should have a group as owner, so that it does not become unmanaged when one person leaves. The owner approves new grants and learns which agents depend on the data.
If an agent misbehaves
- Disable the affected tool or application, or revoke the principal's grants.
- Preserve traces, audit records and the versions that were running.
- Determine which data was read and which actions were taken, by which identity.
- Check derived copies such as indexes, memory and logs for exposed or poisoned content.
- Notify owners and follow your incident and privacy process.
- Fix the grant or tool design, and add a test that would have caught it.
Rehearse the first step. Revoking one agent should not require disabling every other application that happens to share its identity, which is one more reason for separate principals. Red teaming and incident response describes exercises.
Common mistakes
| Mistake | Consequence | Instead |
|---|---|---|
| Relying on the prompt for access rules | Rules can be talked around | Enforce in data and tools |
| One principal for all agents | No isolation or clear audit | One per application |
| Catalog-wide grants | Reach far beyond need | Object or schema grants |
| Forgetting dependencies | Failures or unnoticed reach | List them with the tool |
| Testing as an administrator | Faults hidden | Test real roles |
| Ignoring copies of data | Permissions bypassed | Govern indexes, logs and memory |
Checklist
- Each application has its own identity with reviewed grants.
- Every tool states whose identity it uses and why.
- Functions are narrow, validated and owned.
- Row and column rules are tested with production identities.
- MCP endpoints and connections are inventoried with their controls.
- Payload tables, indexes and memory have their own permissions.
- Revocation and shutdown have been rehearsed.
Frequently asked questions
Does Unity Catalog stop prompt injection?
No. It limits what an identity can access or run, which limits the damage. Content handling, tool design and approvals address other parts of the risk.
Should agents always act as the user?
Use it where results depend on individual rights. Background jobs and shared reference data can use an application identity if its reach is acceptable for every user.
Is a view enough to protect columns?
It helps if the identity can read only the view. Confirm that no other grant, index or copy exposes the underlying columns.
How often should grants be reviewed?
Set an interval that matches the risk, and also review whenever tools, data sources or owners change.
References
- Databricks: authentication for agents
- Databricks: authorization in Databricks Apps
- Databricks: managed MCP servers
- Databricks: platform release notes
Where to go next
AI Search, Features, Lakebase and Lakeflow
Govern search, features and state.
Agent Threat Model and OWASP Agentic Risks
Model threats before granting access.
Deployment, CI/CD and Troubleshooting
Manage grants through delivery.