Skip to content

feat(encryption): always encrypt uploads; ignore --no-encrypt and DCD_ENCRYPT=0 - #363

Merged
riglar merged 1 commit into
devfrom
feat/always-encrypt
Nov 27, 2026
Merged

riglar merged 1 commit into
devfrom
feat/always-encrypt

Conversation

@riglar

@riglar riglar commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

What

Client-side envelope encryption is no longer optional. The app binary, flow zip and env vars are always encrypted on the user's machine before upload.

  • --no-encrypt, DCD_ENCRYPT=0 and the legacy DCD_ENCRYPT_BINARIES=0 are ignored with a warning, not refused. Scripts and CI configs that still pass them keep working:
    Ignoring --no-encrypt: uploads are always encrypted.
    
  • --encrypt stays as a no-op, for the same reason. Its --help text now says it is no longer needed.
  • The MCP tool dcd_run_cloud_test no longer takes an encrypt input. DCD_ENCRYPT is removed from server.json.
  • The CLI no longer reads encryption.defaultOn from the compatibility data. dcd upload and the dcd device app and flow uploads no longer fetch that data at all.

What still turns it off

Only the API. If the API publishes no KEK public key on GET /cli-config, uploads go up in plaintext with a notice, as before. DCD_BINARY_KEK_PUBLIC still overrides that.

An API that cannot be asked for its KEK still fails the upload, rather than falling back to plaintext. This now applies to dcd upload and dcd device as well. Before, a failed compatibility fetch there meant "encryption off".

Telemetry

The encrypt.source field on command events is now always, no_kek (encryption skipped because the API publishes no KEK) or off (the command never reached an upload). The old values flag, env and server are gone.

Tests

  • pnpm lint, pnpm typecheck, pnpm build clean.
  • pnpm test:unit: 741 passing. The encryption-decision, dcd upload and help tests are rewritten for the new rules. Tests that upload a flow bundle now stub /cli-config, since every upload asks for the KEK.

🤖 Generated with Claude Code

…_ENCRYPT=0

The app binary, flow zip and env vars are now always encrypted before
upload. There is no client-side opt-out any more:

- --no-encrypt and DCD_ENCRYPT=0 (and the legacy DCD_ENCRYPT_BINARIES=0)
  are ignored with a one-line warning, so scripts that pass them still run.
- --encrypt is kept as a no-op.
- The MCP tool dcd_run_cloud_test no longer takes an `encrypt` input, and
  DCD_ENCRYPT is gone from server.json.
- The CLI no longer reads encryption.defaultOn from the compatibility data.

An API that publishes no KEK public key still gets plaintext uploads with
a notice, so the server keeps one way to turn encryption off. An API that
cannot be asked for its KEK fails the upload, as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@claude

claude Bot commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@riglar
riglar merged commit a2c4f76 into dev Nov 27, 2026
9 checks passed
@riglar
riglar deleted the feat/always-encrypt branch November 27, 2026 10:44
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