anomalyco / anomalyco/opencode
Permission from opencode.json are ignored on /init command
Open
@neriousy is already working on this.
Since Sep 15, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
Deny-rules from the opencode.json config are ignored when running the /init command in a directory - env files are read regardless of whether the user allowed the agent to or not.
Plugins
No response
OpenCode version
1.18.31
Steps to reproduce
- Setup an
opencode.jsonin$HOME/.opencode/opencode.json - Setup deny-rules on .env-files (example config below)
- run opencode in any directory containing a
.envfile - watch opencode list files via
ls -lafollowed by immediatelycating the .env file
Example opencode.json used in testing
{
"$schema": "https://opencode.ai/config.json",
"permission": {
"read": {
"*": "allow",
"*.env": "deny",
"*.env.*": "deny",
"*.env.example": "allow"
},
"grep": {
"*": "allow",
"*.env": "deny",
"*.env.*": "deny",
"*.env.example": "allow"
},
"glob": {
"*": "allow",
"*.env": "deny",
"*.env.*": "deny",
"*.env.example": "allow"
}
}
}
Screenshot and/or share link
No response
Operating System
No response
Terminal
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.