Google DeepMind研究人員正在提出一種不同的方式來保護大型語言模型(LLM)代理免受操縱,超越模型訓練或簡單的過濾器,轉移到稱為Camel的建築防禦(機器學習功能)。

Detailed in a paper published on arXiv, CaMeL applies established software security ideas like capability tracking and control flow integrity to shield LLM agents interacting with potentially malicious external data, aiming to prevent data theft or unintended actions orchestrated through prompt注射攻擊。

迅速注射的持續問題

儘管整個行業正在進行努力,但LLM仍然容易受到各種形式的快速注射。安全研究人員早在2023年10月就突出了OpenAI多模式GPT-4V的漏洞,其中隱藏在圖像中的指令可以操縱模型。

Building Security Around the LLM

CaMeL’s architecture tackles this by treating the core LLM components as potentially untrustworthy black boxes and building a secure execution environment around them. It refines the “Dual LLM”pattern, an approach discussed by experts like Simon Willison who also helped identify the “prompt injection”threat class back in 2022.

CaMeL has its Privileged LLM generate Python代碼代表用戶的預期任務。然後,該代碼由自定義解釋器執行,而不是讓LLM直接編排工具調用。該解釋器成為控制中心。當代碼需要與不信任的數據進行交互(例如匯總電子郵件)時,它會調用一個隔離的LLM,該LLM僅根據定義的模式來解析或提取信息,而無需調用外部工具本身。

至關重要的是,解釋器跟踪“功能”與“數據功能”相關聯。 Capabilities, in this security context, function like fine-grained, unforgeable tags attached to data specifying its provenance (e.g., user input, a specific tool) and access rights (e.g., which users or tools can read it), drawing inspiration from established computer security systems.

“CaMeL associates, to every value, some metadata (commonly called capabilities in the software security literature) to restrict data and control flows,”研究人員在論文中解釋說,基於信息流控制(跟踪數據傳播)和控制流程完整性(確保執行遵循允許的路徑)的原則啟用詳細的安全規則。 Before executing any function that interacts with the outside world (a tool call), the interpreter consults predefined security policies, checking if the data’s capabilities permit the intended action.

Evaluating CaMeL’s Effectiveness

To evaluate CaMeL’s effectiveness, the DeepMind team utilized AgentDojo, a benchmark specifically designed for assessing agent security across tasks in domains like工作空間,銀行,旅行和鬆弛。

他們的發現表明,駱駝在基準測試範圍內的67%的迅速注射攻擊中成功地捍衛了各種型號的迅速注射攻擊,即使沒有高度特定的安全策略,也可以將成功的攻擊降低到GPT-4O等模型中的零攻擊。該性能與以相同基準評估的其他防禦機制形成鮮明對比,例如聚光燈(輸入過濾)或提示夾心(重複說明)。

此安全層不是免費的。分析表明,駱駝通常需要與標準LLM工具使用相比,平均需要的代幣(輸入和輸出)大約需要2.7至2.8倍,主要是因為特權的LLM可能需要幾次嘗試為解釋器生成無錯誤的Python代碼。模型發展。 A notable strength highlighted is CaMeL’s approach of “not relying on more AI to solve AI problems,”contrasting it with probabilistic defenses that may achieve high but imperfect detection rates.

Beyond Standard Injection: Side Channels and Rogue Tools

The DeepMind researchers acknowledge CaMeL is not a complete solution.側向通道攻擊(攻擊者通過觀察系統行為而不是直接訪問數據)仍然令人擔憂。

本文詳細介紹了對手如何通過觀察間接後果來推斷私人數據,例如,通過檢查外部資源來檢查外部資源是否在循環中反复訪問了該迭代範圍,或者是否依賴私人價值來依賴私人的範圍,或者是否依賴私人價值,或者是否依賴私人價值,或者是否依賴私人價值,或信息。

為了應對其中一些風險,駱駝包括一種“嚴格”解釋模式,該模式可實施控制流量語句的更嚴格的數據依賴性跟踪,從而使循環或條件性的操作取決於條件變量本身。這提供了更強的保護,但可能需要更多用戶確認涉及敏感數據的操作,冒著用戶疲勞的風險。

本文還通過控制工具執行和數據流來表明駱駝的體系結構,可能會提供

的第7節中。

。建築優先的方法。隨著人工智能代理人變得越來越自治-諸如Anthropic的Ciso Jason Clinton之類的行業專家所期望的未來,他最近預測了“虛擬員工”代理人的到來-這種結構化的安全架構可能變得越來越必要。