feat(sessions): optional AES-256-GCM encryption for saved sessions#533
Open
JessicaMulein wants to merge 2 commits into
Open
feat(sessions): optional AES-256-GCM encryption for saved sessions#533JessicaMulein wants to merge 2 commits into
JessicaMulein wants to merge 2 commits into
Conversation
Add --session-encrypt with CECLI_SESSION_KEY or --session-key-file, wire encrypt/decrypt through SessionManager save/load/list, and document usage. Plaintext JSON remains the default when encryption is off. Co-authored-by: Cursor <cursoragent@cursor.com>
This was referenced May 27, 2026
Closed
Apply isort/black formatting on session encryption files. Give legacy test_sessions mocks explicit args (session_encrypt off, model fields) so save/load work with SessionManager encryption and Model restore paths. Co-authored-by: Cursor <cursoragent@cursor.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.
Summary
cecli/session_crypto.py(AES-256-GCM, magic headerCECLI_ENCRYPTED_SESSION_v1)--session-encrypt/--no-session-encryptand--session-key-fileon the CLISessionManagerencrypts on save and decrypts on load/list when enabled; plaintext JSON unchanged when offCECLI_SESSION_KEY(urlsafe base64, 32 bytes) or key filecryptography>=42in requirementstests/basic/test_session_{crypto,args,sessions_manager}.pyBrightVision
Parent repo PR will pin this commit and add Vision API + Tauri keychain wiring.
Test plan
python -m pytest tests/basic/test_session_crypto.py tests/basic/test_session_args.py tests/basic/test_sessions_manager.py -qPR Summary by Typo
Overview
This PR introduces optional AES-256-GCM encryption for saved sessions, enhancing data security for sensitive information stored on disk. It allows users to encrypt session files using a provided key, with backward compatibility for unencrypted sessions.
Key Changes
--session-encryptand--session-key-filecommand-line arguments to enable and configure session encryption.cecli/session_crypto.pycontaining AES-256-GCM encryption and decryption logic.cecli/sessions.pyto handle encrypted and unencrypted session files during saving, loading, and listing.cryptographyas a new dependency for encryption functionality.Work Breakdown
To turn off PR summary, please visit Notification settings.
Summary by CodeRabbit
Release Notes
New Features
--session-encryptCLI flag to enable session encryption--session-key-fileCLI option to specify a file containing the encryption keyDocumentation