An Electron app that uses safeStorage on macOS shows a keychain prompt on every launch when its code signature keeps changing. Ours changed with every build, because Mosaic was ad-hoc signed at the time. So "Mosaic wants to use your confidential information" came back after every update, and on a locked screen the app hung before it had a window. On 25 October 2026 we took the app's own secrets out of the keychain.
What safeStorage was holding
Mosaic seals its store, proxy credentials and per-profile cookie keys under one data key. That key itself has to be wrapped by something. The first answer was Electron's safeStorage, which on macOS keeps its key in the login keychain. It looked ideal. There was no password to type, and a copy of the data folder was useless on another Mac, because the other Mac's keychain did not have the key.
Saved logins and their two-factor secrets went through safeStorage the same way, one value at a time.
Why safeStorage showed a keychain prompt on every launch
The keychain gives an item away silently only to the code identity it already trusts. With a stable signing certificate, that identity survives an update. Mosaic was ad-hoc signed, and an ad-hoc signature is a hash of the app's contents. Every rebuild and every update was therefore an identity the keychain had never seen, and it asked again.
This is the same mechanism behind the Chromium keychain prompt our browser launches had. There, two command-line flags kept the engine away from the keychain. The app itself had no such flag. It called the keychain on purpose.
Your profiles, cookies and proxies stay on your computerIn Mosaic: Local first. Profiles, cookies and proxies stay on your computer. Free covers 3 profiles with no card, and Pro is $25 a month for any number of them.
Mosaic is a desktop app
Email yourself the link and open it on your computer.
The hang nobody could see
The prompt was annoying. The hang was worse, and we diagnosed it on a live machine with the screen locked. The production app had a GPU helper running, no renderer, and a DevTools port that accepted connections and answered nothing.
safeStorage's decrypt call is synchronous, so the main thread was blocked inside it, waiting for an authorisation prompt. A locked screen cannot show the prompt, and a blocked main thread cannot draw anything. Mosaic sat there with no window until someone killed it.
A control that blocks startup is not transparent, however little it asks of you on a good day.
The tempting fix we did not use
Deriving the key from the Mac's hardware id would have kept a copied folder useless elsewhere, with no prompt at all. We turned it down because of how it fails. Replace a logic board and the hardware id changes, the key changes with it, and every profile is silently unreadable. A security control whose failure mode is losing profiles does not get switched on.
Where the key went
From 25 October the data key sat in vault.json, a file only your user can read, beside the data. Saved logins and 2FA secrets are now sealed under that same data key instead of safeStorage. A value written by an older build is unwrapped once and sealed again the next time that login is saved.
Two attacks we had measured stayed fixed: the store being readable by other users, and cookies sitting under Chromium's public mock-keychain password (that measurement is the reason the vault exists). What the file mode gave up was the copied-folder property, and app lock in Settings › Security covered it for anyone who wanted it: a password, stretched with scrypt, that nothing decrypts without.
Since 2 November 2026 there is a stronger default. The data key is wrapped under your Mosaic account, from a secret the account server gives only to a signed-in session on a computer it has bound. A copied folder does not open for a different account, or with nobody signed in. App lock still adds a password on top. None of it touches the keychain.
Getting old installs off it
Moving an existing install off the keychain needs one last keychain read, and it took four attempts to stop that read from causing the hang it was meant to remove.
- Running it at startup, before the window, hung exactly as before.
- Showing the window first and then reading still blocked the main thread a moment later. The window never came to the front and the prompt never appeared.
- A Continue button made it a user action, and clicking it beachballed for the same reason: the call was still synchronous on the main thread.
- Reading the key in a child process, through
/usr/bin/security, kept the app responsive while the prompt waited.
Even that prompt did not surface reliably from inside the app. The shipping answer is that the app never reads the keychain to open its store. The one read left is a single saved login written by an older build, unwrapped once and resealed under the data key. An install from before the change is told so on its lock screen and is migrated once by a script run from Terminal, where the prompt does appear. It proves the recovered key opens the store before it writes anything.
If you ship an Electron app with safeStorage, the lesson that transfers is narrow: never make a synchronous keychain call on the main thread before a window is showing, and with an unstable signature expect the prompt after every update. What Mosaic keeps on your computer, and what never leaves it, is set out under local-first; how saved logins are filled is on logins and 2FA.
Sources
- Electron documentation: safeStorage, read November 2, 2026






