keychain-auth communicates over a local IPC channel using newline-delimited JSON. Every message is a single JSON object terminated by a newline (Documentation Index
Fetch the complete documentation index at: https://theseventeen-2abbdf80.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
\n). There are no HTTP layers, no TLS handshakes, and no session tokens — your process’s kernel-verified identity is the credential.
Transport
The daemon listens on a platform-specific IPC endpoint:| Platform | Transport | Socket / Pipe path |
|---|---|---|
| macOS | Unix domain socket | ~/Library/Application Support/keychain-auth/agent.sock |
| Linux | Unix domain socket | $XDG_RUNTIME_DIR/keychain-auth/agent.sock (fallback: ~/.cache/keychain-auth/agent.sock) |
| Windows | Named Pipe | \\.\pipe\keychain-auth |
~/Library/Application Support/keychain-auth/. On Linux it uses $XDG_RUNTIME_DIR when set, otherwise ~/.cache/keychain-auth/.
Architecture
Connection-bound authentication
keychain-auth does not issue session tokens or API keys. The connection is the session. When you open a socket, the daemon immediately reads your process’s true PID directly from the kernel — it never trusts a self-reported value. Once your PID is known, the daemon:- Resolves your binary’s path on disk.
- Computes and verifies its SHA-256 hash against the approved
config.jsondatabase. - Binds your binary’s fine-grained access policy to the active connection.
If your application forks and exec’s a child process, that child inherits open file descriptors by default. Always open the socket with
SOCK_CLOEXEC (Unix) or set the handle as non-inheritable (Windows) to prevent child processes from hijacking your authenticated session.Connection lifecycle
A typical session follows this sequence:- Connect — open the socket or named pipe.
- Kernel verification — the daemon reads your PID, resolves your binary, and verifies its hash. If your binary is unregistered, the daemon sends a final
deniedresponse and closes the connection immediately. - Policy binding — the daemon reads
config.jsonand binds your allowed services and capabilities to the connection. - Request loop — send
REQUESTmessages and receiveRESPONSEmessages sequentially. - Disconnect — close the connection when done.
Message format
Every message — both requests and responses — is a single JSON object on one line, terminated by\n: