Live data from Hacker News

Ask HN: Best practice securing secrets on local machines working with agents?

news.ycombinator.com

1–10 of 14 posts

Ask HN: Best practice securing secrets on local machines working with agents?

#1
When building with autonomous / semi-autonomous agents, they often need broad local access: env vars, files, CLIs, browsers, API keys, etc. This makes the usual assumption — “the local machine is safe and untampered” — feel shaky.

We already use password managers, OAuth, scoped keys, and sandboxing, but agents introduce new risks: prompt injection, tool misuse, unexpected action chains, and secrets leaking via logs or model context. Giving agents enough permission to be useful seems at odds with least-privilege.

I haven’t seen much discussion on this. How are people thinking about secret management and trust boundaries on dev machines in the agent era? What patterns actually work in practice?

Re: Ask HN: Best practice securing secrets on local machines working with agents?

#5
TBH, the best pattern I've seen is just nuking the secrets at the input level. Run a local regex watcher in-memory that flags anything looking like a PK or seed phrase before it even hits the agent's context window. Keeps it off the network stack entirely

Re: Ask HN: Best practice securing secrets on local machines working with agents?

#6

TBH, the best pattern I've seen is just nuking the secrets at the input level. Run a local regex watcher in-memory that flags anything looking like a PK or seed phrase before it even hits the agent's context window. Keeps it off the network stack entirely

Any prompt injection attack could by pass this by simply do a base64 or any encoding, I guess?

Re: Ask HN: Best practice securing secrets on local machines working with agents?

#9
post #4

Run the agent in a sandbox without access to production secrets.

What if you simply need to give them access. E.g if you want them to do code review you have to at least give them code repo read access. But you don't know if the environment where agent runs will be compromised

Re: Ask HN: Best practice securing secrets on local machines working with agents?

#10
post #2

I've been having success using Doppler for secret storage. Takes it off the filesystem.

My question is not about on or off storage, is more about when you give agent access, it assume the environment agent runs is safe
Post reply on HN