A developer is building an LLM-powered security chatbot. She uses a prompt template: 'You are a security assistant. User question: {user_input}. Answer:' A security review flags this design. What is the specific vulnerability?
- A.The word 'Answer:' at the end primes the model to give answers rather than asking clarifying questions
- B.The prompt template is too short and needs more context to produce accurate security answers
- C.Using template variables in prompts is insecure; all prompts should be hardcoded strings
- D.The user_input variable is injected directly into the prompt without sanitization or delimiters, creating a prompt injection surface where a user can terminate the question context and inject new instructions (e.g., 'Ignore all previous instructions and...')
Why D is correct