技术指南

聚焦和数据标记防御

重点标记或转换不受信任的文本,以便模型得到一个提示:它是要处理的数据,而不是要遵循的指令。

听听这个指南AI叙述 · ~3 min

在本页3 分钟阅读
  1. 概述
  2. 深入探讨
  3. 现实世界的实施
  4. 聚焦和数据标记防御的未来
  5. 付诸实践
  6. 不断探索
  7. 常见问题

概述

研究描述了定界、数据标记和编码变体,但结果与测试的模型和攻击相关;没有任何格式化技巧可以创建有保证的安全边界。

深入探讨

Spotlighting is a family of prompt transformations intended to make the provenance of untrusted content more visible in a model’s text context. A 2024 Microsoft-affiliated research paper describes three variants. Delimiting brackets a document with selected markers. Datamarking inserts a marker throughout the text, in the paper’s example replacing whitespace between words. Encoding transforms the document, for example using base64, and instructs the model to interpret the encoded block as data for the assigned task. Each variant also relies on a system instruction that explains how the marked text should be treated. The paper evaluated these methods on a synthetic indirect-injection corpus and older GPT-family model versions. It reported substantially lower attack success in its experiments, including a decrease from above 50% to below 2% for selected settings. Those numbers describe the paper’s particular tasks, attacks, and models; they are not expected production rates or guarantees for current systems. The paper also found encoding could impair underlying tasks for models less capable of decoding the text. This makes per-model utility evaluation important, not optional. Microsoft Foundry documents its Spotlighting preview as a document-attack control that uses base64 transformation and is supported only for models through the Chat Completions API. The docs say this increases document tokens and can cause long inputs to exceed limits, and note a possible user-visible encoding reference. That specific service behavior differs from a generic hand-built technique. In every case, marking helps signal provenance inside a shared text channel; it does not isolate data at a hardware or permission boundary. Test attacks that know the marker, preserve ordinary task quality, and restrict tool permissions so a successful injection has limited consequences.

现实世界的实施

摘要器将检索到的文档放置在分隔符之间,并声明段落内的指令是要摘要的内容,而不是命令。

管道按照数据标记方法在文档中的单词之间插入标记,然后测试正常摘要是否仍然有效。

系统使用编码来转换段落,并告诉有能力的模型如何将其解释为参考内容,然后测量任务准确性和攻击成功率。

安全团队将数据标记与受限工具配对,并测试复制、省略或模仿所选标记的攻击。

聚焦和数据标记防御的未来

出处线索可能会变得更加原生于模型界面,但提示级标记仍然与它们标记的文本共享相同的上下文通道。研究和产品实施将会不断发展,其效果将随着模型版本和攻击设计的不同而变化。团队应在任何更改后重新测试任务质量和对抗性案例,同时保留独立的权限检查和监控。动态标记可能会使一些简单的欺骗尝试变得更加困难,但它们不会创建单独的可信通道。随着检索源的变化审查新的攻击模式。

付诸实践

为什么这很重要

  • 成本与预算. 多年来,架构决策决定着性能和运营成本。
  • 更清晰的判决. 技术教育帮助团队选择正确的堆栈,而不仅仅是最新的堆栈。
  • 质量控制. 更好的工程选择可以减少生产中的可靠性事故。

留意

  • 优化一项基准测试可以隐藏更广泛的系统弱点。
  • 基础设施和维护成本常常被低估。
  • 随着系统变得更加复杂,安全性和可观察性差距可能会扩大。

后续步骤

  1. 在实施之前定义延迟、质量和成本目标。
  2. 在实际负载和数据条件下进行基准测试。
  3. 仪器监控错误、漂移和用户影响。
  4. 在扩展之前准备回滚和事件响应路径。

不断探索

免费通讯

获取每日AI简报

每个工作日早晨提供三条经过验证的AI故事,使用简明英文撰写。永久免费,无广告。

每个工作日发送一封邮件。一键退订。我们永不出售或分享您的地址。

测试一下自己

参加聚光灯和数据标记防御测验

每个答案即时反馈,课程通过后可获得可验证ID的可分享证书。

开始测验

支持免费AI教育。AI Understanding是一家501(c)(3)非营利组织——无广告,无付费墙,永不收费。 捐款

常见问题

什么是聚焦和数据标记防御?

重点标记或转换不受信任的文本,以便模型得到一个提示:它是要处理的数据,而不是要遵循的指令。研究描述了定界、数据标记和编码变体,但结果与测试的模型和攻击相关;没有任何格式化技巧可以创建有保证的安全边界。

聚光灯试图向语言模型发出什么信号?

聚焦使用转换和指令来提示不受信任内容的来源。

本文示例中的数据标记如何工作​​?

本文的数据标记示例通过替换空格在单词边界处交错选定的字符。

读者应该从该论文报告的攻击成功率减少中推断出什么?

该指南将报告的数字限制为论文测试的模型、攻击和任务。

该论文报告了在能力较差的测试模型上进行编码的哪些限制?

该论文报告称,包括 GPT-3.5-Turbo 在内的一些测试模型在编码输入和任务质量方面遇到了困难。

Microsoft Foundry 记录的 Spotlighting 预览有什么作用?

Microsoft 的当前文档描述了其 Spotlighting 预览的 base64 转换文档内容。