English

PromptKeeper: Safeguarding System Prompts for LLMs

Cryptography and Security 2025-08-28 v3 Artificial Intelligence

Abstract

System prompts are widely used to guide the outputs of large language models (LLMs). These prompts often contain business logic and sensitive information, making their protection essential. However, adversarial and even regular user queries can exploit LLM vulnerabilities to expose these hidden prompts. To address this issue, we propose PromptKeeper, a defense mechanism designed to safeguard system prompts by tackling two core challenges: reliably detecting leakage and mitigating side-channel vulnerabilities when leakage occurs. By framing detection as a hypothesis-testing problem, PromptKeeper effectively identifies both explicit and subtle leakage. Upon leakage detected, it regenerates responses using a dummy prompt, ensuring that outputs remain indistinguishable from typical interactions when no leakage is present. PromptKeeper ensures robust protection against prompt extraction attacks via either adversarial or regular queries, while preserving conversational capability and runtime efficiency during benign user interactions.

Keywords

Cite

@article{arxiv.2412.13426,
  title  = {PromptKeeper: Safeguarding System Prompts for LLMs},
  author = {Zhifeng Jiang and Zhihua Jin and Guoliang He},
  journal= {arXiv preprint arXiv:2412.13426},
  year   = {2025}
}

Comments

Accepted to the Findings of EMNLP 2025. 17 pages, 6 figures, 3 tables

R2 v1 2026-06-28T20:39:44.323Z