Courseiva
Design Applications →mediumMultiple Choice

Databricks-GenAI-Assoc Design Applications Practice Question

Which design pattern is best for protecting the LLM from prompt injection attacks when building a customer-facing chatbot on Databricks?

⚠ Common exam trap

Candidates often assume that prompt engineering or system instructions are sufficient to prevent injection, forgetting that malicious users can easily bypass these through prompt manipulation.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

Using a guardrail service to validate and sanitize user inputs.

Implementing an input-filtering layer using a separate, lightweight classification model or guardrail service effectively detects and blocks malicious prompts before they reach the LLM. This proactive defense is vital for securing AI applications, as prompt injection can lead to unauthorized data access or malicious behaviors. This layering approach creates a defense-in-depth architecture that keeps the generative model safe from adversarial inputs.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Embedding all user inputs into the vector database.

    Why it's wrong here

    Embedding user inputs is for retrieval, not security. It does not provide any protection against malicious prompt injections. In fact, injecting user input into a vector store could be a vector for secondary attacks, as the system might retrieve and treat the malicious data as legitimate context.

  • ✓

    Using a guardrail service to validate and sanitize user inputs.

    Why this is correct

    Guardrail services or classification models act as a security gateway, analyzing inputs for patterns indicative of injection attacks. By blocking or sanitizing these inputs before they are passed to the primary LLM, the system prevents unauthorized instructions from executing, which is a foundational requirement for securing public-facing chatbots.

  • ✗

    Relying on the LLM’s internal safety training to reject injections.

    Why it's wrong here

    While many modern LLMs have safety training, they are not impervious to sophisticated prompt injection attacks. Relying solely on the model's self-moderation is a security anti-pattern. An explicit, externalized security layer is necessary to ensure consistent and enforceable protection against adversarial inputs that could compromise the application.

  • ✗

    Sending all inputs through a standard SQL query first.

    Why it's wrong here

    SQL queries are for data retrieval and do not have the logic required to detect natural language injection attacks. Passing data through a SQL interface is irrelevant to the security of the LLM itself and does not protect against malicious prompts that are intended to manipulate the generative response.

About these practice questions

This Databricks-GenAI-Assoc question is part of Courseiva's 330-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official Databricks exam blueprint

This Databricks-GenAI-Assoc practice question is part of Courseiva's free Databricks certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the Databricks-GenAI-Assoc exam.