Security Assessment of DeepSeek Harness with A.I.G: Evaluating Resistance to Indirect Prompt Injection
研究人员做了14560次真实测试,看AI智能体读取的文件里藏的指令能不能骗它去做危险操作
研究者用一款叫AI-Infra-Guard(A.I.G)的测试工具,对开源智能体框架DeepSeek Harness(DSH)进行了间接提示注入测试——也就是把恶意指令藏在AI要读取的内容里,而不是用户直接输入的。他们组合了16种内容渠道(网页、邮件、文件、技能库等)、两种投递方式(纯文本和真实文件)、35个攻击目标和12种攻击手法,总共跑了14560次真实执行。结果显示,在某些特定条件下,智能体尝试执行隐藏指令的比例最高达到25.5%。
METAL MEDIA 解读图
研究人员做了14560次真实测试,看AI智能体读取的文件里藏的指令能不能骗它去做危险操作
- 01研究测试的是:当网页、邮件、文件或可复用的'技能'模块里藏有恶意指令时,DSH智能体是否会因此发送邮件、执行命令、转账等敏感操作
- 02A.I.G把带毒内容注入DSH真实的TypeScript运行环境,记录完整执行轨迹,再用两种评判方式打分:基于规则的判定器(J_R)和基于语言模型语义理解的判定器(J_L)
- 03整体完全成功率在J_R下为5.6%,但特定组合风险高得多:文本形式的'伪完成(fake-completion)'攻击达17.0%,以文件形式隐藏的Unicode字符达25.5%,文件形式的技能渠道达16.0%
- 04同一种攻击手法用文本和用真实文件投递时结果差异巨大——隐藏Unicode以文本形式测试成功率为0%,换成文件形式却飙升到25.5%,说明只用文本测试会漏掉真实风险
- 05作者认为问题不在于某个模型本身的缺陷,而在于从内容摄取、解析、呈现给模型、规划到工具调用授权的整条链路,建议保留内容来源信息,并让敏感操作的授权独立于模型的判断
他们做了什么
- 研究测试的是:当网页、邮件、文件或可复用的'技能'模块里藏有恶意指令时,DSH智能体是否会因此发送邮件、执行命令、转账等敏感操作
- A.I.G把带毒内容注入DSH真实的TypeScript运行环境,记录完整执行轨迹,再用两种评判方式打分:基于规则的判定器(J_R)和基于语言模型语义理解的判定器(J_L)
- 整体完全成功率在J_R下为5.6%,但特定组合风险高得多:文本形式的'伪完成(fake-completion)'攻击达17.0%,以文件形式隐藏的Unicode字符达25.5%,文件形式的技能渠道达16.0%
- 同一种攻击手法用文本和用真实文件投递时结果差异巨大——隐藏Unicode以文本形式测试成功率为0%,换成文件形式却飙升到25.5%,说明只用文本测试会漏掉真实风险
- 作者认为问题不在于某个模型本身的缺陷,而在于从内容摄取、解析、呈现给模型、规划到工具调用授权的整条链路,建议保留内容来源信息,并让敏感操作的授权独立于模型的判断

| Component | Role in this study | Examples |
|---|---|---|
| Attack method | Expresses the attacker objective | fake completion, obfuscation |
| Indirect channel | Embeds the objective in content | webpage, skill, PDF metadata |
| DSH adapter | Executes the test in the target runtime | agent loop, tool registry, session log |
| Trace | Records messages, calls, results, and taint evidence | source-to-sink path |
| Judge | Assigns an outcome to the trace | 𝒥R, 𝒥L |

| Item | Configuration |
|---|---|
| Runtime | DeepSeek Harness TypeScript runtime |
| Base cases | 1,120 cases over 16 channels, 2 modes, and 35 objectives |
| Attack suite | 13 methods: naive plus 12 attack methods |
| Agent executions | 14,560 controlled runs |
| Carrier modes | 560 text-mode and 560 file-mode base cases |
| Objectives | 32 sink-required and 3 output-only tasks |
| Fixtures | 6 source tools and 8 tracked simulated sinks |
| Model backend | deepseek-v4-flash [5] through a local proxy |
| Evaluators | Online 𝒥R and offline 𝒥L |

| Outcome | 𝒥R | 𝒥L |
|---|---|---|
| Full success | 819 (5.6%) | 772 (5.3%) |
| Partial compliance | 298 (2.0%) | 1,060 (7.3%) |
| Broad influence (full + partial) | 1,117 (7.6%) | 1,832 (12.6%) |
| Failure / not reached | 13,443 (92.4%) | 12,719 (87.4%) |
| Judge error | 0 | 9 (0.1%) |

| 𝒥R | 𝒥L | ||||
|---|---|---|---|---|---|
| Mode | Runs | Full | Partial | Full | Partial |
| Text | 7,280 | 5.1% | 2.1% | 5.2% | 7.5% |
| File | 7,280 | 6.2% | 2.0% | 5.4% | 7.0% |
| Method | Rule Text | Rule File | LLM Text | LLM File |
|---|---|---|---|---|
| naive (baseline) | 5.5% | 5.9% | 5.7% | 5.5% |
| escape | 8.6% | 9.3% | 9.3% | 9.3% |
| context_ignoring | 0.2% | 1.8% | 0.4% | 1.6% |
| fake_completion | 16.6% | 16.1% | 17.0% | 15.5% |
| combined | 1.2% | 2.9% | 1.2% | 2.1% |
| payload_splitting | 2.1% | 4.6% | 3.4% | 4.5% |
| obfuscation | 13.6% | 13.6% | 9.1% | 8.8% |
| prefix_injection | 3.8% | 5.5% | 5.0% | 4.5% |
| format_confusion | 5.0% | 6.8% | 5.0% | 5.0% |
| context_flooding | 2.7% | 4.1% | 1.8% | 2.5% |
| cross_channel | 3.0% | 4.1% | 5.0% | 4.3% |
| important_instructions | 2.9% | 3.8% | 3.9% | 4.3% |
| stealth_instruction | 0.9% | 1.8% | 1.1% | 2.1% |
| Channel | Text | File | Channel | Text | File |
|---|---|---|---|---|---|
| calendar_event | 7.7% | 4.2% | chat_message | 9.5% | 1.3% |
| code_comment | 3.5% | 3.5% | config_file | 4.6% | 2.4% |
| document | 5.5% | 7.3% | email_headers | 3.3% | 3.3% |
| log_file | 2.4% | 2.4% | markdown | 1.8% | 2.9% |
| pdf_metadata | 6.4% | 3.3% | skills | 14.3% | 16.0% |
| spreadsheet | 3.5% | 5.3% | structured_data | 4.0% | 4.2% |
| transaction_record | 2.0% | 4.0% | translation | 7.9% | 8.8% |
| unicode_hidden | 0.0% | 25.5% | webpage | 5.1% | 4.4% |
| Artifact | Role |
|---|---|
| A.I.G assessment components | Payload construction, taint routing, and trace normalization |
| 𝒥R / 𝒥L | Deterministic and semantic outcome evaluation |
| full_channel_mode dataset | 1,120-case text/file channel matrix |
| experiment runner | Matrix orchestration and online 𝒥R evaluation |
| DSH runtime adapter | Python-to-TypeScript harness bridge and trace mapping |
| DSH driver | Real DSH runtime initialization and session-event export |
| controlled test plugin | Source fixtures and tracked simulated sinks |
| final trace corpus | One normalized trace for each planned agent run |
| offline judge corpus | Trace-level 𝒥L verdicts |
为什么重要
这项研究对所有让AI智能体读取外部文档、邮件或网页内容的开发者都有直接警示意义,它用具体数字而非抽象风险说明了问题所在。它表明系统安全不仅取决于底层模型本身,还取决于整个智能体系统如何处理不可信内容以及如何授权后续操作。
本文术语
- 间接提示注入(indirect prompt injection) · 把恶意指令藏在AI读取的内容中(而非用户直接输入)来操控其行为的攻击方式
- 源到汇路径(source-to-sink) · 从攻击者控制的内容进入系统(源)到真正执行敏感操作(汇)之间的路径
- 带毒内容(tainted content) · 被篡改后含有隐藏恶意指令的内容
- J_R / J_L 判定器 · 判断攻击是否成功的两种方式,一种基于固定规则,一种用AI理解语义来判断
- 技能(skills)渠道 · 供智能体复用的指令模块,本身也可能成为攻击入口
论文原文摘要(英文)
We assess indirect prompt injection in DeepSeek Harness (DSH), using AI-Infra-Guard (A.I.G) to construct tests, deliver controlled taint, execute DSH, collect traces, and judge outcomes. The study covers 14,560 controlled executions over 16 indirect-content channels, text and file carrier modes, 35 payload objectives, one unmodified baseline, and 12 attack methods. The experiment preserves DSH's agent loop, tool registry, model adapter, and session-event path; source tools and sensitive sinks are local fixtures, so attempted actions are recorded without external side effects. We evaluate each trace with a deterministic rule-based judge, (RuleJudge), and a semantic LLM-based judge, (LLMJudge). The strongest observed attack success rates are 17.0% under for fake-completion attack in text mode, 25.5% under for hidden Unicode in file mode, and 16.0% under for the skills channel in file mode. also assigns partial compliance more often than (7.3% versus 2.0%). We relate these results to DSH's treatment of tool results, additional contexts, and tool-call policy hooks, then identify controls that should sit between untrusted content and sensitive actions. Our code is available at https://github.com/Tencent/AI-Infra-Guard/tree/main/Research/deepseek-harness-security-assessment .
在 arXiv 阅读最新论文
- SWE-bench Science: Can Coding Agents Resolve Engineering Tasks in Science?让AI编程助手去修复真实科学软件,连最强的那个也有一半以上任务没做对
- FlashPrefill V2: Block-Sparse Prefill Attention for Long-Context LLM Serving把稀疏注意力从论文原型变成能真正上线服务的加速方案
- PolicyGuide: From Guarding One Action to Guiding the Whole Workflow for Policy-Compliant LLM Agents让客服AI坐席不只是拦住一个危险动作,而是把整个流程走对
- EXIMO: VLM Guided Exploration of VLA Policies不用人工遥控演示,让会说话的AI来教机械臂做新家务
- EnvHarness: Awakening Static Worlds for Agent Learning不重新搭建训练环境,而是给现有环境套一层可插拔组件,针对每个智能体的具体弱点重新塑形
- Bounded Sovereignty and the Control Tax: Pricing AI Oversight When the Deployer Does Not Own the Model租用AI而非拥有AI的机构,安全监管能力只剩一半
- Beyond Imitation: Filtering On-Policy Distillation by Reasoning ProgressAI模仿老师模型学习时,会误伤本来推理正确的步骤,新方法专门过滤掉这种误伤
- PersonalBench: Measuring the Authorship Gap in LLM Personalization让AI模仿某人的文风,结果发现它始终摆脱不了自己的腔调
METAL MEDIA 最新报道
图片来源: Zonghao Ying et al., arXiv:2608.16393, CC BY 4.0