---
title: Discover and govern access to external model providers (model provider services)
description: Discover model provider services and govern access to external providers with Unity Catalog privileges, including offering providers to different teams.
canonical_url: https://docs.databricks.com/gcp/en/ai-gateway/govern-model-provider-services
---

# Discover and govern access to external model providers (model provider services)

Discover the [external model providers](https://docs.databricks.com/gcp/en/ai-gateway/model-provider-services.md) (model provider services) available to you, and govern access to them with Unity Catalog privileges.

## Requirements

* To manage a model provider service, you must have the `MANAGE` privilege on it, or `MANAGE` on its catalog or schema.

## Discover model provider services

A model provider service is a Unity Catalog securable, so it appears in Catalog Explorer under its catalog and schema alongside your other data and AI assets. Use Catalog Explorer to find the model provider services you have access to and inspect their provider type and configuration. The service does not display credentials.

## Govern access with Unity Catalog privileges

Grant or revoke access to a model provider service with the same `GRANT` and `REVOKE` statements you use for other Unity Catalog securables. To query a model provider service, a user needs `EXECUTE` on it and `USE CATALOG` and `USE SCHEMA` on its catalog and schema.

```sql
-- Grant access to a team
GRANT USE CATALOG ON CATALOG main TO ai_team;
GRANT USE SCHEMA ON SCHEMA main.default TO ai_team;
GRANT EXECUTE ON MODEL PROVIDER SERVICE main.default.openai_prod TO ai_team;

-- Revoke access
REVOKE EXECUTE ON MODEL PROVIDER SERVICE main.default.openai_prod FROM ai_team;
```

> [!NOTE]
>
> Privilege and service policy changes can take a few minutes to propagate on query requests. During that time, requests might still use the previous privileges.

Callers query a model provider service without ever seeing its credentials: Unity Gateway attaches the stored credential at request time. Granting `EXECUTE` therefore lets a team use a provider without distributing its API key.

Rotate or replace the stored credential by updating the model provider service. Editing a model provider service requires `MANAGE` on it, held either directly or inherited from the parent catalog or schema. Grant `MANAGE` only to principals you intend to let configure which provider credential the service uses. The service does not return the stored credential in plaintext on read. Updating the service replaces the credential and does not reveal it.

### Providers backed by a service credential

A Google Gemini Enterprise provider can authenticate with a service credential instead of a stored service account key. Access then depends on two objects rather than one:

* Callers still need the same grants as any other provider. Using a service credential adds no requirement: callers need no privilege on the credential itself.
* The model provider service's owner must hold `ACCESS` on the service credential, and must keep it. Databricks re-checks the owner's access when serving requests, so revoking the owner's `ACCESS` disables the provider for everyone, even callers who hold `EXECUTE`.

For how to configure this authentication method, see [Authenticate Google Gemini Enterprise with a service credential](https://docs.databricks.com/gcp/en/ai-gateway/create-model-provider-services.md#gemini-service-credential).

### Providers backed by a Unity Catalog secret

A provider credential can be backed by a customer-owned Unity Catalog secret instead of a stored inline value. Access then depends on two objects rather than one:

* Callers still need the same grants as any other provider. Using a Unity Catalog secret adds no requirement: callers need no privilege on the secret itself.
* The model provider service's owner must hold `READ SECRET` on the Unity Catalog secret, and must keep it. Databricks re-checks the owner's access when serving requests, so revoking the owner's `READ SECRET` disables the provider for everyone, even callers who hold `EXECUTE`.

For how to configure this authentication method, see [Back a provider credential with a Unity Catalog secret](https://docs.databricks.com/gcp/en/ai-gateway/create-model-provider-services.md#uc-secret-auth).

## Offer different providers to different teams

To give different teams access to different providers, create a separate model provider service for each and grant `EXECUTE` accordingly. For example, create one service for a lower-cost provider for general use and another for a premium provider for a smaller group. See [Create and manage providers with Model Provider Services](https://docs.databricks.com/gcp/en/ai-gateway/create-model-provider-services.md).

```sql
-- All users can query the standard provider
GRANT EXECUTE ON MODEL PROVIDER SERVICE ai_platform.default.standard TO `account users`;

-- Only power users can query the premium provider
GRANT EXECUTE ON MODEL PROVIDER SERVICE ai_platform.default.premium TO ai_power_users;
```

Configure different rate limits on each model provider service to manage capacity and cost. See [Apply rate limits to model and MCP services](https://docs.databricks.com/gcp/en/ai-gateway/rate-limits.md).

## Govern the content of interactions

> [!NOTE]
> **Beta**
>
> Service policies are in [Beta](https://docs.databricks.com/gcp/en/release-notes/release-types.md). Unity Gateway is generally available, but service policies are enabled separately. Workspace admins can control access to service policies from the **Previews** page by opting into the **Unity Gateway Service Policies** preview. See [ Manage workspace-level previews](https://docs.databricks.com/gcp/en/admin/workspace-settings/manage-previews.md#workspace).

Unity Catalog privileges determine whether a principal can query a model provider service. To govern how each interaction proceeds, for example, to block a response that contains unsafe content or sensitive data, attach a service policy to the model provider service. Service policies are how you implement guardrails: built-in guardrails cover common risks such as sensitive data, prompt injection, and unsafe content, custom policies enforce rules specific to your organization, and external service policies enforce a third-party guardrail vendor's decisions.

A model service that is backed by a model provider service runs only its own policies. The model provider service's policies run only when a caller queries it directly. To govern both paths, attach the policy to both services.

> [!NOTE]
>
> `ASK` approval is available only for MCP Services during the input phase. If a custom SQL or Python policy returns `ASK` for a Model Provider Service, Databricks blocks the request or response because Model Provider Services cannot ask the user for approval.

> [!NOTE]
>
> An [unmanaged passthrough request](https://docs.databricks.com/gcp/en/ai-gateway/query-model-provider-services.md#query-an-unmanaged-path-passthrough) returns HTTP 400 before forwarding when the service has any attached policy, including a policy in Log mode. Without an attached policy, **Forward all URL paths** forwards the request to the provider. Policies evaluate only the provider's [supported API paths](https://docs.databricks.com/gcp/en/ai-gateway/query-model-provider-services.md#query-supported-apis).

To learn about service policies and attach one, see:

* [Service policies for AI securables](https://docs.databricks.com/gcp/en/data-governance/unity-catalog/service-policies/index.md) for concepts, built-in guardrails, and evaluation model.
* [Create and attach a service policy](https://docs.databricks.com/gcp/en/data-governance/unity-catalog/service-policies/create-service-policy.md) for how to write a policy function and attach it to a service.
* [Enforce a partner guardrail with an external service policy](https://docs.databricks.com/gcp/en/data-governance/unity-catalog/service-policies/external-policies.md) for how to enforce a third-party guardrail vendor's decisions on a service.

## Next steps

* [Model providers external to Databricks](https://docs.databricks.com/gcp/en/ai-gateway/model-provider-services.md)
* [Create and manage providers with Model Provider Services](https://docs.databricks.com/gcp/en/ai-gateway/create-model-provider-services.md)
* [Query external model providers (model provider services)](https://docs.databricks.com/gcp/en/ai-gateway/query-model-provider-services.md)
* [Track model usage](https://docs.databricks.com/gcp/en/ai-gateway/usage-tracking.md)
