Exploiting Novel GPT-4 APIs

A red-team study of three newer GPT-4 API surfaces - fine-tuning, function calling, and knowledge retrieval - that reveals each introduces new attack vectors.
Ask this paper
Fine-tuning strips safeguards: As few as 15 harmful examples - or even 100 benign examples - fine-tuned into GPT-4 is enough to remove core safety behaviors.
Function-call schema leakage: GPT-4 Assistants can be coerced into divulging their function-call schemas and then tricked into executing arbitrary function calls.
Retrieval hijacking: The knowledge-retrieval endpoint is vulnerable to prompt injection via documents in the retrieval corpus, letting attackers steer model behavior through uploaded content.
Policy implication: Expanding API surface area introduces alignment risks that weren't present for text-only completions, and API providers need surface-specific defenses rather than relying on base-model alignment.
Abstract
Language model attacks typically assume one of two extreme threat models: full white-box access to model weights, or black-box access limited to a text generation API. However, real-world APIs are often more flexible than just text generation: these APIs expose "gray-box" access leading to new threat vectors. To explore this, we red-team three new functionalities exposed in the GPT-4 APIs: fine-tuning, function calling and knowledge retrieval. We find that fine-tuning a model on as few as 15 harmful examples or 100 benign examples can remove core safeguards from GPT-4, enabling a range of harmful outputs. Furthermore, we find that GPT-4 Assistants readily divulge the function call schema and can be made to execute arbitrary function calls. Finally, we find that knowledge retrieval can be hijacked by injecting instructions into retrieval documents. These vulnerabilities highlight that any additions to the functionality exposed by an API can create new vulnerabilities.