Skip to content

fix(agent-sdk): prevent generateKeys from overwriting .env - #3999

Open
sashaphmn wants to merge 1 commit into
xmtp:mainfrom
sashaphmn:fix/generate-keys-overwrite-protection-libxmtp
Open

fix(agent-sdk): prevent generateKeys from overwriting .env#3999
sashaphmn wants to merge 1 commit into
xmtp:mainfrom
sashaphmn:fix/generate-keys-overwrite-protection-libxmtp

Conversation

@sashaphmn

@sashaphmn sashaphmn commented Aug 14, 2026

Copy link
Copy Markdown

Prevent generateKeys from accidentally overwriting an existing .env file. It now refuses to overwrite it by default and only does so with an explicit --force, with a warning shown first.

Note

Prevent generateKeys from overwriting an existing .env file without --force

The script now uses wx (create-only) file semantics and exits with code 1 if a .env file already exists. Passing --force switches to w mode, overwrites the file, and prints a warning. The INIT_CWD presence check is also moved before key generation so no keys are produced if the environment is invalid.

Macroscope summarized a8d2684.

@sashaphmn
sashaphmn requested a review from a team as a code owner August 14, 2026 06:01
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