Skip to content

feat(config): app-scoped config & secrets, encrypted at rest#33

Open
tastyeffectco wants to merge 2 commits into
mainfrom
feat/app-config
Open

feat(config): app-scoped config & secrets, encrypted at rest#33
tastyeffectco wants to merge 2 commits into
mainfrom
feat/app-config

Conversation

@tastyeffectco

Copy link
Copy Markdown
Owner

Adds control-plane-owned config and secrets per app, so sensitive values never live in Docker env, workspace files, or task logs.

What

  • app_config table (migration 0014), 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.
  • Standard-library crypto only. Master key 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-onlyGET 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 (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.
  • 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 (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}/config endpoints should be added to docs/openapi.yaml (that file lives on the console branch); the route↔spec contract test will flag it when the two land together.

tastyeffectco and others added 2 commits June 23, 2026 07:57
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
… 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>
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.

1 participant