# security command

Canonical page: /glossary/security-command

API keys & secrets glossary, macOS Keychain & security. The `security` Command: Scripting the macOS Keychain

**Short answer:** security is the built-in macOS command-line tool for interacting with the Keychain: adding items, finding a stored password, and deleting entries, all from a terminal or a script rather than the Keychain Access app's interface.

## Why it matters

It is powerful but unforgiving: a small mistake in a security command can create a duplicate or oddly-named entry, and the syntax for finding a generic password is not especially memorable for occasional use.

## In Claude Keychain

Claude Keychain's server is, underneath, a wrapper around the security command: lib/keychain.js calls it to store, read, and delete entries, so you get the same OS-level security with a interface built for this one job instead of a command you have to look up each time.

## Common questions

**Is the security command safe to use directly?**

Yes, it is the same mechanism Apple's own apps use, it is just a lower-level tool than most people want for everyday use.

**Does Claude Keychain replace the security command?**

It replaces the need to type it yourself for API keys, but it uses the same command underneath.

## Related

[macOS Keychain](/glossary/macos-keychain), [Keychain Access](/glossary/keychain-access), [Subprocess](/glossary/subprocess)
