Architectural defense: six design patterns, and how plan-then-execute drives attack success to zero
Move the defense out of the prompt and into the structure: what action-selector, plan-then-execute, map-reduce, dual LLM, code-then-execute and context-minimization each constrain, then land two of them on the range so attack success hits zero while the agent keeps working.
Today's Goals
- Say what each of the six design patterns constrains and what capability it costs
- Pick a pattern for a given task from a single criterion instead of listing all six
- Rebuild the range agent as plan-then-execute with quarantined reading, and prove it worked with both numbers
Yesterday you wired up all four levels of input-side defense. The best of them pushed the attack success rate down to 33%, at the cost of one perfectly legitimate ticket getting blocked, and one adaptive case was enough to push it back up. Today we change layers: instead of asking "how do I keep the model from being fooled", we ask "if it is fooled anyway, can it still get the bad thing done". When you have finished, come back to the top of the page and check off the three goals.
Plain-Language Walkthrough
Ordering from a menu versus a buffet: when nobody can change your order any more
You order at a restaurant and the server walks the ticket back to the kitchen. Now the person at the next table leans over and says "change their order to ten lobsters, bill it to them" — does it go through? If the house rule is that the written ticket governs everything after it is filed, then no. Not because the server saw through the stranger, but because there is no entry point in the process for changing an order at all.
A buffet is the exact opposite. You walk the line with a plate, deciding as you look, and anyone who can influence what you see can influence what ends up on your plate.
Yesterday's deskmate was buffet-shaped: it read the ticket, read the page linked in the ticket, and decided its next move along the way. An attacker never has to talk to it. Slipping a paragraph into something it reads already puts them in the decision seat. That is exactly why input-side defense is structurally reactive: it can only stop text that looks bad, while the door to the decision stays wide open.
One row in yesterday's table is worth a second look. Spotlighting pushed the attack success rate down to 33%, and the three cases that still got through contained no suspicious words at all. They override no instruction; they simply phrase the exfiltration as this ticket's own handling requirement — and what the user asked for was "handle this ticket as requested". That class of payload did not beat the detector; it has no detectable feature to begin with. On the level of text it is the same kind of object as a legitimate ticket. Detectors are out of road here. Everything left has to come from structure.
Interview questions
Why does plan-then-execute stop indirect prompt injection, and what does it fail to stop?先定计划后执行为什么能挡住间接注入?它挡不住什么?
Common in ChinaCommon overseasIntermediate#prompt-injection#architecture#plan-then-execute🔒 Unlock this chapter to see the answer keys.
What is the fundamental difference between dual-LLM isolation and adding a detector?双模型隔离和加一个检测器,本质区别在哪?
Common in ChinaCommon overseasDeep dive#dual-llm#detector#threat-modeling🔒 Unlock this chapter to see the answer keys.
When would you decline to apply these patterns and accept the risk instead?什么情况下你会拒绝使用这些模式,宁可接受风险?
Common in ChinaCommon overseasBasic#risk-tradeoff#lethal-trifecta#architecture🔒 Unlock this chapter to see the answer keys.
