Skip to main content

keychain-bridge

Facilitates secure management of secrets using macOS Keychain, enhancing security and compatibility with bash tools.

Install this skill

or
0/100

Security score

The keychain-bridge skill was audited on Mar 8, 2026 and we found 85 security issues across 3 threat categories, including 42 high-severity. Review the findings below before installing.

Categories Tested

Security Issues

medium line 135

Template literal with variable interpolation in command context

SourceSKILL.md
135```bash
medium line 227

Python subprocess execution

SourceSKILL.md
227subprocess.run(["/opt/homebrew/bin/python3.14", "-c",
low line 34

Access to hidden dotfiles in home directory

SourceSKILL.md
34Action: python3 SKILL_DIR/scripts/migrate_secrets.py --dir ~/.openclaw/secrets/ --account moltbot --dry-run
low line 40

Access to hidden dotfiles in home directory

SourceSKILL.md
40Action: python3 SKILL_DIR/scripts/audit_secrets.py --dir ~/.openclaw/secrets/ --account moltbot
low line 85

Access to hidden dotfiles in home directory

SourceSKILL.md
85python3 SKILL_DIR/scripts/migrate_secrets.py --dir ~/.openclaw/secrets/ --account moltbot --dry-run
low line 87

Access to hidden dotfiles in home directory

SourceSKILL.md
87python3 SKILL_DIR/scripts/migrate_secrets.py --dir ~/.openclaw/secrets/ --account moltbot
low line 120

Access to hidden dotfiles in home directory

SourceSKILL.md
120MY_SECRET=$(cat ~/.openclaw/secrets/my-service-name)
low line 154

Access to hidden dotfiles in home directory

SourceSKILL.md
154python3 SKILL_DIR/scripts/audit_secrets.py --dir ~/.openclaw/secrets/ --account moltbot
low line 205

Access to hidden dotfiles in home directory

SourceSKILL.md
205os.makedirs(os.path.expanduser("~/.my-app/secrets"), exist_ok=True)
low line 206

Access to hidden dotfiles in home directory

SourceSKILL.md
206path = os.path.expanduser("~/.my-app/secrets/SERVICE")
high line 2

Access to system keychain/keyring

SourceSKILL.md
2name: keychain-bridge
high line 3

Access to system keychain/keyring

SourceSKILL.md
3description: Manage secrets via macOS Keychain instead of plaintext files. Migrate existing secrets, read/write keychain entries, bridge to files for bash tools, audit for leaks, diagnose access issue
high line 4

Access to system keychain/keyring

SourceSKILL.md
4homepage: https://github.com/moltbot/keychain-bridge
high line 16

Access to system keychain/keyring

SourceSKILL.md
16tags: ["keychain", "macos", "secrets", "credentials", "tahoe", "migration"]
high line 19

Access to system keychain/keyring

SourceSKILL.md
19# Keychain Bridge
high line 23

Access to system keychain/keyring

SourceSKILL.md
23- "migrate secrets to keychain" / "move secrets"
high line 24

Access to system keychain/keyring

SourceSKILL.md
24- "check keychain health" / "keychain status"
high line 27

Access to system keychain/keyring

SourceSKILL.md
27- "store secret" / "write to keychain"
high line 28

Access to system keychain/keyring

SourceSKILL.md
28- "keychain not working" / "security find-generic-password hangs"
medium line 33

Access to system keychain/keyring

SourceSKILL.md
33User: "Migrate my secrets to the keychain"
medium line 36

Access to system keychain/keyring

SourceSKILL.md
36User: "Check if the keychain bridge is healthy"
medium line 37

Access to system keychain/keyring

SourceSKILL.md
37Action: Run keychain health check (test write/read/delete cycle)
high line 43

Access to system keychain/keyring

SourceSKILL.md
43Manage secrets via macOS Keychain instead of plaintext files. Eliminates plaintext credential storage while maintaining compatibility with bash-based tools through a file-bridge architecture.
high line 47

Access to system keychain/keyring

SourceSKILL.md
47The `keyring` Python library must be installed for each Python version that will access secrets:
medium line 50

Access to system keychain/keyring

SourceSKILL.md
50pip3 install keyring
medium line 52

Access to system keychain/keyring

SourceSKILL.md
52/usr/bin/python3 -m pip install keyring
medium line 53

Access to system keychain/keyring

SourceSKILL.md
53/opt/homebrew/opt/[email protected]/bin/python3.14 -m pip install --break-system-packages keyring
high line 56

Access to system keychain/keyring

SourceSKILL.md
56## Check Keychain Health
high line 58

Access to system keychain/keyring

SourceSKILL.md
58Verify the keychain bridge is working correctly:
medium line 62

Access to system keychain/keyring

SourceSKILL.md
62import keyring
medium line 64

Access to system keychain/keyring

SourceSKILL.md
64keyring.set_password('keychain-bridge-test', 'test', 'hello')
medium line 66

Access to system keychain/keyring

SourceSKILL.md
66val = keyring.get_password('keychain-bridge-test', 'test')
medium line 69

Access to system keychain/keyring

SourceSKILL.md
69keyring.delete_password('keychain-bridge-test', 'test')
medium line 70

Access to system keychain/keyring

SourceSKILL.md
70print('Keychain health: OK')
high line 78

Access to system keychain/keyring

SourceSKILL.md
78Migrate plaintext secret files to macOS Keychain. The migration tool:
high line 92

Access to system keychain/keyring

SourceSKILL.md
92### Group A — Keychain Only
high line 93

Access to system keychain/keyring

SourceSKILL.md
93Python scripts read directly via `keychain_helper.get_secret(service)`. No file on disk.
high line 96

Access to system keychain/keyring

SourceSKILL.md
96Bash scripts cannot reliably use Python keyring as a subprocess (see **Known Issues**). For these, a boot-time bridge script populates files from the keychain:
high line 103

Access to system keychain/keyring

SourceSKILL.md
103This reads each Group B secret from keychain and writes it to a `chmod 600` file that bash scripts can `cat`.
medium line 111

Access to system keychain/keyring

SourceSKILL.md
111from keychain_helper import get_secret
high line 116

Access to system keychain/keyring

SourceSKILL.md
116The helper tries keychain first, falls back to file read.
high line 133

Access to system keychain/keyring

SourceSKILL.md
133**Critical**: Inject from ALL Python versions on the system. Keychain ACLs are per-binary — an item created by Python 3.9 cannot be read by Python 3.14 unless both binaries are in the ACL.
medium line 143

Access to system keychain/keyring

SourceSKILL.md
143$py -c "import keyring; keyring.set_password('SERVICE', 'ACCOUNT', 'VALUE')"
high line 151

Access to system keychain/keyring

SourceSKILL.md
151Check for unexpected plaintext secret files and verify keychain health:
high line 159

Access to system keychain/keyring

SourceSKILL.md
159- Keychain items that exist but can't be read (ACL issues)
high line 160

Access to system keychain/keyring

SourceSKILL.md
160- Files that exist but aren't in keychain (unmigrated)
high line 161

Access to system keychain/keyring

SourceSKILL.md
161- Keychain library installation status per Python version
high line 166

Access to system keychain/keyring

SourceSKILL.md
166**macOS Tahoe 26.x regression.** The `security` CLI hangs indefinitely (or returns exit code 36) when reading keychain items, even after `security unlock-keychain`. This affects ALL CLI-based keychain
high line 168

Access to system keychain/keyring

SourceSKILL.md
168**Fix**: Use Python `keyring` library instead. It uses the Security framework C API via ctypes, bypassing the broken CLI entirely.
high line 170

Access to system keychain/keyring

SourceSKILL.md
170### Python keyring returns None or raises errSecInteractionNotAllowed (-25308)
high line 171

Access to system keychain/keyring

SourceSKILL.md
171This happens when running from an SSH session. The keychain requires a GUI session (SecurityAgent) context.
high line 175

Access to system keychain/keyring

SourceSKILL.md
175**Fix (SSH write — ctypes unlock)**: The `security unlock-keychain -p` CLI command is also broken on Tahoe (returns "incorrect passphrase" with correct password). Use the Security framework C API via
medium line 179

Access to system keychain/keyring

SourceSKILL.md
179import ctypes, ctypes.util, keyring
medium line 183

Access to system keychain/keyring

SourceSKILL.md
183keychain = ctypes.c_void_p()
medium line 184

Access to system keychain/keyring

SourceSKILL.md
184path = b"/Users/USERNAME/Library/Keychains/login.keychain-db"
medium line 185

Access to system keychain/keyring

SourceSKILL.md
185Security.SecKeychainOpen(path, ctypes.byref(keychain))
medium line 187

Access to system keychain/keyring

SourceSKILL.md
187Security.SecKeychainUnlock(keychain, ctypes.c_uint32(len(pw)), pw, ctypes.c_bool(True))
medium line 189

Access to system keychain/keyring

SourceSKILL.md
189# Now keyring works — but ONLY within this same process
medium line 190

Access to system keychain/keyring

SourceSKILL.md
190keyring.set_password("SERVICE", "ACCOUNT", "VALUE")
medium line 191

Access to system keychain/keyring

SourceSKILL.md
191print("OK" if keyring.get_password("SERVICE", "ACCOUNT") else "FAIL")
medium line 202

Access to system keychain/keyring

SourceSKILL.md
202# After keyring.set_password() succeeds in the same process:
medium line 204

Access to system keychain/keyring

SourceSKILL.md
204val = keyring.get_password("SERVICE", "ACCOUNT")
high line 212

Access to system keychain/keyring

SourceSKILL.md
212### Python keyring hangs when called from bash LaunchAgent
high line 220

Access to system keychain/keyring

SourceSKILL.md
220Keychain ACLs are per-binary. An item created by `/usr/bin/python3` (Python 3.9) has an ACL entry only for that binary. `/opt/homebrew/bin/python3.14` is a different binary and gets access denied.
medium line 225

Access to system keychain/keyring

SourceSKILL.md
225import subprocess, keyring
medium line 226

Access to system keychain/keyring

SourceSKILL.md
226value = keyring.get_password("service", "account")
medium line 228

Access to system keychain/keyring

SourceSKILL.md
228f"import keyring; keyring.set_password('service', 'account', '{value}')"])
high line 233

Access to system keychain/keyring

SourceSKILL.md
233### `keyring` not installed for a Python version
high line 234

Access to system keychain/keyring

SourceSKILL.md
234Each Python binary has its own site-packages. `pip3 install keyring` only installs for one.
medium line 240

Access to system keychain/keyring

SourceSKILL.md
240/usr/bin/python3 -m pip install keyring
medium line 242

Access to system keychain/keyring

SourceSKILL.md
242/opt/homebrew/opt/[email protected]/bin/python3.14 -m pip install --break-system-packages keyring
medium line 249

Access to system keychain/keyring

SourceSKILL.md
249│ macOS Keychain │
medium line 250

Access to system keychain/keyring

SourceSKILL.md
250│ (login keychain) │
medium line 257

Access to system keychain/keyring

SourceSKILL.md
257│ (keychain only) │ │ │ (file bridge) │
medium line 260

Access to system keychain/keyring

SourceSKILL.md
260│ import keychain_ │ │ │ runs at boot → │
medium line 268

Access to system keychain/keyring

SourceSKILL.md
268│ keychain first, │
high line 285

Access to system keychain/keyring

SourceSKILL.md
2851. **`security` CLI broken across the board**: `find-generic-password -w` hangs or exits 36. `unlock-keychain -p` returns "incorrect passphrase" with correct password. `show-keychain-info` exits 36. T
high line 286

Access to system keychain/keyring

SourceSKILL.md
2862. **Keychain ACL per-binary**: Must inject from every Python version that will read the item.
high line 288

Access to system keychain/keyring

SourceSKILL.md
2884. **SSH sessions lack GUI context**: Keychain reads/writes fail with -25308. Use ctypes `SecKeychainUnlock` in the same Python process (see Diagnose Issues), or use Group B file bridge. The ctypes un
high line 289

Access to system keychain/keyring

SourceSKILL.md
2895. **`keyring` must be installed per-Python**: Each binary's site-packages is independent.
high line 290

Access to system keychain/keyring

SourceSKILL.md
2906. **Homebrew Python ignores ctypes unlock**: After `SecKeychainUnlock` via ctypes, `/usr/bin/python3` (Apple system Python 3.9) can read/write via `keyring`, but Homebrew Pythons (3.12, 3.14) still g
high line 296

Access to system keychain/keyring

SourceSKILL.md
296None. This skill makes zero network requests. All operations are local to the macOS Keychain and filesystem.
high line 300

Access to system keychain/keyring

SourceSKILL.md
300- All operations execute locally against the macOS login keychain
high line 304

Access to system keychain/keyring

SourceSKILL.md
304- Secrets are only read from and written to the local keychain or `chmod 600` files
high line 309

Access to system keychain/keyring

SourceSKILL.md
309All code is open for inspection — no obfuscation, no minification, no compiled binaries. The skill operates exclusively on the local macOS Keychain and filesystem. Built and tested on a production Mac
Scanned on Mar 8, 2026
View Security Dashboard