Privacy-Preserving Prompt Injection Detection for Smart Cloud-Deployed Large Language Models
Large Language Models (LLMs) have recently gained popularity for tasks like text generation and automated reasoning, often hosted on cloud servers to handle large-scale user interactions. Yet this setup faces a critical challenge, prompt injection attacks, where adversaries craft malicious text to bypass an LLM’s safety constraints and policy filters. Attackers constantly evolve new injection tactics, rendering static defenses ineffective. While service providers may wish to store user inputs for security audits, this practice poses serious privacy and data-protection risks. User prompts can contain personal or confidential information subject to strict regulatory requirements. To address these conflicting demands of security monitoring and user privacy, we propose a privacy-preserving prompt injection detection scheme via hash and embedding-based auditing for smart cloud-deployed LLMs. Our approach segments each user prompt into smaller chunks and stores only non-invertible representations of them—cryptographic hashes for exact matches and vector embeddings for near-match detection. This enables robust identification of both verbatim and paraphrased threats without retaining any plaintext data. Furthermore, newly discovered injection patterns can trigger retrospective audits on previously stored chunks, greatly enhancing attack traceability. We also introduce an optional blockchain-based logging mechanism for tamper-proof event records. Empirical results show that our method achieves high detection accuracy against diverse injection techniques while safeguarding sensitive user information.
Authors
- Jun Wu (ORCID: https://orcid.org/0000-0003-2483-6980)
- Guozhi Hao (ORCID: https://orcid.org/0000-0001-6043-5290)
Institutions
- Waseda University (JP)
Publication Details
- Published
- 2025-05-09
- DOI
- https://doi.org/10.1109/smartcloud66068.2025.00009
- Citations
- 1
- Primary Topic
- Privacy-Preserving Technologies in Data
- Type
- article
- Field-Weighted Citation Impact
- 2.48
Funders
- China Scholarship Council