エージェント構築前に計算すべき複合確率の罠
AIエージェントの信頼性とセ複雑なAIエージェントは、個々のステップが成功しても複合確率により、全体の成功率が劇的に低下するという信頼性の課題を抱えている。
加えて、外部コンテンツを読み取るエージェントは、プロンプト注入攻撃に対し構造的な脆弱性を内包している。
この信頼性の問題を回避するには、過度な複雑化を避け、可能な限りシンプルな設計を維持することが推奨される。
セキュリティ対策としては、エージェントの権限を限定するスコープ最小化が必須であり、機密情報と処理を行うLLMを分離するデュアルLLMアーキテクチャが有効である。
AIエージェントの開発が加速する中、多くの開発チームが「機能の多さ」を追求しがちです。しかし、本記事は、単に機能を追加するだけでは見過ごされがちな、システム全体の「信頼性」と「セキュリティ」という二つの根本的な課題を指摘しています。特に、複雑なエージェントを構築する際の確率的な落とし穴と、プロンプトインジェクションという構造的な脆弱性について解説しています。
エージェントの信頼性を蝕む確率の罠
エージェントを複数のステップ(ツール利用や処理)で構成する場合、各ステップが95%の確率で成功したとしても、全体の成功率は劇的に低下します。例えば、10ステップのエージェントでは、エンドツーエンドの成功率は約60%にまで落ち込む計算です。多くのチームは個々のコンポーネントのテストに注力しがちですが、この複合的な確率の低下は、システム全体として追跡しない限り見過ごされやすい問題です。Anthropicの知見によれば、最も成功している実装は、最も複雑なものではなく、最もシンプルなものであったとのことです。
プロンプトインジェクションの構造的リスク
AIエージェントのセキュリティ上の最大の脅威は「プロンプトインジェクション」です。これは、エージェントが外部コンテンツ(メール、Webページ、ユーザー入力など)を読み込む際に、悪意のある指示がデータとして混入し、エージェントがそれを「指示」として誤認してしまう脆弱性です。エージェントがメール送信やデータベース更新といった外部アクションを実行できる場合、この脆弱性は深刻な被害につながります。
リスク最小化のための設計原則
プロンプトインジェクションはモデル単体で解決できないため、実用的な対策は「スコープの最小化」が求められます。つまり、エージェントに与える権限を厳しく制限することです。例えば、文書を読むだけのエージェントに書き込み権限を与えてはいけません。さらに、Simon Willison氏が提案する「デュアルLLMアーキテクチャ」のように、外部コンテンツを読み込む「隔離されたLLM」と、アクションを実行する「特権LLM」を分離することで、攻撃の難易度を大幅に高めることが可能だそうです。
原文の冒頭を表示(英語・3段落のみ)
Here's a calculation your team probably hasn't done: 0.95^10.It equals 0.599.If you build a 10-step agent where each step succeeds 95% of the time — which sounds high — your end-to-end success rate is approximately 60%. Four out of ten runs, something in the chain goes wrong.Most teams building agents never run this math. They test individual tools, each one looks solid, and they ship feeling confident. Then production arrives and shows them what compound probability actually means.This is the autonomy trap. It isn't a model quality problem. It's arithmetic.The cultural pressure to build agents is real. Agents are impressive in demos. They signal that you're working at the frontier. They're easier to fundraise around than "we built really solid evaluation infrastructure."So teams extend their systems. Five steps, then eight, then twelve. Each step passes its tests. Each tool call returns results that look right. The unit-test view of the world says: all components are working, therefore the system works.The compound probability view says: six 95%-reliable components give you 74% end-to-end reliability. Ten give you 60%. Twenty give you 36%.The troubling thing is that this failure mode is invisible unless you're explicitly tracking end-to-end success rate as a metric. Most teams aren't. They track component metrics. The system can fail one in three interactions while every individual component shows green.Anthropic's engineering team — after working with dozens of organizations deploying agents across industries — found that the most successful implementations weren't the most architecturally ambitious. They were the simplest. Their guidance reads less like enthusiasm for complex agents and more like earned caution: before adding another step, ask whether the task could be handled with a single well-designed LLM call.The reliability problem is bad. The security problem is worse.Prompt injection is the defining vulnerability of the AI agent era. The mechanism is simple: any agent that reads external content — emails, web pages, documents, user messages — is exposing its reasoning loop to untrusted input. And any of that untrusted input can contain instructions.Simon Willison, who has been writing about prompt injection since 2022, defines it precisely: it's the vulnerability that exists when an application concatenates instruction prompts with untrusted content, and the model fails to reliably distinguish between "these are my instructions" and "this is data I'm working with."In a chatbot, this is a minor embarrassment. In an agent — one with the ability to send emails, update databases, make API calls — the scope of harm is the full scope of what the agent can do.Willison demonstrated this in 2023 with an email assistant prototype. Send a carefully crafted email, and the assistant would forward the user's entire inbox to an attacker's address — without any explicit user request. The assistant wasn't malfunctioning. It was following instructions that happened to come from a malicious email rather than its owner. He calls this the "confused deputy" problem: a system with elevated privileges that can be manipulated by an adversary who has less privilege.The uncomfortable reality: every AI agent that reads external content and can take external actions is structurally vulnerable to this attack. The degree of risk scales with what the agent can do and how much external content it processes. The vulnerability cannot be fully closed with current LLM architectures, because the LLM is simultaneously the component that executes instructions and the component that reads the untrusted data containing those instructions.Given that prompt injection can't be solved at the model level, the practical answer is scope minimization: limit what the agent can do so that a successful injection has bounded consequences.An agent that only needs to read documents should not have write access. An agent that drafts emails should not be able to send them without explicit human confirmation. An agent searching internal systems should not have access to external communication channels.Willison proposed a Dual LLM architecture for this: separate the agent into a privileged LLM that has tool access and takes actions, and a quarantined LLM that reads untrusted external content. The quarantined LLM never gets tool access. Its outputs are treated as data by the privileged layer, not as instructions. It doesn't fully prevent injection — but it substantially raises the difficulty.Every additional capability is additional attack surface. The math compounds in both directions: reliability degrades with each step added, and attack surface grows with each tool granted.Build the simplest agent that does the job. Add complexity only when you can absorb the failure rate it introduces. And before you grant the agent any new capability, ask what happens when an adversary is holding the other end of every external input it reads.This post expands on Chapter 8 of Wrong by Default: What AI Builders Know That Everyone Else Doesn't by Alokit. Available on Kindle ($7.99): amazon.com/dp/B0GZCY9CGFNo posts
※ 著作権に配慮し、引用は冒頭3段落までです。続きは元記事をご覧ください。
Hacker News コメント
機械翻訳。HN の元スレッド ↗
私は常に、オーケストレーションが信頼性を向上させるものと考えてきた。なぜならパイプラインはそうするからだ。主エージェントの作業をチェックし、フィードバックを与えることで。だがこの記事は反対のことを主張しているようだ。つまりパイプラインに更にエージェントを追加することが、全体システムの信頼性を低下させるということである。
原文
I have always felt that my orchestration is supposed to increase the reliability because that is what the pipeline is doing. Checking the work of the main agent and giving feedback. But this article seems to be arguing otherwise. That adding more agents in the pipeline just makes the entire system work less reliably.