Skip to content

Add customer-protected secrets and vault unwrap - #138

Merged
AHarmlessPyro merged 6 commits into
mainfrom
cursor/customer-protected-secrets-64ea
Nov 9, 2026
Merged

AHarmlessPyro merged 6 commits into
mainfrom
cursor/customer-protected-secrets-64ea

Conversation

@AHarmlessPyro

@AHarmlessPyro AHarmlessPyro commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds SDK support for customer-protected secrets (browserctrl#1539). The SDK wraps each secret version locally with the customer's own key and unwraps it locally when it's used. It also adds the new wrapped-vault operations and the updated session vault shape.

Changes

  • createCustomerKey() and CustomerKey:
    • RSA-OAEP-256, ECDH-ES and ECDH-ES+A256KW with A256GCM, for RSA ≥ 2048, EC P-256/384/521 and X25519/X448 keys.
    • The kid is the RFC 7638 thumbprint by default.
    • Keys can come from a KeyObject, PEM/DER or JWK. A custom KMS key can implement the interface.
  • secrets.create({ customerKey | protection }) and addVersion(…, { customerKey }) upload { envelope, innerDigest, innerKid }.
  • New secret methods:
    • secrets.getWrappedVersion and secrets.unwrap, which returns a pinned { name, version, unwrapped } reference.
    • secrets.rewrap({ from, to }), which can be resumed if interrupted, and replaceVersionWrapping.
  • New vault methods: vaults.getWrapped and vaults.unwrap, which returns a vault reference for sandboxes and processes.
  • Unwrapped references are accepted by:
    • sandbox and process secrets
    • vault
    • onePassword.token
    • the 1Password fill token
  • Secret.protection and the version fields outerKid and retiresAt.
  • session.vaults: sessions now attach vaults by reference.
  • README section, error codes, and version 1.5.0.
  • Shared interop fixture tests/fixtures/customer_key_interop.json, with the same keys and envelopes as the Python SDK.

Validation

  • yarn lint
  • yarn typecheck
  • yarn build
  • yarn test: 883 passed.
  • Manual cross-checks:
    • Envelopes wrapped by Node unwrap in Python and the reverse.
    • The kids match the Python SDK's.
    • The server's envelope validator accepts the envelopes.
Open in Web Open in Cursor 

Note

High Risk
Introduces customer-managed cryptographic wrapping and changes how secrets, vaults, and credentials are serialized and used across sandboxes and sessions—core secrets infrastructure with elevated misuse or validation risk.

Reviewed by Cursor Bugbot for commit bd9fb54. Bugbot is set up for automated code reviews on this repo. Configure here.

cursoragent and others added 5 commits November 9, 2026 19:38
Co-authored-by: Ninad Sinha <AHarmlessPyro@users.noreply.github.com>
Co-authored-by: Ninad Sinha <AHarmlessPyro@users.noreply.github.com>
Co-authored-by: Ninad Sinha <AHarmlessPyro@users.noreply.github.com>
Co-authored-by: Ninad Sinha <AHarmlessPyro@users.noreply.github.com>
Co-authored-by: Ninad Sinha <AHarmlessPyro@users.noreply.github.com>
@AHarmlessPyro

AHarmlessPyro commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Co-authored-by: Ninad Sinha <AHarmlessPyro@users.noreply.github.com>
@AHarmlessPyro
AHarmlessPyro added this pull request to the merge queue Nov 9, 2026
Merged via the queue into main with commit 932291c Nov 9, 2026
3 checks passed
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.

3 participants