<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Sarvesh Sonkusre</title>
    <description>The latest articles on DEV Community by Sarvesh Sonkusre (@sarveshsonkusre).</description>
    <link>https://dev.to/sarveshsonkusre</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4020998%2F841243aa-d5c9-42b0-9ea0-0c76020f8b55.gif</url>
      <title>DEV Community: Sarvesh Sonkusre</title>
      <link>https://dev.to/sarveshsonkusre</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sarveshsonkusre"/>
    <language>en</language>
    <item>
      <title>Why AI Coding Agents Should Never See Your API Keys (and How I Solved It)</title>
      <dc:creator>Sarvesh Sonkusre</dc:creator>
      <pubDate>Wed, 08 Jul 2026 09:41:01 +0000</pubDate>
      <link>https://dev.to/sarveshsonkusre/why-ai-coding-agents-should-never-see-your-api-keys-and-how-i-solved-it-4hj4</link>
      <guid>https://dev.to/sarveshsonkusre/why-ai-coding-agents-should-never-see-your-api-keys-and-how-i-solved-it-4hj4</guid>
      <description>&lt;p&gt;AI coding assistants have fundamentally changed how we build software.&lt;/p&gt;

&lt;p&gt;Whether you're using Cursor, Claude Code, Windsurf, or another AI-powered IDE, these tools can read large portions of your project to provide better suggestions. That context often includes configuration files, source code, terminal output—and sometimes your secrets.&lt;/p&gt;

&lt;p&gt;That made me stop and ask a simple question:&lt;/p&gt;

&lt;p&gt;Why should an AI assistant ever need access to my API keys?&lt;/p&gt;

&lt;p&gt;The Problem&lt;/p&gt;

&lt;p&gt;Today, almost every application stores credentials like this:&lt;/p&gt;

&lt;p&gt;OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxx&lt;br&gt;
STRIPE_SECRET_KEY=sk_live_xxxxxxxxx&lt;br&gt;
DATABASE_URL=postgres://...&lt;/p&gt;

&lt;p&gt;These values are commonly loaded into:&lt;/p&gt;

&lt;p&gt;.env files&lt;br&gt;
process.env&lt;br&gt;
os.environ&lt;br&gt;
shell variables&lt;/p&gt;

&lt;p&gt;This approach works, but it also means that anything with access to your project or process environment can potentially access those credentials.&lt;/p&gt;

&lt;p&gt;For AI-assisted development, that introduces an unnecessary level of exposure. Even if you trust your tools, it's good security practice to minimize where secrets exist.&lt;/p&gt;

&lt;p&gt;I Started Thinking...&lt;/p&gt;

&lt;p&gt;What if applications never stored the real secret?&lt;/p&gt;

&lt;p&gt;What if they only saw a placeholder?&lt;/p&gt;

&lt;p&gt;Instead of:&lt;/p&gt;

&lt;p&gt;OPENAI_API_KEY=sk-xxxxxxxx&lt;/p&gt;

&lt;p&gt;What if your project contained:&lt;/p&gt;

&lt;p&gt;OPENAI_API_KEY=nv://OPENAI_API_KEY&lt;/p&gt;

&lt;p&gt;No plaintext API key.&lt;/p&gt;

&lt;p&gt;Nothing valuable to copy.&lt;/p&gt;

&lt;p&gt;Nothing meaningful for an AI assistant to read.&lt;/p&gt;

&lt;p&gt;The Idea&lt;/p&gt;

&lt;p&gt;That led me to build nv-protocol.&lt;/p&gt;

&lt;p&gt;Instead of injecting secrets into your application environment, nv-protocol stores encrypted credentials locally and replaces placeholders only when an authorized outbound request is made.&lt;/p&gt;

&lt;p&gt;The basic flow looks like this:&lt;/p&gt;

&lt;p&gt;Developer&lt;br&gt;
      │&lt;br&gt;
      ▼&lt;br&gt;
.env&lt;br&gt;
      │&lt;br&gt;
OPENAI_API_KEY=nv://OPENAI_API_KEY&lt;br&gt;
      │&lt;br&gt;
      ▼&lt;br&gt;
Application&lt;br&gt;
      │&lt;br&gt;
      ▼&lt;br&gt;
nv-protocol&lt;br&gt;
      │&lt;br&gt;
      ▼&lt;br&gt;
Secure Vault&lt;br&gt;
      │&lt;br&gt;
      ▼&lt;br&gt;
External API&lt;/p&gt;

&lt;p&gt;Your project never contains the actual secret.&lt;/p&gt;

&lt;p&gt;Your source code remains portable.&lt;/p&gt;

&lt;p&gt;Your AI assistant only sees placeholders.&lt;/p&gt;

&lt;p&gt;Why This Matters&lt;/p&gt;

&lt;p&gt;This isn't just about AI.&lt;/p&gt;

&lt;p&gt;It's about following a broader security principle:&lt;/p&gt;

&lt;p&gt;Only expose sensitive information where it's absolutely required.&lt;/p&gt;

&lt;p&gt;If a component doesn't need to know a secret, it shouldn't have access to it.&lt;/p&gt;

&lt;p&gt;That philosophy can reduce accidental leaks, simplify code sharing, and make AI-assisted development safer by default.&lt;/p&gt;

&lt;p&gt;Current Status&lt;/p&gt;

&lt;p&gt;nv-protocol is now available as an open-source project.&lt;/p&gt;

&lt;p&gt;✅ Available on npm&lt;/p&gt;

&lt;p&gt;npm install -g nv-protocol&lt;/p&gt;

&lt;p&gt;✅ Available on PyPI&lt;/p&gt;

&lt;p&gt;pip install nv-protocol&lt;/p&gt;

&lt;p&gt;Windows Package Manager support is also on the way.&lt;/p&gt;

&lt;p&gt;Looking for Feedback&lt;/p&gt;

&lt;p&gt;This is an early project, and I'd genuinely appreciate feedback from developers, security engineers, and anyone building AI-powered workflows.&lt;/p&gt;

&lt;p&gt;Does this approach solve a real problem?&lt;br&gt;
What integrations would make it more useful?&lt;br&gt;
Where do you see limitations or edge cases?&lt;/p&gt;

&lt;p&gt;You can explore the project here:&lt;/p&gt;

&lt;p&gt;GitHub: &lt;a href="https://github.com/SarveshSonkusre02/nv-protocol" rel="noopener noreferrer"&gt;https://github.com/SarveshSonkusre02/nv-protocol&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you find the idea interesting, consider giving it a ⭐, opening an issue, or contributing. I'd love to hear your thoughts and continue improving it with the community.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fh986p4tp23n5ttc52m08.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fh986p4tp23n5ttc52m08.png" alt=" " width="800" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>security</category>
      <category>ai</category>
      <category>llm</category>
    </item>
  </channel>
</rss>
