You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue might be a duplicate of existing issues. Please check:
pii/secrets censor #3056: PII/secrets censor - discusses censoring sensitive data using regex patterns for critical sensitive values
set readonly and not ignore permissions #3055: Set readonly and not ignore permissions - mentions using .opencodenotignore or config files to prevent certain files from being sent while still allowing reference
Feel free to ignore if none of these address your specific case.
you can use ts or js and the win is you can do fairly complex logic, maybe this is too much work and there should just be a config option but we would prolly address that at some point
Hi team,
I've built a plugin to support excluding sensitive content from the agent's reach: https://github.com/pjmartos/opencode-leak-proof
It honours .aiexclude files at various locations as well as project-root .gitignore files (.gitignore files in subfolders are still not supported).
It's still in kind of an experimental phase, but early results are encouraging.
I would greatly appreciate any feedback you may have.
Cheers.
@rekram1-node I did find some proposals in at least three of the tools in the Agent space to either start honouring that filename when/if sensitive content exclusions are implemented, or to rename the vendor-specific files:
Given the lack of standardization, at the end of the day the file name wherein to store the exclusion patterns would have to be chosen somewhat arbitrarily. The alternatives were either a bit too vendor-specific (.geminiignore, .cursorignore), or move away from the well-known glob syntax (e.g. .claude/settings.json, which is also vendor-specific). I just decided to go with the "lesser of many evils" and go for .aiexclude, in the hope that at least some people would benefit from not having to create yet another file 😅
That being said, any filename proposal (or any other proposal of any kind, for that matter) are more than welcome.
Cheers.
I think this could really do with a simple file like .opencodeignore similar to .geminiignore or .claudeignore that means certain stuff just never gets read!
Activity
github-actions commentedon Oct 14, 2025
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
OpeOginni commentedon Oct 14, 2025
@glennvdv check out the tip here #3124 (comment)
you need to set
OPENCODE_EXPERIMENTAL_WATCHERtotrueand then add this to youropencode.json{ "$schema": "https://opencode.ai/config.json", "watcher": { "ignore": ["<file-to-ignore>"] } }@rekram1-node could suggest other ways I might not know about
glennvdv commentedon Oct 14, 2025
claude indeed suggested this, but found no offical documentation for it
OpeOginni commentedon Oct 14, 2025
yeah the docs might need some update with it added, but then again its just experimental
rekram1-node commentedon Oct 14, 2025
hm @OpeOginni filewatcher shouldnt be relevant
@glennvdv currently the best way to exclude files is to write a simple plugin!
here is an example:
https://opencode.ai/docs/plugins/#env-protection
you can place it in your project:
.opencode/plugin/file-projection.ts
or you can place it globally:
~/.config/opencode/plugin/file-protection.ts
I recommend making the error it throws a bit “prompty” try to really tell the llm to not try to read the files
rekram1-node commentedon Oct 14, 2025
you can use ts or js and the win is you can do fairly complex logic, maybe this is too much work and there should just be a config option but we would prolly address that at some point
pjmartos commentedon Dec 2, 2025
Hi team,
I've built a plugin to support excluding sensitive content from the agent's reach: https://github.com/pjmartos/opencode-leak-proof
It honours
.aiexcludefiles at various locations as well as project-root.gitignorefiles (.gitignorefiles in subfolders are still not supported).It's still in kind of an experimental phase, but early results are encouraging.
I would greatly appreciate any feedback you may have.
Cheers.
rekram1-node commentedon Dec 2, 2025
@pjmartos does anyone else respect .aiexclude besides google/gemini out of the box?
pjmartos commentedon Dec 2, 2025
@rekram1-node I did find some proposals in at least three of the tools in the Agent space to either start honouring that filename when/if sensitive content exclusions are implemented, or to rename the vendor-specific files:
Given the lack of standardization, at the end of the day the file name wherein to store the exclusion patterns would have to be chosen somewhat arbitrarily. The alternatives were either a bit too vendor-specific (
.geminiignore,.cursorignore), or move away from the well-known glob syntax (e.g..claude/settings.json, which is also vendor-specific). I just decided to go with the "lesser of many evils" and go for.aiexclude, in the hope that at least some people would benefit from not having to create yet another file 😅That being said, any filename proposal (or any other proposal of any kind, for that matter) are more than welcome.
Cheers.
zhabiba24 commentedon Feb 4, 2026
I think this could really do with a simple file like
.opencodeignoresimilar to.geminiignoreor.claudeignorethat means certain stuff just never gets read!DavidNorena commentedon Feb 4, 2026
or maybe lets start thinking about a standard, i dont know what if every one just embraces .aiignore so you dont have to deal with it in each cli ?
rekram1-node commentedon Feb 4, 2026
We now have more granular permissions so u can exclude dirs, files, etc.
ex:
u can use "deny" to prevent it from being read all together
github-actions commentedon Apr 6, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.