feat(config): app-scoped config & secrets, encrypted at rest#33
Open
tastyeffectco wants to merge 2 commits into
Open
feat(config): app-scoped config & secrets, encrypted at rest#33tastyeffectco wants to merge 2 commits into
tastyeffectco wants to merge 2 commits into
Conversation
Adds control-plane-owned config and secrets per app, so sensitive values
never live in Docker env, workspace files, or task logs.
- New app_config table (migration 0014), scoped to an app (and so to the
API tenant). Sensitive entries store AES-256-GCM ciphertext + a random
per-value nonce; non-sensitive entries may keep a plaintext value.
- Encryption uses standard-library crypto only. The master key comes
from SANDBOXD_SECRETS_KEY (base64, 32 bytes) or an auto-generated 0600
keyfile under the data dir.
- API: POST/GET/PATCH/DELETE /v1/apps/{id}/config. Sensitive values are
write-only — GET returns metadata only (key, sensitive, access_policy,
value_set, timestamps), never the plaintext. Non-sensitive config may
be returned in full.
- access_policy metadata (control_plane_only | agent_access |
runtime_access | both); default control_plane_only. Agent/runtime
delivery is the next slice (a scoped-token broker) — for now nothing is
injected, so secrets stay in the control plane.
- Plaintext is never logged; audit entries record only the key.
Secrets are deliberately NOT passed through `docker run -e`. The legacy
create-time env stays for backwards compatibility, but app_config is the
safer managed replacement.
Tests: encryption round-trip / fresh nonce / tamper-detection / 0600
keyfile; sensitive value encrypted at rest and never returned; redaction;
default policy; tenant/app scoping; sensitivity toggle re-encrypts.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…only Covers two acceptance checks: a PATCH that omits 'value' must not alter the stored secret bytes, and audit entries record the config key but never the plaintext value.
tastyeffectco
added a commit
that referenced
this pull request
Jun 23, 2026
tastyeffectco
added a commit
that referenced
this pull request
Jun 23, 2026
… changelog
Adds the four /v1/apps/{id}/config routes (and ConfigItem/CreateConfigRequest/
PatchConfigRequest schemas) to docs/openapi.yaml so the console<->sandboxd
contract test stays green after merging #33. Bumps the spec to 0.3.0 and adds
an Unreleased changelog entry for the v0.3.0 integration.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds control-plane-owned config and secrets per app, so sensitive values never live in Docker env, workspace files, or task logs.
What
app_configtable (migration0014), scoped to an app (and therefore to the API tenant). Sensitive entries are stored as AES-256-GCM ciphertext + a random per-value nonce; non-sensitive entries may keep a plaintext value.SANDBOXD_SECRETS_KEY(base64, 32 bytes) or an auto-generated0600keyfile under the data dir.POST/GET/PATCH/DELETE/v1/apps/{id}/config. Sensitive values are write-only —GETreturns metadata only (key,sensitive,access_policy,value_set, timestamps), never the plaintext. Non-sensitive config may be returned in full.access_policymetadata:control_plane_only(default) ·agent_access·runtime_access·both. Actually delivering values to the agent/runtime is a follow-up (a scoped-token broker) — for now nothing is injected, so secrets stay entirely in the control plane.Secrets are deliberately not passed through
docker run -e. The legacy create-timeenvstays for backwards compatibility, butapp_configis the safer managed replacement.Tests
Encryption round-trip / fresh nonce / tamper-detection /
0600keyfile; sensitive value encrypted at rest and never returned; redaction; default policy; tenant/app scoping (another tenant can't read or write); sensitivity-toggle re-encrypts.go build/go vet/gofmt/go test ./...all clean.Note
The
/v1/apps/{id}/configendpoints should be added todocs/openapi.yaml(that file lives on the console branch); the route↔spec contract test will flag it when the two land together.