Skip to content

Add secretEnv config for secure custom environment variable injection#182

Open
GrimmiMeloni wants to merge 3 commits intobbrowning:mainfrom
GrimmiMeloni:feature/secret-env-config
Open

Add secretEnv config for secure custom environment variable injection#182
GrimmiMeloni wants to merge 3 commits intobbrowning:mainfrom
GrimmiMeloni:feature/secret-env-config

Conversation

@GrimmiMeloni
Copy link
Copy Markdown
Contributor

Summary

  • Add secretEnv configuration option (in paude.json or devcontainer.json) to securely inject host environment variables into container sessions without exposing them in container specs or process listings
  • Support name mapping (CONTAINER_NAME: HOST_NAME) so host and container variable names can differ
  • Works across both Podman and OpenShift backends, with mapping persisted in labels/annotations to survive reconnects and upgrades

🤖 Generated with Claude Code

GrimmiMeloni and others added 3 commits March 30, 2026 19:35
Allow users to declare custom secret environment variable names in
project config (paude.json or devcontainer.json). Values are read from
the host's os.environ and injected securely via exec -e (Podman) or
tmpfs (OpenShift), never appearing in the container spec.

Config format:
- paude.json: top-level "secretEnv": ["MY_TOKEN"]
- devcontainer.json: "customizations.paude.secretEnv": ["MY_TOKEN"]

Secret env var names are persisted as container labels (Podman) or
StatefulSet annotations (OpenShift) so they survive across
connect/start/upgrade operations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
secretEnv now accepts both formats:
- list: ["FOO"] → same name on host and container
- dict: {"CONTAINER_NAME": "HOST_NAME"} → rename on injection

This enables injecting host env vars under different names inside
the container, e.g. mapping a read-only token to the name an MCP
server expects:

  "secretEnv": {"JIRA_API_TOKEN": "JIRA_TOKEN_READONLY"}

Serialization in labels/annotations uses compact format:
  FOO,CONTAINER_NAME=HOST_NAME

Also adds validation that names cannot contain commas or equals
signs (used as serialization separators).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove list format support (never published) to align with
devcontainer conventions. Add documentation to CONFIGURATION.md,
SECURITY.md, and OPENSHIFT.md.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@bbrowning
Copy link
Copy Markdown
Owner

Hmm - I'm in the process of removing all secrets entirely from the main paude container and instead encoding them into https://github.com/bbrowning/paude-proxy (credential injecting proxy, so the untrusted agent container never sees any real secret anywhere). I don't yet know how long it will take to replace squid with the new paude-proxy, so will need to think on this.

@bbrowning
Copy link
Copy Markdown
Owner

I like the spirit of this, and as the secrets move from the main paude container to the paude-proxy container I think there will still be a use/place for this once that lands. The secrets still have to get injected - they'll just never be visible to the container running the coding agent anymore and instead injected by the proxy in front of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants