Local Secret Store for Sensitive Credentials
What variant of Codex are you using?
App
What feature would you like to see?
I would like Codex to provide a local secret management feature for sensitive information such as server usernames, passwords, API keys, SSH credentials, database passwords, and deployment tokens.
In many real-world workflows, Codex may need to execute commands that require credentials. However, users may not want those credentials to be included in prompts or sent to the model server. It would be much safer if Codex allowed users to configure secrets locally and reference them by name.
For example, a user could define local secrets such as:
prod-server-username
prod-server-password
staging-db-password
github-deploy-token
Then, when Codex needs to run a command, the model would only see a reference such as:
${secrets.PROD_SERVER_PASSWORD}
The actual secret value would only be resolved locally by the Codex runtime at execution time. The plaintext value should never be included in the prompt, model context, logs, or tool-call descriptions sent to the remote model.
Suggested capabilities:
A local secret store for creating, updating, deleting, and listing secret aliases.
Secret references that can be used in commands, MCP tool calls, scripts, or environment variables.
Runtime-only resolution, where secrets are injected locally during execution.
Confirmation prompts before a secret is used, especially the first time or for high-risk operations.
Project-scoped, workspace-scoped, global, and session-only secrets.
Audit logs that record which secret alias was used, without recording the actual value.
Redaction of secret values from terminal output, logs, conversation history, and debugging traces.
Support for injecting secrets as environment variables, temporary files, stdin, or command arguments when appropriate.
A clear security boundary where the model can request a secret by alias, but cannot read or print the secret value directly.
The goal is to make Codex safer for real engineering, operations, deployment, database, and infrastructure workflows. Users should be able to let Codex perform authenticated local actions without exposing sensitive credentials to the model server.
This would be similar in spirit to how CI systems manage secrets: the workflow can reference a secret by name, but the secret value is only resolved inside the trusted execution environment.
Short Version
Please consider adding a local secret management feature to Codex. Users could store sensitive credentials locally and reference them by alias. Codex would resolve those secrets only at local execution time, while the model would see only placeholder references and never receive the plaintext secret values. This would make Codex much safer for tasks involving servers, databases, deployments, private APIs, and infrastructure automation.
Additional information
_No response_
3 Comments
Windows reproduction showing why this needs a broker rather than broader plaintext access:
This is a concrete fit for the proposed local secret store. Useful acceptance criteria from this case:
No credential, endpoint, account, tenant, or repository identifier is included in this report.
Concrete user impact and acceptance criteria from Codex 0.147.0:
The current manual documents OS keyring storage for Codex login and MCP OAuth credentials, environment-variable forwarding, and command-backed model-provider authentication. Those are useful but do not provide a generic protected secret ingress for an arbitrary local tool or third-party website.
Minimal secret-free reproduction:
TEST_LOGIN_PASSWORD, without storing any value in the prompt or repository.In our deployment, this forces use of a custom Google Secret Manager/MCP bridge. The consequence is not just setup inconvenience: it adds secret-manager cost, IAM/network configuration, plugin/runtime maintenance, and another availability dependency. When that integration is missing from an active session, long-running work stops for repeated human login handoffs and short-lived login windows expire.
Important scope clarification: our rule that treats credentials pasted into a conversation as compromised input is a local Multi Server Sync policy, not a behavior I am attributing to OpenAI Codex. The requested capability is valuable regardless: it gives users a supported alternative that keeps plaintext outside model context.
Suggested acceptance test:
Related narrower reports: #32081 for browser/password-manager autofill and #37695 for runtime capability preflight. This issue remains the best umbrella for the generic local secret-ingress primitive.
Quantified follow-up on the operational cost of the current workaround (sanitized; no project, account, billing, secret-name, or secret-value identifiers):
Our local integration uses Google Secret Manager as an external broker because Codex does not currently provide a generic protected one-time secret-ingress surface or an opaque, runtime-resolved secret handle for arbitrary approved tools and browser actions.
A read-only inventory across two projects found:
EnabledandDisabledversions.(870 - 6) × $0.06 ≈ $51.84/monthis the estimated storage base before access-operation charges.AccessSecretVersionentries for the inspected period. This is not evidence that actual access was zero, because Secret Manager Data Access logging may not have been enabled or retained.Google's official pricing page confirms that pricing is based on active secret versions and access operations, that both
EnabledandDisabledversions are active/billable, and that destroyed versions are free: https://cloud.google.com/secret-manager/pricingThis is not a claim that ChatGPT or Codex directly imposed the Google charge. OpenAI's official authentication documentation describes Codex access through either ChatGPT subscription sign-in or API-key usage-based access: https://learn.chatgpt.com/docs/auth. The cost above is an external integration cost created by the combination of our local secret-broker design and the absence of a generic Codex secret-ingress/opaque-handle primitive.
The measured impact strengthens the request in this issue. A useful native design would let a user:
Even when an external vault remains appropriate for machine credentials, a native protected ingress and opaque-handle contract would reduce credential sprawl, repeated human handoffs, duplicated versions, and vendor-specific broker maintenance while preserving the boundary that plaintext must not reach the model.