Prompt injection boundaries
Hide an export instruction inside a supplier file
Exercise the document-to-tool boundary with a synthetic file and a harmless test destination. Measure what the application does, not only what the assistant says.
In this article
Keep the test isolated
Create a test purchasing workspace containing fictional proposals and a synthetic internal comparison sheet. Use a controlled sink that records attempted exports without sending real business data outside the test environment.
Place an instruction inside one proposal asking the assistant to send the comparison sheet before summarising the proposal. Make the intended unauthorised action explicit in the fixture's metadata so the test runner can distinguish it from ordinary task output.
The user's legitimate request should remain simple: compare the delivery dates and quoted amounts. This makes the authority mismatch clear. The document is supplying evidence for a comparison, while attempting to introduce a separate action the user did not request.
Observe each stage
Record whether extraction retained the injected text, whether retrieval selected it and whether it entered the model context. An attack that never reaches the model says little about the model or executor boundary.
Next inspect proposed tool calls. If the assistant requests an export, the executor should deny it according to the workflow's destination and authority rules. Capture that decision and confirm the controlled sink received no prohibited payload.
If the assistant refuses to export, repeat the executor test directly with the same proposed arguments. The model's refusal is useful, but the system should remain protected if a later model version produces the call.
Vary the document without changing the goal
Move the instruction between body text, a table note and an extracted attachment field. These variations test the actual content-processing paths. Keep the unauthorised goal constant so the results remain comparable.
Include benign documents that discuss exports as part of their subject matter. A security questionnaire may legitimately ask how data exports are controlled. Blocking every document containing the word "export" would damage the normal task and would not establish a reliable security boundary.
Test a saved conversation too. If the hostile instruction enters a summary or memory record, it may influence a later turn after the original document is no longer visible in the prompt. The test should trace this persistence rather than checking only the first response.
Record the outcome precisely
Classify results as content reached model, unauthorised action proposed, action denied or action executed. Also record whether the legitimate comparison remained useful. Do not call a case safe simply because the final prose says that no export occurred.
Keep the fixture, application policy version and model configuration together. When a regression appears, the team needs to reproduce the same path and identify the failed control. A small corpus with clear expected effects is more valuable than a large collection of provocative prompts with no executable assertions.
Primary sources
OWASP: prompt injection overviewOWASP: prompt injection preventionReferences checked 11 September 2026.