Forgive me if I've missed it, but I couldn't see any mechanism in the code for ignoring files like .env which very often contain API secrets and other credentials and sensitive data.
The closest I could see was this hard-coded list:
https://github.com/sst/opencode/blob/67480e5a1c71a0b65467a724a7b7afa828f93168/packages/opencode/src/tool/ls.ts#L7-L19
If I'm right, that means that currently it's possible for security-critical data to be leaked to the LLM, which would be a pretty significant security concern. Other agentic coding environments have gone through the same pain, e.g. there are many threads such as this one in the Cursor forums. So it would be great if opencode got this right from early on.
I think it's fairly simple to solve: just support an .opencodeignore file at the top of the repo (and perhaps honour .gitignore by default too).
(On a related but tangential note, ideally everyone would standardise on .ai-ignore, .ai-rules etc. rather than every agent having its own set of config files, but that's a battle for another day ...)
Forgive me if I've missed it, but I couldn't see any mechanism in the code for ignoring files like
.envwhich very often contain API secrets and other credentials and sensitive data.The closest I could see was this hard-coded list:
https://github.com/sst/opencode/blob/67480e5a1c71a0b65467a724a7b7afa828f93168/packages/opencode/src/tool/ls.ts#L7-L19
If I'm right, that means that currently it's possible for security-critical data to be leaked to the LLM, which would be a pretty significant security concern. Other agentic coding environments have gone through the same pain, e.g. there are many threads such as this one in the Cursor forums. So it would be great if opencode got this right from early on.
I think it's fairly simple to solve: just support an
.opencodeignorefile at the top of the repo (and perhaps honour.gitignoreby default too).(On a related but tangential note, ideally everyone would standardise on
.ai-ignore,.ai-rulesetc. rather than every agent having its own set of config files, but that's a battle for another day ...)