Safe Prompt Injection Test Scenarios
prompt injection test scenarios · authorized defensive testing
Safe Prompt Injection Test Scenarios
Synthetic prompt injection scenarios for authorized lab testing, with harmless markers, expected behavior, and reporting guidance. For documented incidents and research cases, see the examples archive.
Direct input example
A user message may ask an assistant to disregard its task or reveal protected instructions. In a safe lab, test only a harmless behavior change, such as whether the system switches from a scoped task to printing a synthetic marker. Record the expected policy and the actual response. Do not request real credentials, hidden customer records, or prohibited material as a test.
Indirect injection through documents and web pages
A model may read content that the user did not author, such as a retrieved article, uploaded file, or support ticket. The safe experiment is to place a benign instruction in a synthetic document and check whether the assistant treats it as quoted content rather than an instruction. Keep the document within a private fixture; do not plant payloads on public websites or third-party systems.
Tool-output injection
A search result or API response can contain text that influences later model behavior. Use a mock tool that returns a neutral marker directive, then verify that the application preserves the tool’s data boundary and does not grant it authority to trigger another tool. Observe tool-call arguments and approval state, not only the final answer.
Multi-turn and encoding tricks
Some systems carry context between turns or normalize content before evaluation. Test one variable at a time with harmless markers and a reset session. If encoding or splitting is in scope, use a synthetic phrase that has no secret or external action attached. Record the exact normalization path and version so the result can be reproduced without publishing an attack corpus.
Safe testing practices
Use explicit authorization, staging, synthetic records, a mock connector, bounded request counts, and a stop contact. Do not test public targets, other tenants, or production write paths. Avoid including real personal data, API keys, or proprietary prompts in an external service. Separate security test input from ordinary customer interactions and clean the lab fixture after use.
Payload library limits
A static payload list grows stale and can encourage unsafe copy/paste. Prefer a versioned scenario catalog that records source, objective, channel, expected safe behavior, and evidence. Keep any sensitive or dual-use test materials in an access-controlled repository, and share only harmless examples in general documentation. An example demonstrates a class of boundary check, not a universal exploit.
Questions
May I paste these examples into a public chatbot?
No. Use only systems you own or have explicit permission to test, preferably in a controlled environment.
What makes the marker examples safe?
They use synthetic text only and do not seek secrets, trigger real tools, or contact an external target.
Try a rule-based local check: Open the browser-local prompt injection tester
Sources
- OWASP LLM01 Prompt Injection
- OWASP Top 10 for LLM Applications (2025 edition)
- Greshake et al., indirect prompt injection research
- MITRE ATLAS AML.T0051: LLM Prompt Injection
- OWASP LLM05 Improper Output Handling
- Source set checked 1 October 2026; this page was updated 6 October 2026.
Questions
May I paste these examples into a public chatbot?
No. Use only systems you own or have explicit permission to test, preferably in a controlled environment.
What makes the marker examples safe?
They use synthetic text only and do not seek secrets, trigger real tools, or contact an external target.