The reason the two calls behave differently is that databricks-* and system.ai.* are separate serving and authorisation paths, and only the system.ai.* path runs through Unity Catalog.
- system.ai.claude-sonnet-4-5 resolves to a UC model service, so your EXECUTE revoke applies and the call fails as expected.
- databricks-claude-sonnet-4-5 resolves to the legacy default Foundation Model API serving endpoint. Direct calls to it don't pass through UC model-service authorisation, so revoking EXECUTE on system.ai never touches it.
The feature and how to enable it
In the Account Console it's listed under Previews as "Foundation Model Permissions" (account-level). An account admin toggles it on there and it takes effect immediately. If the toggle isn't visible, we can get it enabled for you from our side. Once it's on, revoking EXECUTE on system.ai is enforced across the UC-governed paths: ai_query, the AI Playground, and the newer gateway endpoints.
One thing to flag: enabling the feature covers newly created model services automatically, but it doesn't retro-fit services that already exist. For those you'll need to revoke EXECUTE per model service. New models landing in system.ai also grant EXECUTE to all users by default.
Enforcing consistently across all paths
1. Revoke EXECUTE at the catalog, schema and securable level (all three), scriptable through the UC Grants API.
2. Enable Foundation Model Permissions so new models don't quietly re-open access.
3. Allow-list the models you do want, either by re-granting EXECUTE per approved model service, or with an ABAC grant policy (grant everything except models carrying a "blocked" tag).
4. The legacy default databricks-* endpoints are the one path UC can't reach. To close them fully, speak to your account team (if you have one) to disable those specific Foundation Model API endpoints for your workspaces, or you migrate that traffic onto Unity Gateway where it's UC-governed.
Does serverless compute bypass Unity Catalog?
No. Serverless SQL and serverless compute enforce Unity Catalog in full. Serverless didn't ignore UC here: your ai_query("databricks-…") call routed to the legacy serving endpoint, which sits outside UC authorisation. Enabling Foundation Model Permissions and dealing with the legacy endpoints closes that gap.
Reference: Foundation model Unity Catalog permissions — docs.databricks.com/machine-learning/foundation-model-apis/model-uc-permissions