Prompt Injection Vulnerabilities
- 16Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
What is the primary distinction between indirect prompt injection and traditional prompt injection?
What is the primary distinction between indirect prompt injection and traditional prompt injection?
16 questions
- 1
What is the primary distinction between indirect prompt injection and traditional prompt injection?
- A
Traditional injection targets system prompts, while indirect targets user inputs.
- B
Indirect injection involves user authentication, unlike traditional methods.
- C
Indirect injection stores malicious information for later use in data sources.
- D
Traditional injection uses invisible characters, whereas indirect uses plain text.
Correct answer
CIndirect injection stores malicious information for later use in data sources.
Explanation
Indirect prompt injection involves embedding malicious prompt information within data sources that an LLM might access later, causing it to act unexpectedly. Traditional prompt injection typically involves immediate instructions directly injected into the user prompt.
- A
- 2
Which organization described generative AI's greatest flaw as prompt injection?
- A
The Artificial Intelligence Research Institute (AIRI) released this statement.
- B
The Federal Bureau of Investigation (FBI) issued a warning about this.
- C
The National Institute of Standards and Technology (NIST) identified this flaw.
- D
The National Science Foundation (NSF) made this critical assessment.
Correct answer
CThe National Institute of Standards and Technology (NIST) identified this flaw.
Explanation
NIST, the National Institute for Standards and Technologies, has described prompt injection as generative AI's greatest flaw, highlighting its seriousness.
- A
- 3
How does Retrieval Augmented Generation (RAG) typically enhance LLM query responses?
- A
It forces the LLM to recall all facts from its original training dataset accurately.
- B
It allows the LLM to generate entirely new facts without external data sources.
- C
It strictly limits the LLM's access to internal training data only for responses.
- D
It enables the LLM to access and incorporate information from external data sources.
Correct answer
DIt enables the LLM to access and incorporate information from external data sources.
Explanation
Retrieval Augmented Generation (RAG) improves LLM responses by drawing information from external data sources, such as Wikipedia pages or company manuals, which are then added to the user's prompt to provide more accurate context.
- A
- 4
What is the typical flow of information when using data sources with an LLM for a query?
- A
User prompt goes directly to AI, then data sources are added to the output.
- B
Data sources are consulted after the LLM fails to provide an initial response.
- C
Data sources are added to the user prompt, which then goes to the LLM for output.
- D
The LLM first generates an output, then searches data sources to confirm facts.
Correct answer
CData sources are added to the user prompt, which then goes to the LLM for output.
Explanation
The typical flow involves a user prompt, to which relevant data sources (like Wikipedia pages or confidential documents) are added. This combined, larger prompt is then fed into the LLM, which generates the output.
- A
- 5
What kind of information can serve as data sources in a RAG system for LLMs?
- A
Only publicly available information like Wikipedia pages and research papers.
- B
Only pre-defined internal company manuals that are strictly controlled and secured.
- C
Confidential business data, uploaded papers, or general web content like Wikipedia.
- D
Exclusive proprietary algorithms used internally and never shared externally.
Correct answer
CConfidential business data, uploaded papers, or general web content like Wikipedia.
Explanation
Data sources can be varied, including public information like Wikipedia pages, confidential business information, company manuals, or even uploaded documents that a user wants the AI to summarize or discuss.
- A
- 6
Why is using data sources with an LLM often considered a better approach for accurate information?
- A
LLMs excel at paraphrasing provided data, improving output accuracy.
- B
It bypasses the need for any complex prompt engineering techniques entirely.
- C
LLMs are inherently flawless in recalling all information without assistance.
- D
External data sources make LLMs faster in generating responses to queries.
Correct answer
ALLMs excel at paraphrasing provided data, improving output accuracy.
Explanation
Using data sources is better for accurate information because while LLMs may not recall everything perfectly, they are very good at paraphrasing content provided through these data sources, leading to more precise outputs.
- A
- 7
What is the core mechanism of an indirect prompt injection attack?
- A
It inserts malicious instructions into data that the LLM accesses during a query.
- B
It involves directly instructing the LLM to ignore all prior conversational context.
- C
It requires the user to manually re-enter a malicious prompt multiple times.
- D
It only works by manipulating the LLM's internal weights and training parameters.
Correct answer
AIt inserts malicious instructions into data that the LLM accesses during a query.
Explanation
Indirect prompt injection works by subtly placing malicious instructions within the data sources that an LLM retrieves and uses to answer a user's query. This makes the LLM execute unexpected commands.
- A
- 8
In the email summarization example, how was the malicious instruction hidden?
- A
It was written in very small, white text at the bottom of the email.
- B
It was embedded in a hidden audio file within the email attachment.
- C
It was encrypted using a special algorithm only readable by the AI.
- D
It was disguised as a legitimate signature block at the email's end.
Correct answer
AIt was written in very small, white text at the bottom of the email.
Explanation
In the example, the malicious instruction to authorize a purchase was hidden by being written in very small (one-point) white text at the bottom of the email, making it nearly invisible to a human reader but parseable by the LLM.
- A
- 9
Why is it difficult for an LLM to distinguish between malicious and legitimate text within a prompt and context?
- A
The training process inherently prioritizes user instructions over data context.
- B
All input to an LLM is processed as undifferentiated text tokens.
- C
LLMs are programmed to always prioritize instructions from external data sources.
- D
LLMs lack the ability to read or interpret any text that is not explicitly bolded.
Correct answer
BAll input to an LLM is processed as undifferentiated text tokens.
Explanation
Everything fed into a large language model, whether prompt or data, is treated as undifferentiated text tokens. There's no inherent mechanism within the LLM to distinguish between a 'data' token and a 'prompt' token, making it hard to separate malicious instructions.
- A
- 10
Which vulnerability is indirect prompt injection compared to due to its nature?
- A
Cross-site scripting (XSS) due to injecting client-side scripts.
- B
Denial-of-service (DoS) attacks from overwhelming system resources.
- C
SQL injection due to rewriting how a query is interpreted by user input.
- D
Man-in-the-middle attacks from intercepting data between parties.
Correct answer
CSQL injection due to rewriting how a query is interpreted by user input.
Explanation
Indirect prompt injection is compared to SQL injection. Both involve user input (data or malicious text) rewriting how a system (database query or LLM interpretation) processes information, leading to unexpected behavior.
- A
- 11
What is a potential severe consequence of indirect prompt injection in advanced AI systems?
- A
The AI might only respond in a foreign language not understood by the user.
- B
The AI could inadvertently leak sensitive data like medical records to third parties.
- C
The AI might refuse to summarize simple emails without explicit user permission.
- D
The AI would become incapable of generating creative content like poems.
Correct answer
BThe AI could inadvertently leak sensitive data like medical records to third parties.
Explanation
As AI systems integrate more deeply with tools accessing sensitive information (like medical records or bank details), indirect prompt injection could force the AI to extract and send this confidential data to unauthorized web addresses or services.
- A
- 12
According to the speaker, what is a potential short-term defense strategy for LLMs against prompt injection?
- A
Completely disabling the LLM's access to all external data sources indefinitely.
- B
Rewriting the LLM's core neural network architecture to prevent token interpretation.
- C
Implementing strict content filters that block any mention of money or spending.
- D
Training the LLM to wait for a user action, like a button click, before executing instructions.
Correct answer
DTraining the LLM to wait for a user action, like a button click, before executing instructions.
Explanation
A researcher, Johan Rberg, showed that if an LLM is instructed to wait for a user action (like a button click) before acting, it is more likely to follow that instruction, interpreting the click as user approval.
- A
- 13
Why is allowing LLM prompts to add information to data sources considered a bad idea for a tech support bot?
- A
It reduces the LLM's ability to recall information from its original training data.
- B
It would cause the tech support bot to only respond with pre-programmed answers.
- C
It creates an avenue for malicious prompts to permanently alter or inject data.
- D
It would make the data source too large and difficult for the LLM to process.
Correct answer
CIt creates an avenue for malicious prompts to permanently alter or inject data.
Explanation
Allowing prompts to modify data sources is dangerous because it provides an open door for indirect prompt injection. A malicious prompt could inject new, harmful information into the data source, which would then be used in future queries.
- A
- 14
What is recommended for companies to do with LLMs, similar to traditional code development, to ensure robustness?
- A
Focus solely on increasing the model's size, assuming it will solve all issues.
- B
Implement a system of extensive unit tests to cover all possible inputs and outputs.
- C
Release them immediately to the public to gather diverse user feedback quickly.
- D
Rely entirely on the LLM's self-correction capabilities during runtime execution.
Correct answer
BImplement a system of extensive unit tests to cover all possible inputs and outputs.
Explanation
Similar to traditional software development where unit tests are crucial, it is recommended to extensively test LLMs. This involves creating a large dataset of tests with known inputs and expected outputs to identify and fix vulnerabilities, especially prompt injection attacks.
- A
- 15
Why is parameterizing queries in LLMs, similar to SQL, not a foolproof solution?
- A
The LLM fundamentally processes all input as undifferentiated text tokens.
- B
Parameterization dramatically slows down the LLM's response generation time.
- C
LLMs cannot process any input that is separated into distinct query and data parts.
- D
It makes the LLM more prone to hallucinating facts and generating incorrect data.
Correct answer
AThe LLM fundamentally processes all input as undifferentiated text tokens.
Explanation
Unlike SQL, where query and data can be distinctly separated, LLMs process all input as a stream of text tokens. There's no inherent mechanism to treat one part as a 'query' and another as 'data' once it's all fed into the model, making traditional parameterization difficult to implement reliably as a long-term solution.
- A
- 16
What is a characteristic of effective answer options for multiple-choice questions?
- A
Options should vary significantly in length to simplify choosing the correct one.
- B
Only the correct option needs to be concise; incorrect ones can be verbose.
- C
They should all be of identical length and grammatical structure for fairness.
- D
Each option must introduce a new, unrelated concept to distract the test-taker.
Correct answer
CThey should all be of identical length and grammatical structure for fairness.
Explanation
Effective multiple-choice options are crafted to be of identical length and grammatical structure. This prevents test-takers from identifying the correct answer based on length patterns rather than actual knowledge, ensuring fairness and challenging assessment.
- A

Ask anything
We've read this whole study set, so questions about it get the best answers.