CertLumen

Databricks Generative AI Engineer Associate · Section 4 · 22% of the exam

Control access to resources from model serving endpoints

One of the objectives of the Databricks Certified Generative AI Engineer Associate exam, in the section “Assembling and Deploying Applications”. Here is what it covers, the points to remember and a question to try.

What it covers

An LLM application calls Foundation Model API endpoints, runs on its own serving endpoint or app, authenticates to the Databricks resources it uses, and reaches users through an interface. This lesson covers the serving options, the three authentication methods for serving endpoints, when to use ai_query() for batch inference instead of a real-time endpoint, and how to pick a user interface such as Databricks Apps, Slack or Microsoft Teams.

Points to remember

  • Foundation Model APIs: pay-per-token (prototype and moderate traffic), provisioned throughput (guaranteed throughput, fine-tuned models, compliance), AI Functions for batch.
  • Serve the application separately: log, register in Unity Catalog, deploy (agents.deploy() for agents). It then calls the Foundation Model API endpoint.
  • agents.deploy() sets up the endpoint, short-lived credentials, the Review App, tracing and inference tables. A new version of the same UC model updates the same endpoint.
  • Automatic passthrough: declare resources when logging. A system service principal per model version gets short-lived OAuth credentials, and the deployer's access is verified.
  • On-behalf-of-user (Public Preview): UserAuthPolicy(api_scopes=...), ModelServingUserCredentials, create the client inside predict. Needs MLflow 2.22.1+ and admin enablement.

Try a question

An agent combines a retriever with a Genie Agent (formerly Genie space) for sales metrics. It was logged with resources=[DatabricksVectorSearchIndex(...), DatabricksServingEndpoint(...), DatabricksGenieSpace(genie_space_id="01f0...")] and deployed with agents.deploy(). Retrieval works, but every Genie call fails with permission errors on the Genie Agent's tables and SQL warehouse, although the deployer can ask the same questions in the Genie UI. What should the team do?

  1. ASwitch the agent to on-behalf-of-user authentication, because Genie Agents don't support automatic passthrough
  2. BSet DATABRICKS_TOKEN to the deployer's personal access token in the endpoint's environment_vars
  3. CGrant CAN QUERY on the agent's serving endpoint to the owner of the Genie Agent
  4. DAlso declare the Genie Agent's tables and SQL warehouse as DatabricksTable and DatabricksSQLWarehouse resources, then log and deploy again
Show the answer

D. With automatic authentication passthrough, the service principal created for the model version gets access only to the resources declared at logging time. A Genie Agent queries its own tables through a SQL warehouse, so those dependencies must be declared too (plus any UC functions it uses). Databricks then verifies that the endpoint creator can access them and grants the service principal access.

Written for practice in the style of the exam: never a question from the real exam.

In the course

The lesson Serving, securing and exposing LLM applications teaches this objective (about 55 minutes), and 15 practice questions test it. The course has lessons, exam-style questions, timed practice exams and an AI tutor for every objective, and a pass prediction that tells you when you're ready to book.

More in this section

← Previous objective · All 56 objectives · Next objective →