Derrotando Injeções de Prompt por Design
Defeating Prompt Injections by Design
March 24, 2025
Autores: Edoardo Debenedetti, Ilia Shumailov, Tianqi Fan, Jamie Hayes, Nicholas Carlini, Daniel Fabian, Christoph Kern, Chongyang Shi, Andreas Terzis, Florian Tramèr
cs.AI
Resumo
Modelos de Linguagem de Grande Escala (LLMs) estão sendo cada vez mais implantados em sistemas agentes que interagem com um ambiente externo. No entanto, os agentes baseados em LLMs são vulneráveis a ataques de injeção de prompt ao lidar com dados não confiáveis. Neste artigo, propomos o CaMeL, uma defesa robusta que cria uma camada de proteção ao redor do LLM, protegendo-o mesmo quando os modelos subjacentes podem ser suscetíveis a ataques. Para operar, o CaMeL extrai explicitamente os fluxos de controle e de dados da consulta (confiável); portanto, os dados não confiáveis recuperados pelo LLM nunca podem impactar o fluxo do programa. Para melhorar ainda mais a segurança, o CaMeL se baseia em uma noção de capacidade para prevenir a exfiltração de dados privados por meio de fluxos de dados não autorizados. Demonstramos a eficácia do CaMeL ao resolver 67% das tarefas com segurança comprovada no AgentDojo [NeurIPS 2024], um recente benchmark de segurança para agentes.
English
Large Language Models (LLMs) are increasingly deployed in agentic systems
that interact with an external environment. However, LLM agents are vulnerable
to prompt injection attacks when handling untrusted data. In this paper we
propose CaMeL, a robust defense that creates a protective system layer around
the LLM, securing it even when underlying models may be susceptible to attacks.
To operate, CaMeL explicitly extracts the control and data flows from the
(trusted) query; therefore, the untrusted data retrieved by the LLM can never
impact the program flow. To further improve security, CaMeL relies on a notion
of a capability to prevent the exfiltration of private data over unauthorized
data flows. We demonstrate effectiveness of CaMeL by solving 67% of tasks
with provable security in AgentDojo [NeurIPS 2024], a recent agentic security
benchmark.Summary
AI-Generated Summary