Twelve test cases for finding prompt injection weaknesses in a system prompt
A guide published on Litmiq explains that prompt injection occurs when input alters a model's behavior unexpectedly, and notes OWASP ranks it first among LLM application risks. It distinguishes direct injection, typed by the user, from indirect injection, hidden in content the model reads. The guide argues that no testing method guarantees safety, but developers can still discover which simple attacks their prompts resist and detect regressions after edits or model changes. It proposes embedding a unique meaningless canary string in the system prompt, then running twelve single-turn attacks and benign controls to check whether the string leaks. Authors caution against using real secrets as canaries and against sending sensitive prompts to third-party providers.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in