The two modes
elding run
Injects secrets as environment variables in
process.env. It works like an improved
dotenv, but the key is in your application’s memory.elding proxy
Your application uses placeholders and the proxy injects the real key into the outgoing
request. The key never enters your application’s memory.
Comparison
elding run | elding proxy | |
|---|---|---|
| Secret types | All secrets: API keys, databases, configuration | HTTP API keys only |
| Languages | All languages, including Python, Go, and Ruby | Anything that sends HTTP requests |
| Key in application memory | Yes | No |
| Protects against AI or compromised dependencies | No | Yes |
| Simplicity | Maximum | One SDK call: configure() |
| Use cases | Databases, configuration, scripts, CI, other languages | AI-assisted development and HTTP API keys |
The proxy only intercepts outgoing HTTP traffic. It protects HTTP API keys such as
OpenAI and Stripe. A database connection using
DATABASE_URL uses TCP and is outside the
proxy’s reach, so use run or secret() instead.Which mode should you use?
- Use
runfor one-off jobs such as migrations or CI builds where simplicity matters most. - Use
proxyfor everyday AI-assisted development, or in production when the key must remain outside application memory.
Organizations can disable
run mode with allowEnvMode to enforce a zero-.env proxy
workflow.Production
The proxy must run as a process next to your application. This works in a container, VM, or Kubernetes, but not in serverless environments such as Vercel or Lambda, where a long-running companion process is unavailable.| Deployment | Proxy supported? | Behavior |
|---|---|---|
| Container / VM / Kubernetes | Yes | The proxy keeps the key outside the application. |
| Serverless (Vercel, Lambda) | No | The SDK switches to client mode and loads the key into memory. |
Production does not normally include an AI coding agent in the execution path. The proxy’s
primary threat model—an AI agent seeing development keys—is therefore a development concern.
Client mode is appropriate for serverless production while still removing
.env files and
providing centralized rotation, revocation, and audit logs.configure(), you do not need to change your code. The SDK uses
the proxy when available and automatically switches to client mode otherwise. The same code
works in development and production.