I looked into alternatives and asked friends, but the only workable approach I found for my workflow was writing custom wrappers around CLIs to handle authentication. I got tired of the back-and-forth, rotating leaked tokens, and maintaining wrappers, so I built Keyclasp. I've been using it for two months now and I don't see how could do without.
Keyclasp stores credentials in a local encrypted vault. The agent works with secret names and selects what a command needs:
keyclasp run --project myapp --environment dev --env API_KEY -- npm test
The child process receives the requested token through its environment. The agent can list available secret names, but cannot retrieve the values. I also include a skill that explains the workflow. You can optionally require operator authorization when passing secrets. Everything is local and open source.It's not bulletproof and the command still needs to be trusted: it receives the real credential and can write it to disk or send it over the network, but that's ok in most cases as many agents sandbox disk or network anyway.
An output guard scans stdout and stderr for exact injected values of at least eight characters. If it detects one, it redacts the match, stops forwarding output, and attempts to terminate the process group. Shorter values, encoded values, and fragments are outside that protection.
You can install it with:
npm install -g keyclasp@beta
It’s MIT licensed and began as a fork of https://keyblind.dev/, created by Mohammed Aarif Shaikh.
How are you handling credentials for local coding agents today? I’d be interested in approaches I missed and places where this workflow falls short.