最新资讯
stackoverflow.blog 欢迎来到芯片时代:半导体制造、AI 数据中心与芯片设计的未来 www.youtube.com AI Agent 总犯同样的错:CentralAgent AI 将记忆重构为经验系统 pub.towardsai.net Netflix 科学家建议重采样 LLM 评判:5 次仅将误差棒缩小 13% pub.towardsai.net Jev 作为 LLM 前的静默层:构建提示感知的模型路由器 reddit.com OpenAI 称 Astra 仅满足 10% 安全任务标准 dev.to FreeToken:在自有 GPU 上运行前沿 MoE 模型及其内存需求 dev.to 当 AI Agent 说“完成”时,究竟完成了什么? dev.to 部署 Underdog Bark 3.0 Pro:逐字转写、自定义后端与分块设置 dev.to 为艰难对话构建 AI:五个 Agent、一条安全正则与一位盲评监督者 techcrunch.com Palo Alto Networks 洽谈以 5 亿美元收购 AI Agent 安全初创公司 Clutch theinformation.com 黄仁勋被要求就涉华间谍指控向国会作简报 www.infoq.com Edera 推出 Object Capability Bounded Authority,试图将凭证与 AI Agent 工作负载隔离
多元动态
登录 注册
AI编码 dev.to · @Ilya Sib

如何避免向 LLM 泄露 API Key 与 PII:面向 Cursor 和 Claude 的零信任内存脱敏

原文 我的收藏

文章指出使用 Cursor、Windsurf、Claude Desktop 等 AI 编码助手时,常会粘贴含 AWS/OpenAI API Key、数据库连接串、JWT、私钥及客户 PII 的代码片段。传统云端 DLP 代理需将流量送往第三方检查,增加 200–500ms 延迟并带来数据托管风险。作者提出零信任数据脱敏(ZTDS),在数据序列化上网前于本地易失性内存中完成敏感信息清洗。

AI推荐理由 针对 Cursor、Claude Desktop 等 AI 编码助手泄露 API Key、数据库连接串、JWT 与 PII 的实际问题,提出本地内存内零信任脱敏(ZTDS)方案,并指出云端 DLP 代理会引入 200–500ms 延迟并形成第三方数据风险;属开发者可落地的安全实践,但为个人博客教程,缺少基准测试与开源实现验证。

70

正文

If you are using AI coding assistants like Cursor, Windsurf, Claude Desktop, or ChatGPT, you have probably pasted a snippet containing sensitive data at least once: Hardcoded AWS or OpenAI API keys Database connection strings (postgres://user:password@host/db) JWT tokens and private RSA keys Real customer emails, IP addresses, or internal employee IDs Traditional Data Loss Prevention (DLP) relies on remote cloud proxies that intercept your traffic, inspect it on a third-party server, and add 200ms–500ms of latency to every autocomplete or prompt. Here is how to solve this using Zero-Trust Data Sanitization (ZTDS)—sanitizing sensitive data 100% locally in volatile RAM before network serialization. The Problem: Cloud DLP Adds Latency and Creates Honeypots When you route AI traffic through intermediate cloud DLP proxies: Network Jitter: Remote webhook inspection halts your prompt loop. Sub-Processor Liabilities: Routing sensitive customer data to a third-party inspection vendor requires signing complex Data Processing Agreements (DPAs) under GDPR and HIPAA. Telemetry Honeypots: Prompt data stored in proxy logs becomes a centralized target for credential leaks. The Architecture: Client-Side Zero-Trust Data Sanitization (ZTDS) The core principle behind ZTDS is simple: Zero server infrastructure. Everything executes in client memory. ┌─────────────────────────────────────────────────────────────────────────────┐ │ DEVELOPER WORKSTATION (LOCAL RAM) │ │ │ │ ┌──────────────────────┐ Structured Stream ┌──────────────────────────┐ │ │ │ IDE / Browser Tab │ ──────────────────> │ In-Memory DFA Automata │ │ │ │ (Code / Prompt) │ │ (Regex Tokenizer) │ │ │ └──────────────────────┘ MCP, click Add New MCP Server: Name: privacyscrubber Type: command Command: npx -y @privacyscrubber/mcp-server Real-World Sanitization Example When you pass a raw configuration log: Host: api.internal.corp User: john.doe@enterprise.com Client IP: 192.168.1.104 AWS Key: AKIAIOSFODNN7EXAMPLE Secret: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY Enter fullscreen mode Exit fullscreen mode The ZTDS engine tokenizes it in < 1.5ms: Host: [URL_1] User: [EMAIL_1] Client IP: [IP_1] AWS Key: [API_KEY_1] Secret: [SECRET_KEY_1] Enter fullscreen mode Exit fullscreen mode The LLM processes the code structure without ever seeing your credentials, and the response rehydrates the original keys locally on your machine. Try the Browser Implementation If you want to test client-side sanitization in your browser (works 100% in Airplane Mode): Live Web App: https://privacyscrubber.com GitHub Repository (MCP Server): moxno/privacyscrubber-mcp Chrome Extension (Manifest V3): PrivacyScrubber on Chrome Web Store Academic Foundation (Zenodo / CERN): DOI 10.5281/zenodo.22058770 How do you handle sensitive data when prompting LLMs in your daily development workflow? Let me know in the comments below!

来源报道 · 1 篇 · 以下链接均前往原始媒体

← 返回精选动态 原文

更多内容