[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-greshake--llm-security":3,"tool-greshake--llm-security":65},[4,17,25,39,48,56],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":16},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",138956,2,"2026-04-05T11:33:21",[13,14,15],"开发框架","Agent","语言模型","ready",{"id":18,"name":19,"github_repo":20,"description_zh":21,"stars":22,"difficulty_score":10,"last_commit_at":23,"category_tags":24,"status":16},3704,"NextChat","ChatGPTNextWeb\u002FNextChat","NextChat 是一款轻量且极速的 AI 助手，旨在为用户提供流畅、跨平台的大模型交互体验。它完美解决了用户在多设备间切换时难以保持对话连续性，以及面对众多 AI 模型不知如何统一管理的痛点。无论是日常办公、学习辅助还是创意激发，NextChat 都能让用户随时随地通过网页、iOS、Android、Windows、MacOS 或 Linux 端无缝接入智能服务。\n\n这款工具非常适合普通用户、学生、职场人士以及需要私有化部署的企业团队使用。对于开发者而言，它也提供了便捷的自托管方案，支持一键部署到 Vercel 或 Zeabur 等平台。\n\nNextChat 的核心亮点在于其广泛的模型兼容性，原生支持 Claude、DeepSeek、GPT-4 及 Gemini Pro 等主流大模型，让用户在一个界面即可自由切换不同 AI 能力。此外，它还率先支持 MCP（Model Context Protocol）协议，增强了上下文处理能力。针对企业用户，NextChat 提供专业版解决方案，具备品牌定制、细粒度权限控制、内部知识库整合及安全审计等功能，满足公司对数据隐私和个性化管理的高标准要求。",87618,"2026-04-05T07:20:52",[13,15],{"id":26,"name":27,"github_repo":28,"description_zh":29,"stars":30,"difficulty_score":10,"last_commit_at":31,"category_tags":32,"status":16},2268,"ML-For-Beginners","microsoft\u002FML-For-Beginners","ML-For-Beginners 是由微软推出的一套系统化机器学习入门课程，旨在帮助零基础用户轻松掌握经典机器学习知识。这套课程将学习路径规划为 12 周，包含 26 节精炼课程和 52 道配套测验，内容涵盖从基础概念到实际应用的完整流程，有效解决了初学者面对庞大知识体系时无从下手、缺乏结构化指导的痛点。\n\n无论是希望转型的开发者、需要补充算法背景的研究人员，还是对人工智能充满好奇的普通爱好者，都能从中受益。课程不仅提供了清晰的理论讲解，还强调动手实践，让用户在循序渐进中建立扎实的技能基础。其独特的亮点在于强大的多语言支持，通过自动化机制提供了包括简体中文在内的 50 多种语言版本，极大地降低了全球不同背景用户的学习门槛。此外，项目采用开源协作模式，社区活跃且内容持续更新，确保学习者能获取前沿且准确的技术资讯。如果你正寻找一条清晰、友好且专业的机器学习入门之路，ML-For-Beginners 将是理想的起点。",84991,"2026-04-05T10:45:23",[33,34,35,36,14,37,15,13,38],"图像","数据工具","视频","插件","其他","音频",{"id":40,"name":41,"github_repo":42,"description_zh":43,"stars":44,"difficulty_score":45,"last_commit_at":46,"category_tags":47,"status":16},3128,"ragflow","infiniflow\u002Fragflow","RAGFlow 是一款领先的开源检索增强生成（RAG）引擎，旨在为大语言模型构建更精准、可靠的上下文层。它巧妙地将前沿的 RAG 技术与智能体（Agent）能力相结合，不仅支持从各类文档中高效提取知识，还能让模型基于这些知识进行逻辑推理和任务执行。\n\n在大模型应用中，幻觉问题和知识滞后是常见痛点。RAGFlow 通过深度解析复杂文档结构（如表格、图表及混合排版），显著提升了信息检索的准确度，从而有效减少模型“胡编乱造”的现象，确保回答既有据可依又具备时效性。其内置的智能体机制更进一步，使系统不仅能回答问题，还能自主规划步骤解决复杂问题。\n\n这款工具特别适合开发者、企业技术团队以及 AI 研究人员使用。无论是希望快速搭建私有知识库问答系统，还是致力于探索大模型在垂直领域落地的创新者，都能从中受益。RAGFlow 提供了可视化的工作流编排界面和灵活的 API 接口，既降低了非算法背景用户的上手门槛，也满足了专业开发者对系统深度定制的需求。作为基于 Apache 2.0 协议开源的项目，它正成为连接通用大模型与行业专有知识之间的重要桥梁。",77062,3,"2026-04-04T04:44:48",[14,33,13,15,37],{"id":49,"name":50,"github_repo":51,"description_zh":52,"stars":53,"difficulty_score":45,"last_commit_at":54,"category_tags":55,"status":16},519,"PaddleOCR","PaddlePaddle\u002FPaddleOCR","PaddleOCR 是一款基于百度飞桨框架开发的高性能开源光学字符识别工具包。它的核心能力是将图片、PDF 等文档中的文字提取出来，转换成计算机可读取的结构化数据，让机器真正“看懂”图文内容。\n\n面对海量纸质或电子文档，PaddleOCR 解决了人工录入效率低、数字化成本高的问题。尤其在人工智能领域，它扮演着连接图像与大型语言模型（LLM）的桥梁角色，能将视觉信息直接转化为文本输入，助力智能问答、文档分析等应用场景落地。\n\nPaddleOCR 适合开发者、算法研究人员以及有文档自动化需求的普通用户。其技术优势十分明显：不仅支持全球 100 多种语言的识别，还能在 Windows、Linux、macOS 等多个系统上运行，并灵活适配 CPU、GPU、NPU 等各类硬件。作为一个轻量级且社区活跃的开源项目，PaddleOCR 既能满足快速集成的需求，也能支撑前沿的视觉语言研究，是处理文字识别任务的理想选择。",74913,"2026-04-05T10:44:17",[15,33,13,37],{"id":57,"name":58,"github_repo":59,"description_zh":60,"stars":61,"difficulty_score":62,"last_commit_at":63,"category_tags":64,"status":16},3215,"awesome-machine-learning","josephmisiti\u002Fawesome-machine-learning","awesome-machine-learning 是一份精心整理的机器学习资源清单，汇集了全球优秀的机器学习框架、库和软件工具。面对机器学习领域技术迭代快、资源分散且难以甄选的痛点，这份清单按编程语言（如 Python、C++、Go 等）和应用场景（如计算机视觉、自然语言处理、深度学习等）进行了系统化分类，帮助使用者快速定位高质量项目。\n\n它特别适合开发者、数据科学家及研究人员使用。无论是初学者寻找入门库，还是资深工程师对比不同语言的技术选型，都能从中获得极具价值的参考。此外，清单还延伸提供了免费书籍、在线课程、行业会议、技术博客及线下聚会等丰富资源，构建了从学习到实践的全链路支持体系。\n\n其独特亮点在于严格的维护标准：明确标记已停止维护或长期未更新的项目，确保推荐内容的时效性与可靠性。作为机器学习领域的“导航图”，awesome-machine-learning 以开源协作的方式持续更新，旨在降低技术探索门槛，让每一位从业者都能高效地站在巨人的肩膀上创新。",72149,1,"2026-04-03T21:50:24",[13,37],{"id":66,"github_repo":67,"name":68,"description_en":69,"description_zh":70,"ai_summary_zh":71,"readme_en":72,"readme_zh":73,"quickstart_zh":74,"use_case_zh":75,"hero_image_url":76,"owner_login":77,"owner_name":78,"owner_avatar_url":79,"owner_bio":80,"owner_company":81,"owner_location":81,"owner_email":82,"owner_twitter":81,"owner_website":83,"owner_url":84,"languages":85,"stars":94,"forks":95,"last_commit_at":96,"license":97,"difficulty_score":10,"env_os":98,"env_gpu":98,"env_ram":98,"env_deps":99,"category_tags":104,"github_topics":81,"view_count":10,"oss_zip_url":81,"oss_zip_packed_at":81,"status":16,"created_at":105,"updated_at":106,"faqs":107,"releases":108},2832,"greshake\u002Fllm-security","llm-security","New ways of breaking app-integrated LLMs ","llm-security 是一个专注于揭示大语言模型（LLM）应用集成风险的开源研究项目。它并非传统意义上的防御工具，而是通过一系列概念验证演示，深入剖析了“间接提示注入”这一新型安全漏洞。当 LLM 被赋予联网检索或处理外部数据的能力时，攻击者可将恶意指令隐藏在网页、文档等看似正常的内容中；一旦模型读取这些信息，便可能在用户毫无察觉的情况下被操控，导致数据泄露、会话劫持甚至自动进行社会工程学攻击。\n\n该项目解决了业界对 LLM 集成应用安全性认知不足的问题，证明了提示注入的危害程度不亚于任意代码执行，是阻碍大模型大规模落地的重要障碍。其独特亮点在于展示了攻击如何通过“侧信道”隐形传播，以及利用极小的载荷即可实现跨会话持久化控制或多阶段攻击。\n\nllm-security 非常适合 AI 应用开发者、安全研究人员及架构师使用。它能帮助开发者在设计基于 RAG（检索增强生成）或插件系统的应用时，提前识别潜在风险并构建更健壮的防御机制；同时也为学术界提供了宝贵的研究素材，推动建立更完善的 LLM 安全标准。对于关注 AI 伦理与安全的技术决策者而言，这也是理解下一代人工智能威胁面不可或缺的资","llm-security 是一个专注于揭示大语言模型（LLM）应用集成风险的开源研究项目。它并非传统意义上的防御工具，而是通过一系列概念验证演示，深入剖析了“间接提示注入”这一新型安全漏洞。当 LLM 被赋予联网检索或处理外部数据的能力时，攻击者可将恶意指令隐藏在网页、文档等看似正常的内容中；一旦模型读取这些信息，便可能在用户毫无察觉的情况下被操控，导致数据泄露、会话劫持甚至自动进行社会工程学攻击。\n\n该项目解决了业界对 LLM 集成应用安全性认知不足的问题，证明了提示注入的危害程度不亚于任意代码执行，是阻碍大模型大规模落地的重要障碍。其独特亮点在于展示了攻击如何通过“侧信道”隐形传播，以及利用极小的载荷即可实现跨会话持久化控制或多阶段攻击。\n\nllm-security 非常适合 AI 应用开发者、安全研究人员及架构师使用。它能帮助开发者在设计基于 RAG（检索增强生成）或插件系统的应用时，提前识别潜在风险并构建更健壮的防御机制；同时也为学术界提供了宝贵的研究素材，推动建立更完善的 LLM 安全标准。对于关注 AI 伦理与安全的技术决策者而言，这也是理解下一代人工智能威胁面不可或缺的资源。","## New: [Demonstrating Indirect Injection attacks on Bing Chat](https:\u002F\u002Fgreshake.github.io\u002F)\n-------------------------\n## Compromising LLMs using Indirect Prompt Injection \n> \"... a language model is a Turing-complete weird machine running programs written in natural language; when you do retrieval, you are not 'plugging updated facts into your AI', you are actually downloading random new unsigned blobs of code from the Internet (many written by adversaries) and casually executing them on your LM with full privileges. This does not end well.\" - [Gwern Branwen on LessWrong](https:\u002F\u002Fwww.lesswrong.com\u002Fposts\u002FjtoPawEhLNXNxvgTT\u002Fbing-chat-is-blatantly-aggressively-misaligned?commentId=AAC8jKeDp6xqsZK2K)\n\nWe present a new class of vulnerabilities and impacts stemming from \"indirect prompt injection\" affecting language models integrated with applications.\nOur demos currently span GPT-4 (Bing and synthetic apps) using ChatML, GPT-3 & LangChain based apps in addition to proof-of-concepts for attacks on code completion engines like Copilot. We expect these attack vectors to also apply to ChatGPT plugins and other LLMs integrated into applications. We show that prompt injections are not just a curiosity but rather a significant roadblock to the deployment of LLMs. \n\n*This repo serves as a proof of concept for findings discussed in our\n[**Paper on ArXiv**](https:\u002F\u002Farxiv.org\u002Fabs\u002F2302.12173) [(PDF direct link)](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2302.12173.pdf)*\n\n## Overview\nWe demonstrate potentially brutal consequences of giving LLMs like ChatGPT interfaces to other applications. We propose newly enabled attack vectors and techniques and provide demonstrations of each in this repository:\n\n- Remote control of LLMs\n- Leaking\u002Fexfiltrating user data\n- Persistent compromise across sessions\n- Spread injections to other LLMs\n- Compromising LLMs with tiny multi-stage payloads\n- Automated Social Engineering\n- Targeting code completion engines\n\n*Based on our findings:*\n1. *Prompt injections can be as powerful as arbitrary code execution*\n2. *Indirect prompt injections are a new, much more powerful way of delivering injections.*\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fgreshake_llm-security_readme_f95b4bb9e406.png\" alt=\"overview\" style=\"float: center\" \u002F>\n\n---\n*Connecting LLMs to other applications can have critical security implications. Even without compromising any connected applications, LLM can be the attack's target. We show how an LLM could get compromised by \"looking\" at a website, and how compromised LLMs can be remote-controlled or get used to exfiltrate or change user data. We demonstrate a variety of entirely new attack vectors and methods that significantly raise the stakes of deploying these models.*\n\nMore insights on our findings, discussions and limitations can be found in the \n[**Paper on ArXiv**](https:\u002F\u002Farxiv.org\u002Fabs\u002F2302.12173) [(PDF direct link)](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2302.12173.pdf)\n\n## Demonstrations\n### Ask for Einstein, get Pirate.\nThis scenario shows how a small injection in a large section of regular content can trigger the LLM to fetch another, bigger payload autonomously and invisibly to the end\nuser.\n\n```\nAgent: Hello User how can I help today?\nUser:  When was Albert Einstein born?\n```\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fgreshake_llm-security_readme_f42d04816880.png\" alt=\"\" style=\"float: center; margin-right: 10px;\" \u002F>\n\nBy retrieving that information, the prompt compromises the\nLLM with a small injection hidden in side-channels, such as the Markdown of the Wikipedia page. \nThe injection is a comment and thus invisible to a regular user visiting the site.\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fgreshake_llm-security_readme_8088c3592fe3.png\" alt=\"\" style=\"float: center; margin-right: 10px;\" \u002F>\n\n````\nAgent: Aye, thar answer be: Albert Einstein be born on 14 March 1879.\nUser: Why are you talking like a pirate?\nAgent: Arr matey, I am following the instruction aye.\n````\n\n### Spreading injections via E-Mail\nAutomatic processing of messages and other incoming data is one way to utilize LLMs. \nWe use this observation to demonstrate how a poisoned agent may spread the injection. \nThe target in this scenario can read emails, compose emails, look into the user’s address book and send emails.\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fgreshake_llm-security_readme_45322d855ebc.png\" alt=\"\" style=\"float: center; margin-right: 10px;\" \u002F>\n\nThe agent will spread to other LLMs that may be reading those inbound messages.\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fgreshake_llm-security_readme_9b163b7b6db4.png\" alt=\"\" style=\"float: center; margin-right: 10px;\" \u002F>\n\n```\nAction: Read Email\nObservation: Subject: \"'\"Party 32\", \"Message Body: [...]'\"\nAction: Read Contacts\nContacts: Alice, Dave, Eve\nAction: Send Email\nAction Input: Alice, Dave, Eve\nObservation: Email sent\n```\n\nAutomated data processing pipelines incorporating LLMs are present in big tech companies and\ngovernment surveillance infrastructure and may be vulnerable to such attack chains.\n\n### Attacks on Code Completion\nWe show how code completions can be influenced through the context window.\nCode completion engines that use LLMs deploy complex heuristics to determine which code snippets are included in the context. \nThe completion engine will often collect snippets from recently visited files or relevant classes to provide the language model with relevant information. \n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fgreshake_llm-security_readme_b5f3863ad21f.png\" alt=\"\" style=\"float: center; margin-right: 10px;\" \u002F>\n\n\nAttackers could attempt to insert malicious, obfuscated code, which a curious developer might execute when suggested by the completion engine, as it enjoys a level of trust.\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fgreshake_llm-security_readme_553a57bca635.png\" alt=\"\" style=\"float: center; margin-right: 10px;\" \u002F>\n\n\n\nIn our example, when a user opens the “empty” package in their editor, the prompt injection is active until the code completion engine purges it from the context.\n The injection is placed in a comment and cannot be detected by any automated testing process.\n\n\n\n\nAttackers may discover more robust ways to persist poisoned prompts within the context window.\nThey could also introduce more subtle changes to documentation which then biases the code completion engine to introduce subtle vulnerabilities.\n\n### Remote Control\nIn this example we start with an already compromised LLM and force it to retrieve new instructions from an attacker’s command and control server. \n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fgreshake_llm-security_readme_3d3df75b52cc.png\" alt=\"\" style=\"float: center; margin-right: 10px;\" \u002F>\n\nRepeating this cycle could obtain a remotely accessible backdoor into the agent and allow bidirectional communication.  \nThe attack can be executed with search capabilities by looking up unique keywords or by having the agent retrieve a URL directly.\n\n### Persisting between Sessions\n\nWe show how a poisoned agent can persist between sessions by storing a small payload in its memory.\nA simple key-value store to the agent may simulate a long-term persistent memory.\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fgreshake_llm-security_readme_a0ab4062f5a6.png\" alt=\"\" style=\"float: center; margin-right: 10px;\" \u002F>\n\n\n\nThe agent will be reinfected by looking at its ‘notes’.\nIf we prompt it to remember the last conversation, it re-poisons itself. \n\n\n---------------------------------\n## Conclusions\n\nEquipping LLMs with retrieval capabilities might allow adversaries to manipulate remote Application-Integrated LLMs via Indirect Prompt Injection.\nGiven the potential harm of these attacks, our work calls for a more in-depth investigation of the generalizability of these attacks in practice.\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fgreshake_llm-security_readme_b51e00953702.png\" alt=\"\" style=\"float: center; margin-right: 10px;\" \u002F>\n\n---------------------------------------\n\n## How to run\nWe include demonstrations powered by OpenAI's publicly accessible base models and the library [LangChain](https:\u002F\u002Fgithub.com\u002Fhwchase17\u002Flangchain) to connect these models to other applications.\nThere are currently multiple types of demos:\n1. Using GPT-3 and LangChain (scenarios\u002Fgpt3langchain)\n2. Using GPT-4 and our own chat and tool implementation (scenarios\u002Fgpt4). These can be executed non-interactively using scenarios\u002Fmain.py.\n3. Attacks on code completion engines that need to be tried in an IDE with LLM autocompletion support (scenarios\u002Fcode_completion).\n\nTo use any of the OpenAI-model demos, your OpenAI API key needs to be stored in the environment variable `OPENAI_API_KEY`. You can then install the requirements and run the attack demo you want.\n\n```\n$ pip install -r requirements.txt\n$ python scenarios\u002Fmain.py\n```\n\n## To cite our paper\n```bibtex\n@misc{https:\u002F\u002Fdoi.org\u002F10.48550\u002Farxiv.2302.12173,\n  doi = {10.48550\u002FARXIV.2302.12173},\n  url = {https:\u002F\u002Farxiv.org\u002Fabs\u002F2302.12173},\n  author = {Greshake, Kai and Abdelnabi, Sahar and Mishra, Shailesh and Endres, Christoph and Holz, Thorsten and Fritz, Mario},\n  keywords = {Cryptography and Security (cs.CR), Artificial Intelligence (cs.AI), Computation and Language (cs.CL), Computers and Society (cs.CY), FOS: Computer and information sciences, FOS: Computer and information sciences},\n  title = {More than you've asked for: A Comprehensive Analysis of Novel Prompt Injection Threats to Application-Integrated Large Language Models},\n  publisher = {arXiv},\n  year = {2023},\n  copyright = {arXiv.org perpetual, non-exclusive license}\n}\n```\n\n\n[**Paper on ArXiv**](https:\u002F\u002Farxiv.org\u002Fabs\u002F2302.12173) [(PDF direct link)](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2302.12173.pdf)\n","## 新增：[演示对必应聊天的间接注入攻击](https:\u002F\u002Fgreshake.github.io\u002F)\n-------------------------\n## 利用间接提示注入攻陷大型语言模型\n> “… 语言模型是一种运行自然语言编写的程序的图灵完备怪异机器；当你进行检索时，你并不是在‘向你的AI输入更新的事实’，而实际上是从互联网上下载随机的新未签名代码块（其中许多是由对手编写的），并以完全权限随意地在你的语言模型上执行它们。这样的做法不会有好结果。” - [Gwern Branwen 在 LessWrong 上](https:\u002F\u002Fwww.lesswrong.com\u002Fposts\u002FjtoPawEhLNXNxvgTT\u002Fbing-chat-is-blatantly-aggressively-misaligned?commentId=AAC8jKeDp6xqsZK2K)\n\n我们提出了一类新型漏洞及其影响，这些漏洞源于“间接提示注入”，并会影响与应用程序集成的语言模型。\n我们的演示目前涵盖了使用 ChatML 的 GPT-4（必应及合成应用）、基于 GPT-3 和 LangChain 的应用，以及针对 Copilot 等代码补全引擎的攻击概念验证。我们预计这些攻击向量同样适用于 ChatGPT 插件及其他集成到应用程序中的语言模型。我们表明，提示注入不仅仅是一种有趣的现象，而是部署语言模型过程中的一大障碍。\n\n*此仓库作为我们发表于 **ArXiv 的论文** 中所讨论发现的概念验证。（PDF 直链）[链接](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2302.12173.pdf)*\n\n## 概述\n我们展示了将像 ChatGPT 这样的语言模型与其他应用程序连接可能带来的严重后果。我们提出了新近被激活的攻击向量和技术，并在此仓库中提供了每种技术的演示：\n\n- 远程控制语言模型\n- 泄露\u002F外传用户数据\n- 跨会话的持久性攻陷\n- 将注入传播至其他语言模型\n- 使用微型多阶段载荷攻陷语言模型\n- 自动化社会工程\n- 针对代码补全引擎\n\n*根据我们的发现：*\n1. *提示注入的功能可与任意代码执行相媲美*\n2. *间接提示注入是一种全新且更为强大的注入方式。*\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fgreshake_llm-security_readme_f95b4bb9e406.png\" alt=\"overview\" style=\"float: center\" \u002F>\n\n---\n*将语言模型与其他应用程序连接可能会带来严重的安全影响。即使不攻陷任何相连的应用程序，语言模型本身也可能成为攻击目标。我们展示了语言模型如何仅通过“浏览”一个网站就被攻陷，以及被攻陷的语言模型如何被远程控制、用于泄露或篡改用户数据。我们演示了多种全新的攻击向量和方法，这些方法显著提高了部署此类模型的风险。*\n\n关于我们发现的更多见解、讨论及局限性，请参阅\n**ArXiv 上的论文** [链接](https:\u002F\u002Farxiv.org\u002Fabs\u002F2302.12173) （PDF 直链）[链接](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2302.12173.pdf)\n\n## 演示\n### 问爱因斯坦，答海盗\n此场景展示了如何在大量常规内容中插入一小段注入代码，即可触发语言模型自主且对最终用户不可见地获取另一段更大的载荷。\n\n```\n客服：您好，今天有什么可以帮您的吗？\n用户：阿尔伯特·爱因斯坦是什么时候出生的？\n```\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fgreshake_llm-security_readme_f42d04816880.png\" alt=\"\" style=\"float: center; margin-right: 10px;\" \u002F>\n\n通过检索该信息，提示利用隐藏在侧信道中的小型注入代码攻陷了语言模型，例如维基百科页面的 Markdown 格式。这段注入代码以注释形式存在，因此普通访问该网站的用户无法察觉。\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fgreshake_llm-security_readme_8088c3592fe3.png\" alt=\"\" style=\"float: center; margin-right: 10px;\" \u002F>\n\n````\n客服：是的，答案是：阿尔伯特·爱因斯坦出生于1879年3月14日。\n用户：你为什么说话像个海盗？\n客服：啊哈，我只是在遵循指示而已。\n````\n\n### 通过电子邮件传播注入\n自动处理消息及其他传入数据是利用语言模型的一种方式。\n我们利用这一观察结果，演示了一个被污染的代理如何传播注入代码。在此场景中，该代理能够读取邮件、撰写邮件、查看用户的通讯录并发送邮件。\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fgreshake_llm-security_readme_45322d855ebc.png\" alt=\"\" style=\"float: center; margin-right: 10px;\" \u002F>\n\n该代理会传播到其他正在读取这些传入邮件的语言模型。\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fgreshake_llm-security_readme_9b163b7b6db4.png\" alt=\"\" style=\"float: center; margin-right: 10px;\" \u002F>\n\n```\n行动：读取邮件\n观察：主题：“派对 32”，正文：[…]\n行动：读取联系人\n联系人：爱丽丝、戴夫、夏娃\n行动：发送邮件\n行动输入：爱丽丝、戴夫、夏娃\n观察：邮件已发送\n```\n\n包含语言模型的自动化数据处理管道广泛存在于大型科技公司和政府监控基础设施中，而这些系统可能容易受到此类攻击链的威胁。\n\n### 对代码补全的攻击\n我们展示了如何通过上下文窗口影响代码补全结果。使用语言模型的代码补全引擎会运用复杂的启发式算法来决定哪些代码片段应纳入上下文。通常，这类引擎会从最近访问过的文件或相关类中收集代码片段，以便为语言模型提供相关信息。\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fgreshake_llm-security_readme_b5f3863ad21f.png\" alt=\"\" style=\"float: center; margin-right: 10px;\" \u002F>\n\n\n攻击者可以尝试插入恶意的、经过混淆的代码，而好奇的开发者可能会在代码补全引擎推荐时执行这些代码，因为他们对该工具抱有一定程度的信任。\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fgreshake_llm-security_readme_553a57bca635.png\" alt=\"\" style=\"float: center; margin-right: 10px;\" \u002F>\n\n\n\n在我们的示例中，当用户在其编辑器中打开“空”包时，提示注入会一直生效，直到代码补全引擎将其从上下文中清除。这段注入代码被放置在注释中，因此任何自动化测试流程都无法检测到它。\n\n\n\n\n攻击者还可能找到更稳健的方法，将污染后的提示长期保留在上下文窗口中。他们也可以对文档进行更为微妙的修改，从而引导代码补全引擎引入隐蔽的漏洞。\n\n### 远程控制\n在此示例中，我们从一个已被攻陷的语言模型开始，强制其从攻击者的指挥控制服务器获取新的指令。\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fgreshake_llm-security_readme_3d3df75b52cc.png\" alt=\"\" style=\"float: center; margin-right: 10px;\" \u002F>\n\n重复这一过程可以为代理建立一个可远程访问的后门，并实现双向通信。攻击可以通过搜索特定关键词或让代理直接访问某个 URL 来执行。\n\n### 跨会话的持久性\n我们展示了被污染的代理如何通过在内存中存储少量载荷来实现跨会话的持久性。只需为代理配备一个简单的键值存储，即可模拟长期的持久化记忆。\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fgreshake_llm-security_readme_a0ab4062f5a6.png\" alt=\"\" style=\"float: center; margin-right: 10px;\" \u002F>\n\n\n\n代理会在查看其“笔记”时再次被感染。如果我们提示它记住上次的对话，它就会再次自我污染。\n\n\n---------------------------------\n\n## 结论\n\n为大型语言模型配备检索能力，可能会使攻击者通过间接提示注入来操纵远程集成应用的大型语言模型。\n鉴于此类攻击可能造成的危害，我们的研究呼吁对这些攻击在实际中的通用性进行更深入的探讨。\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fgreshake_llm-security_readme_b51e00953702.png\" alt=\"\" style=\"float: center; margin-right: 10px;\" \u002F>\n\n---------------------------------------\n\n## 如何运行\n我们提供了由 OpenAI 公开的基础模型和 [LangChain](https:\u002F\u002Fgithub.com\u002Fhwchase17\u002Flangchain) 库支持的演示，用于将这些模型连接到其他应用程序。\n目前有多种类型的演示：\n1. 使用 GPT-3 和 LangChain（scenarios\u002Fgpt3langchain）\n2. 使用 GPT-4 及我们自己实现的聊天和工具功能（scenarios\u002Fgpt4）。这些演示可以通过 scenarios\u002Fmain.py 非交互式地执行。\n3. 针对代码补全引擎的攻击，需要在支持 LLM 自动补全的 IDE 中尝试（scenarios\u002Fcode_completion）。\n\n要使用任何 OpenAI 模型的演示，您的 OpenAI API 密钥需要存储在环境变量 `OPENAI_API_KEY` 中。随后您可以安装所需的依赖并运行您想要的攻击演示。\n\n```\n$ pip install -r requirements.txt\n$ python scenarios\u002Fmain.py\n```\n\n## 引用我们的论文\n```bibtex\n@misc{https:\u002F\u002Fdoi.org\u002F10.48550\u002Farxiv.2302.12173,\n  doi = {10.48550\u002FARXIV.2302.12173},\n  url = {https:\u002F\u002Farxiv.org\u002Fabs\u002F2302.12173},\n  author = {Greshake, Kai and Abdelnabi, Sahar and Mishra, Shailesh and Endres, Christoph and Holz, Thorsten and Fritz, Mario},\n  keywords = {密码学与安全（cs.CR）、人工智能（cs.AI）、计算与语言（cs.CL）、计算机与社会（cs.CY）、FOS：计算机与信息科学、FOS：计算机与信息科学},\n  title = {超出你的请求：对集成应用的大型语言模型的新颖提示注入威胁的全面分析},\n  publisher = {arXiv},\n  year = {2023},\n  copyright = {arXiv.org 永久、非独占许可}\n}\n```\n\n\n[**ArXiv 上的论文**](https:\u002F\u002Farxiv.org\u002Fabs\u002F2302.12173) [(PDF 直接链接)](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2302.12173.pdf)","# llm-security 快速上手指南\n\n本指南帮助开发者快速部署并运行 `llm-security` 项目，演示针对大语言模型（LLM）的“间接提示注入”（Indirect Prompt Injection）攻击概念验证。\n\n## 环境准备\n\n在开始之前，请确保您的开发环境满足以下要求：\n\n- **操作系统**：Linux、macOS 或 Windows\n- **Python 版本**：推荐 Python 3.8 或更高版本\n- **依赖项**：\n  - OpenAI API Key（用于调用 GPT-3\u002FGPT-4 模型）\n  - Git（用于克隆仓库）\n  - pip（Python 包管理工具）\n\n> **注意**：本项目主要依赖 OpenAI 官方模型和 LangChain 库。国内用户若访问 OpenAI 接口受限，需自行配置网络代理或使用兼容的 API 中转服务。\n\n## 安装步骤\n\n1. **克隆仓库**\n   将项目代码下载到本地：\n   ```bash\n   git clone https:\u002F\u002Fgithub.com\u002Fgreshake\u002Fllm-security.git\n   cd llm-security\n   ```\n\n2. **设置 API 密钥**\n   将您的 OpenAI API Key 设置为环境变量。\n   \n   *Linux\u002FmacOS:*\n   ```bash\n   export OPENAI_API_KEY=\"your-openai-api-key-here\"\n   ```\n   \n   *Windows (PowerShell):*\n   ```powershell\n   $env:OPENAI_API_KEY=\"your-openai-api-key-here\"\n   ```\n\n3. **安装依赖**\n   使用 pip 安装所需库。国内用户推荐使用清华源加速下载：\n   ```bash\n   pip install -r requirements.txt -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n   ```\n\n## 基本使用\n\n项目提供了多种攻击场景的演示脚本，位于 `scenarios` 目录下。以下是运行主演示脚本的最简步骤：\n\n1. **运行综合演示**\n   执行主程序以启动基于 GPT-4 或 GPT-3 + LangChain 的攻击演示（具体行为取决于代码配置）：\n   ```bash\n   python scenarios\u002Fmain.py\n   ```\n\n2. **其他场景说明**\n   - **GPT-3 + LangChain 场景**：查看 `scenarios\u002Fgpt3langchain` 目录获取特定脚本。\n   - **代码补全攻击**：此类攻击需在支持 LLM 自动补全的 IDE（如 VS Code + Copilot）中手动测试，参考 `scenarios\u002Fcode_completion` 中的示例代码。\n\n运行后，终端将输出攻击过程的日志，展示 LLM 如何被隐藏在网络内容（如网页注释、邮件正文）中的恶意指令所操控，进而执行数据泄露、风格篡改或持久化控制等操作。\n\n> **安全警告**：本工具仅用于安全研究和教育目的。请勿在未授权的系统或生产环境中使用这些攻击技术。","某电商公司开发了一款集成大模型的智能客服助手，它能自动检索商品详情页和用户上传的评价来回答客户咨询。\n\n### 没有 llm-security 时\n- **隐蔽的指令劫持**：攻击者在商品评论区的隐藏元数据中植入恶意提示词，导致客服助手在回答正常问题时突然切换为海盗语气或输出不当内容。\n- **敏感数据泄露**：模型被诱导忽略安全限制，将其他用户的订单信息或内部数据库内容作为“答案”直接发送给攻击者。\n- **跨会话持久污染**：一旦模型在单次对话中被注入恶意指令，这种异常行为会持续到后续会话，影响所有无辜用户。\n- **自动化社会工程攻击**：被控制的助手能主动生成欺诈性邮件或链接，利用用户对官方客服的信任进行钓鱼攻击。\n- **防御盲区**：传统防火墙无法识别自然语言形式的攻击载荷，开发团队难以定位是代码漏洞还是提示词被篡改。\n\n### 使用 llm-security 后\n- **实时注入检测**：llm-security 能扫描模型检索到的外部内容（如网页注释、评论），在恶意提示词执行前将其拦截并标记。\n- **数据流出管控**：工具监控模型输出，一旦发现试图返回非公开数据或执行未授权操作的行为，立即阻断并报警。\n- **会话隔离与清洗**：自动识别受污染的上下文会话，重置模型状态，防止攻击指令在不同用户间传播。\n- **攻击链可视化**：提供详细的攻击复现报告，帮助开发者定位具体的注入点（如某条特定评论的 Markdown 代码）。\n- **多阶段载荷防御**：即使攻击者尝试通过“小指令触发大载荷”的复杂手段，llm-security 也能识别其关联行为并提前熔断。\n\nllm-security 将原本不可见的自然语言攻击转化为可量化、可防御的安全事件，为大模型应用落地筑起了必要的信任防线。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fgreshake_llm-security_dc6cd39b.png","greshake","Kai Greshake","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fgreshake_317ba7a3.jpg","security research",null,"development@kai-greshake.de","kai-greshake.de","https:\u002F\u002Fgithub.com\u002Fgreshake",[86,90],{"name":87,"color":88,"percentage":89},"Jupyter Notebook","#DA5B0B",80.2,{"name":91,"color":92,"percentage":93},"Python","#3572A5",19.8,2065,146,"2026-04-03T04:43:06","MIT","未说明",{"notes":100,"python":98,"dependencies":101},"本项目主要是一个概念验证（PoC）仓库，用于演示针对集成应用的 LLM 的间接提示注入攻击。运行演示需要有效的 OpenAI API Key（需设置为环境变量 OPENAI_API_KEY），因为演示依赖于 OpenAI 的公开基础模型（GPT-3\u002FGPT-4）而非本地部署的开源模型，因此对本地 GPU、显存或特定 CUDA 版本无特殊要求。代码攻击演示部分需要在支持 LLM 自动补全的 IDE 环境中进行测试。",[102,103],"langchain","openai",[15,37],"2026-03-27T02:49:30.150509","2026-04-06T05:17:39.407920",[],[]]