Does your Mac clipboard history leak API keys?
Often, yes, by design: a clipboard manager records what you copy, and API keys get copied. Here is what is stored, what macOS offers to mark secrets, and how ClipVigil handles them.
The short answer
It can. Any clipboard manager that records everything you copy will record the API key you copy from a dashboard or a terminal, and keep it for as long as its history lasts.
Whether that is a problem depends on four things: whether the app skips items that password managers mark as sensitive, where the history is stored and whether it is encrypted, how long secrets are kept, and who or what can see the panel, for example a screen share.
What a clipboard manager stores
A typical clipboard manager keeps the content you copied (text, images, file references), the app you copied it from, a timestamp, and a search index so you can find it again. Most keep this in a database on your disk, and some add cloud sync.
Each of those is a copy of your secret that outlives the moment you pasted it. That is the whole risk, and it is a quiet one: nothing looks wrong until the history is shown on a call, read by another process, or restored from a backup.
How macOS marks sensitive items
macOS does not label secrets on its own. Instead there is a community convention, published at nspasteboard.org: an app that puts sensitive data on the pasteboard adds an extra type next to it.
org.nspasteboard.ConcealedType: for passwords and other secretsorg.nspasteboard.TransientType: for short-lived data that should not be keptorg.nspasteboard.AutoGeneratedType: for values generated by the app, such as one-time codes
Password managers are the main apps that set these types. They are a request, not an enforcement: a clipboard manager has to choose to honour them, and it should check the types before it reads the content. Newer macOS versions also ask before an app reads the pasteboard in the background (System Settings → Privacy & Security → Paste from Other Apps).
Where secrets leak from history
- The panel is visible: Open it during a screen share or recording and everything in it is on show.
- The database is readable: If history is stored unencrypted, other software running as you, or a backup, can read it.
- Search surfaces old items: An index that includes secrets makes a key from last month easy to find, for you and for anyone at your keyboard.
- Retention is long: Many setups keep history for days or forever, far longer than a token needs to exist on a clipboard.
How ClipVigil handles secrets
Every copy passes through the same checks, in order. All of them run on your Mac.
- Pasteboard types first. ClipVigil reads the types before the content. Items marked concealed, transient or auto-generated are not read or recorded.
- Excluded apps. Copies from apps on your exclusion list, such as 1Password, Bitwarden and Keychain Access by default, are not recorded.
- Secret scanner. Built-in rules match AWS, GitHub, OpenAI, Anthropic, Stripe, Slack and Google keys, JWTs, private keys and database URLs with passwords. Plain UUIDs and Git SHAs are left alone.
- Redact, keep out of search, destroy. A hit is shown with its prefix and last four characters, never written to the search index, and destroyed after 30 seconds by default, or not recorded at all. Deleted data is overwritten.
- Encrypted at rest. The history database uses SQLCipher, with its key stored in your Keychain. Touch ID can lock the panel, and the panel is hidden from screen recording and sharing.
Nothing in this path touches the network: the code that captures, stores and scans the clipboard has no networking in it.
What no clipboard manager can fix
Detection is best effort. A key in a format the rules do not know, or a password you invented, looks like ordinary text and may be stored as such. And while a secret sits on the system clipboard, any app that is allowed to read the pasteboard can read it. ClipVigil protects its own history, not the system pasteboard.
A checklist for any clipboard manager
- Does it check for concealed and transient types?: Ask before trusting it with passwords.
- Is history encrypted on disk?: And where does the key live?
- Can secrets be excluded from search?: Or destroyed after a short time?
- Does the panel stay out of screen sharing?: Try it on a test call.
- What does it send over the network?: There should be a list.
ClipVigil’s answers to that checklist are on the privacy page and in the docs.