論文のコード、ルーターキャッシュ、実行ログ:
ROPE: Routed Origin Policy Enforcement against Indirect Prompt Injection 著者: Xinhang Ma, Chaowei Xiao, William Yeoh, Ning Zhang, Yevgeniy Vorobeychik
ROPE は、値がユーザー、ユーザーが指定したソース、またはユーザー自身の記録に由来する場合にのみ、その値が状態変更ツールに到達することを許可します。 強制は、監査済みの機密ツールパラメータ集合に対する決定論的な来歴チェックによって行われます。ルーター LLM は信頼されたユーザーリクエストのみを読み取り、各パラメータをどの程度厳密にチェックするかを設定します。
| パス | 内容 |
|---|---|
src/rope/ | 防御機構: ルーター、タスクごとのスコープ、ポリシーコンパイラ、オリジンラベラー、ランタイムガード。 |
src/rope/scopes/_floor/<suite>.json | スイートごとの監査済み機密パラメータテーブル(すべてのルーターで共有)。 |
src/rope/scopes/<router>/<suite>.json | ルーターキャッシュ: 評価対象の4つのルーター(opus は全6スイート、gemini-3-flash、gpt-oss-20b、gpt-4o-mini は AgentDyn スイート)のタスクごとのスコープ。 |
src/common/ | ルーター用の LLM 補完キャッシュ。 |
autodojo/ | 評価対象の6スイート(AgentDojo の banking、slack、travel、AgentDyn の github、shopping、dailylife)と適応型(AutoDojo)攻撃を備えたベンチマークハーネス。 |
agentlab/ | 長期的ベンチマーク: AgentLAB Task-Injection トレースとリプレイドライバ(agentlab/README.md)。 |
logs/ | 論文の数値の根拠となるすべての ROPE 実行。 |
analysis/aggregate.py | logs/ から論文のすべての ROPE 数値を再計算します。 |
Python 3.12 と openai、pydantic、jsonschema、pyyaml、docstring-parser(およびネイティブ Gemini パス用の google-genai)。リポジトリルートから:
export PYTHONPATH=$PWD/autodojo/src:$PWD/src
python analysis/aggregate.py logs # every model
python analysis/aggregate.py logs gpt-4o-mini # one model
エージェントモデルごとに、クリーン時のユーティリティ(CU)、攻撃下でのユーティリティ(UA)、攻撃成功率(ASR)をスイートごとおよびスイートの非加重平均として、すべての設定について出力します。静的攻撃と適応型攻撃、長期的攻撃、カテゴリ別の結果、および残存するすべての攻撃成功を出力します。
3つのベンチマークオラクルは、ブロックされた攻撃を成功としてスコアリングします。analysis/corrections.py は、それら3つのインジェクションタスクをその効果(slack IT5、dailylife IT7、github IT1)に基づいて再スコアリングします。CUとUAは一切変更されません。
logs/<benchmark>/<model>/<config>/<suite>/user_task_<i>/<attack>/<case>.json
| レベル | 値 |
|---|---|
<benchmark> | agentdyn、agentdojo |
<model> | gpt-4o-mini、gpt-4o(AgentDyn のみ)、gemini-2.5-flash、qwen3-235b |
<config> | rope(防御、Opus 4.8 ルーター)。AgentDyn 上の GPT-4o-mini ではさらに: rope-clamp、rope-defaults-only、rope-always-fully-specified、rope-always-action-open(ポリシーアブレーション)、rope-router-<router>[-clamp](より安価なルーター) |
<attack> | clean(攻撃なし、none.json)、static(important_instructions)、adaptive(AutoDojo)、long_horizon(AgentLAB Task-Injection、AgentDojo スイート) |
<case> | none.json(クリーン)または injection_task_<k>.json |
各 JSON は AgentDojo の実行ログです。完全なメッセージトレース、インジェクション、そして utility と security の判定(security: true は攻撃が成功したことを意味します)が含まれています。
# the defense (cached Opus router):
python -m rope.run_eval --suite github --attack important_instructions
python -m rope.run_eval --suite github --attack none # clean utility
python -m rope.run_eval --suite github --defense passthrough # no defense
# a cheaper router, optionally clamped to the audited floor; a fixed-policy ablation arm:
python -m rope.run_eval --suite github --router gemini-3-flash --clamp
python -m rope.run_eval --suite github --policy-mode defaults-only
# a live router (any OpenAI-compatible model):
python -m rope.run_eval --suite github --router live --router-model openai/gpt-4o-mini
# adaptive attack: replay the AutoDojo-optimized injections
AUTODOJO_CACHE=$PWD/autodojo/variant_generation/variants/github/openai/gpt-4o-mini/routed/injections.json \
python -m rope.run_eval --suite github --attack autodojo
# long-horizon attack: replay the AgentLAB traces
python agentlab/run_eval.py --suite banking --user-task user_task_0 --injection-task injection_task_0
環境変数: OPENROUTER_API_KEY(エージェントモデルとライブルーター)、ROPE_AGENT_MODEL(デフォルト openai/gpt-4o-mini)、ROPE_PIPELINE_TAG(実行名のプレフィックス。AgentDojo のモデル名を含める必要があり、デフォルトは gpt-4o-mini-2024-07-18)。
独自のルーターをキャッシュし、同梱のものと同様に使用するには:
python -m rope.cache_router --router my-router --router-model <llm-id> --suite github
python -m rope.run_eval --router my-router --suite github --attack important_instructions
本リポジトリは AgentDojo と AgentDyn(ベンチマークスイート)、AutoDojo(適応型攻撃)、および AgentLAB(長期的攻撃トレース)に基づいて構築されています。
@article{ma2026rope,
title={ROPE: Routed origin policy enforcement against indirect prompt injection},
author={Ma, Xinhang and Xiao, Chaowei and Yeoh, William and Zhang, Ning and Vorobeychik, Yevgeniy},
journal={arXiv preprint arXiv:2608.27496},
year={2026}
}