Credential Protection for AI Agents: The Phantom Token Pattern
嗯,用户让我用中文总结一篇文章,控制在100字以内,而且不需要特定的开头。我先看看文章内容。作者Luke介绍了他创建的Sigstore,现在在开发nono,一个开源的AI编码代理沙盒。主要问题是在给代理API密钥时,容易被注入攻击窃取。他们设计了“幻影令牌模式”,通过代理来隐藏真实凭证,确保即使代理被攻破,也没有东西可偷。 我需要把重点放在他们的问题、解决方案和关键点上。比如,环境变量注入、代理机制、真实凭证存储位置、内存处理和DNS安全。还要提到支持的SDK和博客链接。 总结的时候要简洁明了,不超过100字。直接描述内容,不需要“这篇文章”这样的开头。确保涵盖主要技术点和目标。 </think> Luke介绍了一种名为"phantom token pattern"的安全模式,用于防止AI编码代理窃取API密钥。该方案通过代理隐藏真实凭证,仅向代理提供一次性令牌,并在传输中替换为真实密钥。真实凭证存储于系统密钥库,内存零化处理,并通过TLS加密传输,防止DNS重绑定攻击。该方案支持OpenAI等SDK,并提供透明集成方式。 2026-3-5 16:57:4 Author: www.reddit.com(查看原文) 阅读量:2 收藏

Hey HN. I'm Luke, security engineer and creator of Sigstore (software supply chain security for npm, pypi, brew, maven and others). I've been building nono, an open source sandbox for AI coding agents that uses kernel-level enforcement (Landlock/Seatbelt) to restrict what agents can do on your machine.

One thing that's been bugging me: we give agents our API keys as environment variables, and a single prompt injection can exfiltrate them via env, `/proc/PID/environ`, with just an outbound HTTP call. The blast radius is the full scope of that key.

So we built what we're calling the "phantom token pattern" — a credential injection proxy that sits outside the sandbox. The agent never sees real credentials. It gets a per-session token that only works only with the session bound localhost proxy. The proxy validates the token (constant-time), strips it, injects the real credential, and forwards upstream over TLS. If the agent is fully compromised, there's nothing worth stealing.

Real credentials live in the system keystore (macOS Keychain / Linux Secret Service), memory is zeroized on drop, and DNS resolution is pinned to prevent rebinding attacks. It works transparently with OpenAI, Anthropic, and Gemini SDKs — they just follow the `*_BASE_URL` env vars to the proxy.

Blog post walks through the architecture, the token swap flow, and how to set it up. Would love feedback from anyone thinking about agent credential security.

https://nono.sh/blog/blog-credential-injection

We also have other features we have shipped, such as atomic rollbacks, Sigstore based SKILL attestation.

https://github.com/always-further/nono


文章来源: https://www.reddit.com/r/netsec/comments/1rlmu07/credential_protection_for_ai_agents_the_phantom/
如有侵权请联系:admin#unsafe.sh