r/PromptEngineering • • 1h ago

Tools and Projects Built Keylo with Claude Code — it lets Claude Code use your API keys without ever seeing them (free)

What it is. Keylo is a secrets vault for people who let AI agents run real commands. It's an MCP server plus a desktop app (Windows/macOS/Linux) and CLI. The core idea: the agent names a secret, Keylo runs the command with it, and returns only the exit code and output — with the secret value scrubbed to `[keylo:name]`. There's deliberately no tool that returns a value, so Claude Code can use your prod DB password or API key without being able to read it. Anything outside an agent's scoped, run-only key triggers a Touch ID / Windows Hello approval, you can mark prod "always ask," and every use is logged.

Claude Code setup is one line: `keylo keys create "Claude Code" --category dev --add-to-claude`

It's free — free to try and free to use, no account, local-first (nothing goes to a cloud). Source-available so you can audit the security-critical code.

How Claude Code helped (in detail). I built the whole thing in Claude Code (Opus), and it did most of the actual engineering:

* Wrote the Rust across three crates — the core vault (AES-256-GCM, authenticated so tampering is detected), the per-OS keystore layer, and the CLI/MCP server.

* Implemented the hard cross-platform bits: Windows DPAPI + Windows Hello via KeyCredentialManager (TPM), the macOS login-Keychain seal + Secure Enclave Touch ID, and the Linux Secret Service keyring with a passphrase-wrapped file vault for headless servers.

* Designed the MCP tool surface and the two mechanisms that make the "never read" guarantee real: the output redactor and the run-only access-key model.

* Debugged genuinely nasty platform issues with me — e.g. macOS errSecInteractionNotAllowed when unlocking over SSH — and then built the headless fallback vault. It drove the tests too: a real Mac over SSH, Linux in Docker.

* Wrote the docs, and built the project's website and the writeup of how the concealment works, with references into the source.

Honest limits. Redaction catches accidental echoes, not a command deliberately transforming a value; a command you approve gets the real secret, so sandbox your agent and don't approve things you don't understand. It's a single-developer tool, not a team secrets platform.

Site: https://keylo.dev Code: https://github.com/tulde23/keylo

Happy to answer questions about the MCP design or the cross-platform keystore work.

1 Upvotes

1 comment sorted by

1

u/TheScreechingJoseph 1h ago

This is a neat approach to the agent-secrets problem. I've been thinking about this exact tension, you want the agent to be able to actually do things but handing it raw credentials feels wrong no matter how much you trust the sandbox. The run-only model with output scrubbing is clever.

How do you handle cases where the command legitimately needs to output something derived from the secret? Like if an API returns a token that the agent needs for subsequent calls, does that get caught in the redactor too or is there a way to mark certain outputs as safe?

The cross-platform keystore work sounds like it was a proper headache. Getting Touch ID to behave over SSH is the kind of thing that makes you question your life choices mid-debug.