logoalt Hacker News

hoppptoday at 1:46 PM1 replyview on HN

Do not store secrets in the repository in files, but inject them during runtime. Then the agents have no way to access them.


Replies

tiew9Viitoday at 2:08 PM

A lot of people have secrets/config files in the projects working directory but ignored by git i.e. `.env.local`

So they're following best practice, not committing secrets but agents running locally can still see them even if sandboxing to the working directory.

I've taken to storing configs using XDG_CONFIG_HOME and have the app auto resolve them by convention or take a cli arg to specify the config path. All secrets are in files, not env vars.

That way when using sandboxing the agent can never see the configs or secrets as outside the working directory.

show 1 reply