Copying an API key is convenient, but a clipboard manager may retain what you copied after you paste it. The safest history entry is one that was never recorded. Use a provider’s supported authentication or secret-management workflow where possible, and check your clipboard manager’s exclusion settings before handling a real key.
Start with the built-in path
When a website or app supports it, use a sign-in flow, passkey, or AutoFill instead of copying a credential. Apple’s Passwords app manages passwords and passkeys; it is not a general substitute for an API secret manager. For API keys, follow the provider’s instructions for secure storage and authentication, and use narrowly scoped, revocable keys where available.
If you must copy a key, pause clipboard recording or exclude the source app when your manager supports it. Check the manager’s rules for sync, backups, and retention too.
Check Spotlight history separately
On macOS versions with Spotlight clipboard history, press Command + Space, then Command + 4 to open the Clipboard view. If you use it, review System Settings → Spotlight for the Clipboard search setting and retention options. To clear existing Spotlight entries, open the Clipboard view and choose More → Clear History. This clears the Spotlight history on this Mac; check any other clipboard managers independently.
During screen sharing, close any open clipboard or secret-manager panels before copying. Confirm what the meeting app captures using a dummy value and the same sharing mode you will use for the meeting.
Test the workflow with a fake value
-
Before using a real key, write a distinctive dummy such as
DEMO-NOT-A-REAL-KEY-4827in a disposable note. - Enable your manager’s exclusion or pause setting, then copy the dummy and paste it into another disposable note.
- Check Spotlight Clipboard, each active manager, and any device that syncs clipboard history. Search for the dummy only on your test setup. If it appears, the setting did not protect this workflow; remove the test entry and revisit the app’s instructions.
- If it does not appear, repeat after changing the source app or sync settings. A successful dummy test only covers that specific setup, not every secret format or application.
After an accidental copy
- Remove the entry from every clipboard history or synced device that may have retained it, following the relevant app’s instructions. Check backups or shared histories where applicable.
- Copy harmless text to replace the current clipboard contents. This does not erase earlier history entries.
- If the key may have been exposed, revoke or rotate it through the provider, update the applications that use it, and review the provider’s access logs where available.
Apple’s Universal Clipboard can make copied content available briefly on nearby devices signed in to the same Apple Account when its requirements are met. Replacing the current item is useful, but it is not a guarantee that a history or backup was erased.
Choosing a clipboard manager
Look for explicit exclusions, local storage, retention controls, and a way to delete entries. Quartz makes ClipVigil, a clipboard manager designed to mask detected secrets, keep them out of search, and destroy them on a timer. Detection is not a guarantee that every credential will be recognized; use the dummy test and the provider’s security controls too.