Context-Isolated Secret Management for Autonomous AI Software Engineering Agents
Project description
๐ nv-protocol (nvenv)
nvenv is a local-first cryptographic proxy designed to decouple raw credentials from the viewable workspace of autonomous AI software engineering agents such as Cursor, Claude Code, Windsurf, and Devin.
Instead of exposing secrets through traditional .env files or shell environment variables, nvenv replaces them with secure cryptographic URI placeholders (nv://KEY_NAME). During outbound network communication, the proxy transparently substitutes placeholders with the real credentials only in volatile memory, immediately before the TLS request leaves the machine.
Applications continue to work normally while autonomous AI agents remain unable to access plaintext credentials.
โก Quick Start
Install Globally (Recommended)
Node.js
npm install -g nv-protocol
Python
pip install nv-protocol
Windows Package Manager (Coming Soon)
winget install SarveshSonkusre.nv-protocol
Verify installation:
nvenv --help
๐ฆ Installation Options
Global Installation
Recommended if you want the nvenv command available everywhere.
npm
npm install -g nv-protocol
PyPI
pip install nv-protocol
Local Project Installation (Node.js)
Install only inside the current project.
npm install nv-protocol
Run using:
npx nvenv --help
or from your package scripts.
Install From Source
git clone https://github.com/SarveshSonkusre02/nv-protocol.git
cd nv-protocol
pip install -e .
โ Verify Installation
Display the CLI help.
nvenv --help
Expected output:
nvenv (No-View Env) - Context-Isolated Secret Management CLI
Verify installed package.
npm
npm list -g nv-protocol
PyPI
pip show nv-protocol
โ Why nvenv?
Traditional secret management exposes credentials directly inside:
.envprocess.envos.environ- shell exports
This means secrets become visible to:
- AI coding agents
- Third-party dependencies
- Build systems
- Prompt injection attacks
- Memory scraping tools
nvenv shifts credential injection from the application layer to the network layer, ensuring applications authenticate normally while secrets never become part of the AI-visible execution context.
๐ Security Comparison
| Security Vector | Legacy .env / Shell Export |
nvenv |
|---|---|---|
| Process Environment | โ Plaintext credentials | โ Placeholder only |
| Prompt Injection | โ Secrets can be printed | โ AI never receives secrets |
| Dependency Scraping | โ Packages can read env vars | โ No credentials available |
| Authentication Scope | โ Shared with every process | โ Injected only into authorized outbound requests |
| Secret Lifetime | โ Entire process lifetime | โ Exists only during request execution |
๐ Architecture
Developer
โ
โผ
Application
Reads
OPENAI_API_KEY=nv://OPENAI_API_KEY
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
nvenv Proxy
โข Validate destination
โข Retrieve encrypted secret
โข Decrypt in volatile memory
โข Replace placeholder
โข Forward TLS request
โ
โผ
External API
Authorization:
Bearer sk-xxxxxxxxxxxxxxxx
๐ Quick Start
Initialize the Vault
nvenv init
Store a Secret
nvenv set OPENAI_API_KEY
Replace Your .env
Instead of:
OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxx
Use:
OPENAI_API_KEY=nv://OPENAI_API_KEY
Run Your Application
Node.js
nvenv run -- npm run dev
Python
nvenv run -- python app.py
List Stored Secrets
nvenv list
โ๏ธ How It Works
Application
Authorization:
Bearer nv://OPENAI_API_KEY
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ nvenv Proxy โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โข Intercepts request โ
โ โข Reads encrypted vault โ
โ โข Decrypts in RAM โ
โ โข Replaces placeholder โ
โ โข Sends HTTPS request โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
api.openai.com
Authorization:
Bearer sk-xxxxxxxxxxxxxxxx
๐ก Core Security Features
Context Isolation
Your:
- source code
.env- terminal
- logs
- shell variables
contain only placeholders.
OPENAI_API_KEY=nv://OPENAI_API_KEY
Secrets never become visible inside an AI context window.
Hardware-Backed Vault
Windows stores credentials inside:
~/.nv/vault.db
using:
- SQLite
- Windows DPAPI encryption
Secrets are cryptographically bound to the current Windows user account.
Memory-Only Secret Injection
Credentials are:
- decrypted only when needed
- never stored inside environment variables
- never written to disk
- wiped immediately after request completion
HTTPS Proxy Injection
The runtime launches a local HTTPS interception proxy which:
- validates destinations
- decrypts secrets
- replaces placeholders
- forwards encrypted traffic
Applications remain unaware that substitution occurred.
AI Agent Protection
Commands such as
nvenv get OPENAI_API_KEY
cannot be abused through:
- redirected output
- pipes
- automated execution
- non-interactive sessions
The CLI verifies that a real interactive user is present before revealing secrets.
Git Credential Helper
Store your GitHub Personal Access Token.
nvenv set GITHUB_TOKEN
Configure Git.
git config --local credential.helper "!nvenv git-helper"
Git retrieves credentials directly from the encrypted vault without exposing tokens through:
- environment variables
- shell history
- repository files
.gitconfig
๐ป Platform Support
| Platform | Status |
|---|---|
| Windows | โ Stable |
| Linux | ๐ง In Progress |
| macOS | ๐ง In Progress |
| npm | โ Available |
| PyPI | โ Available |
| WinGet | โณ Pending |
๐งช Verification
Run the built-in tests.
python test_nv.py
Coverage includes:
- โ Vault CRUD
- โ Windows DPAPI encryption
- โ Placeholder substitution
- โ HTTPS interception
- โ Runtime injection
- โ End-to-end verification
๐ Example Workflow
Developer
โ
โผ
nvenv set OPENAI_API_KEY
โ
โผ
Encrypted Vault
โ
โผ
.env
OPENAI_API_KEY=nv://OPENAI_API_KEY
โ
โผ
nvenv run -- npm run dev
โ
โผ
Application
โ
โผ
nvenv Proxy
โ
โผ
Placeholder Replacement
โ
โผ
OpenAI API
๐ฏ Philosophy
Traditional secret managers primarily protect credentials at rest.
nvenv focuses on protecting credentials during execution, preventing autonomous AI systems, third-party packages, and prompt injection attacks from ever accessing plaintext secrets while preserving the existing application workflow.
๐บ Roadmap
- โ npm Distribution
- โ PyPI Distribution
- โณ WinGet Distribution
- โณ Homebrew Formula
- โณ Native Linux Secret Backend
- โณ Native macOS Keychain Backend
- โณ Docker Integration
- โณ VS Code Extension
๐ Notes
Global npm installation
npm install -g nv-protocol
Installs the nvenv command globally.
Local npm installation
npm install nv-protocol
Installs the package only inside the current project.
Use:
npx nvenv
or reference it from your project's scripts.
Python installation
pip install nv-protocol
Installs the nvenv command globally into the active Python environment.
๐ License
Released under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nv_protocol-2.0.4.tar.gz.
File metadata
- Download URL: nv_protocol-2.0.4.tar.gz
- Upload date:
- Size: 25.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6cfeefb057591120c2741a89993d1401a8fb430080fae835313152a1faf46374
|
|
| MD5 |
1b7e4944cc07615fc1d1e4dd8227b6ea
|
|
| BLAKE2b-256 |
3adc2924ce4bcc6ac6a715b384e56b357769ef6a041bb79dc0493a3462b18303
|
File details
Details for the file nv_protocol-2.0.4-py3-none-any.whl.
File metadata
- Download URL: nv_protocol-2.0.4-py3-none-any.whl
- Upload date:
- Size: 28.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dce5beadc6417c07dfbf89dc031b09504f9c5b91d4955afc33b9a5f9640463cf
|
|
| MD5 |
171221979c5e83b0d86bdd97d6706310
|
|
| BLAKE2b-256 |
9e9cf07a4b9577d8079426c68ce6f020ec5df89fc1a5baac5c0af8535fd72816
|