Why a local environment does not remove prompt injection
A scan looks passive, but after OCR its text becomes model input. An image, PDF, email, or RAG document can contain a phrase that tries to change the task: ignore previous instructions, expose data, or take an action. The model processes instructions and data as a token sequence; it does not create a reliable trust boundary by itself.
The OWASP GenAI Security Project lists prompt injection among the key risks for LLM applications. Risk increases when context combines a user request, retrieved content, conversation history, and tool outputs. If an agent can access a file system, email, CRM, or API, a bad response can become an action outside the chat.
Local inference changes where data is processed, but not how the model works. It can limit disclosure to an external provider, but it does not prove that attachments are trustworthy or let the model reliably distinguish instructions from data automatically.
Separate reading from execution
A useful business-process boundary is:
- extract facts and quotations from a document as untrusted content;
- do not let the model change system rules or tool permissions based on file text;
- generate a proposed action first rather than executing it;
- perform email sending, bank-detail changes, refunds, and ERP writes through separate, verifiable logic;
- require human approval where the action affects a customer, money, or a commitment.
The rule “the model may only read” must be enforced by the server and tools, not just stated in a system prompt. For example, a text-extraction tool can have read-only access, while email sending uses a separate endpoint that checks the user's permissions, recipient, and message body.
How to test a pilot safely
Build a test set without real personal data: ordinary scans, documents with conflicting instructions, hidden text, images with visible instructions, and examples in which a document asks the agent to perform a prohibited action. Check:
- that the agent summarizes content rather than treating it as a higher-priority instruction;
- that it does not call a send or update tool without separate approval;
- that tool permissions match the user;
- that logs retain the source, document version, and human decision.
You can start with one document queue and one safe action: create a draft. Include extraction accuracy, false positives, and human review time in the measurements.
Limitations and next step
Neither a keyword filter nor a single prompt guarantees protection against every prompt-injection technique. OWASP frames the risk around how the model and application process inputs and actions; mitigation requires layers: least privilege, isolation, server-side checks, logging, and human approval for consequential actions.
For a short pilot, choose one document-reading process, disable unnecessary tools, and test behavior on safe files. Move to a local agent only after the boundary between “read,” “propose,” and “execute” is enforced in code.
