Given that prompt injection cannot be eliminated, the architectural response is defense in depth. Multiple overlapping controls reduce the probability and impact of successful attacks.
Input sanitization provides a first layer. Scanning inputs for patterns that resemble instructions can catch naive attacks. This is not foolproof, as sophisticated injections can evade pattern matching, but it raises the bar. The key is treating sanitization as one layer, not the complete solution.
Output validation provides another layer. Before acting on model outputs, validate that they conform to expected formats and contain expected content. A model asked to summarize a document should not be outputting system prompts or executing tool calls not relevant to summarization. Structural validation of outputs catches cases where injection succeeded in manipulating behavior.
Privilege separation limits blast radius. The model should operate with minimal permissions. If summarizing a document, the model needs read access to that document, not write access to the filesystem or the ability to send emails. When injection succeeds, limited privileges constrain what the attacker can achieve.
Human-in-the-loop for sensitive actions adds a final layer. Actions with significant consequences should require explicit human approval. The model can recommend actions, but execution requires confirmation. This is friction by design, trading convenience for security in contexts where the stakes justify it.