为新竹智慧旅游设计安全聊天机器人,防御提示注入攻击。
Design and Implementation of a Secure RAG-Enhanced AI Chatbot for Smart Tourism Customer Service: Defending Against Prompt Injection Attacks -- A Case Study of Hsinchu, Taiwan
- 结合RAG与多层语言分析,实现意图分解与知识增强
- 95%以上正常请求准确率,85%攻击拦截率(基于GPT-5)
- 适合关注AI安全、智能客服与可持续旅游的开发者
随着智慧旅游发展,人工智能聊天机器人已成为提供个性化实时服务的重要工具,有助于促进可持续性与效率。然而,这类系统日益面临提示注入攻击威胁,攻击者可通过操控输入诱导泄露敏感信息或生成有害内容。本文以新竹智慧旅游服务为例,提出并实现一种安全的检索增强生成(RAG)聊天机器人系统。该系统融合RAG与API调用、多层级语言分析及多重防御机制,具备高上下文感知能力与安全性。核心特性包括分层响应策略、基于RAG的知识锚定,以及在词汇、语义和语用层面的意图分解。防御机制包含系统规范、意图判断看门人,以及反向RAG文本优先验证数据。同时,使用2025年8月7日发布的GPT-5变体进行鲁棒性评估。通过674个恶意提示与223个正常查询测试,系统在正常任务中准确率超过95%,显著检测出提示注入攻击。GPT-5可阻挡约85%攻击,显示进展但仍需多层次防护。研究强调对可持续旅游、多语言可达性与伦理化AI部署的贡献。本工作提供了一个可落地的智慧旅游安全聊天机器人框架,推动可靠可信的人工智能应用。
原文摘要 · Abstract (English)
As smart tourism evolves, AI-powered chatbots have become indispensable for delivering personalized, real-time assistance to travelers while promoting sustainability and efficiency. However, these systems are increasingly vulnerable to prompt injection attacks, where adversaries manipulate inputs to elicit unintended behaviors such as leaking sensitive information or generating harmful content. This paper presents a case study on the design and implementation of a secure retrieval-augmented generation (RAG) chatbot for Hsinchu smart tourism services. The system integrates RAG with API function calls, multi-layered linguistic analysis, and guardrails against injections, achieving high contextual awareness and security. Key features include a tiered response strategy, RAG-driven knowledge grounding, and intent decomposition across lexical, semantic, and pragmatic levels. Defense mechanisms include system norms, gatekeepers for intent judgment, and reverse RAG text to prioritize verified data. We also benchmark a GPT-5 variant (released 2025-08-07) to assess inherent robustness. Evaluations with 674 adversarial prompts and 223 benign queries show over 95% accuracy on benign tasks and substantial detection of injection attacks. GPT-5 blocked about 85% of attacks, showing progress yet highlighting the need for layered defenses. Findings emphasize contributions to sustainable tourism, multilingual accessibility, and ethical AI deployment. This work offers a practical framework for deploying secure chatbots in smart tourism and contributes to resilient, trustworthy AI applications.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。