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
{{ message }}
Repository navigation
bug(guardrails): .env.example reads blocked despite opencode.json explicitly allowing them #142
The plugin fires in tool.execute.before before permission evaluation, so the config allowlist is never reached.
Impact
Agents investigating Docker/service configurations cannot read .env.example template files. This slows down legitimate debugging workflows unnecessarily.
Proposed Fix
Option A — Narrow the sec regex with a negative lookahead:
/(^|\/)\.env($|\.)(?!example)/i
Option B — Add an early return in deny() and the bash check:
functiondeny(file: string,kind: "read"|"edit"){constitem=rel(input.worktree,file)if(item.endsWith(".env.example"))return// template files are safeif(kind==="read"&&has(item,sec))return"secret material is outside the allowed read surface"...}
The same exception must be applied to the bash command check at L642.
Steps to Reproduce
Enable the guardrails profile in opencode
Ask an agent to read backend/.env.example or run cat backend/.env.example
Activity
[-]test[/-][+]bug(guardrails): .env.example reads blocked despite opencode.json explicitly allowing them[/+]fix(guardrails): address 8 foundation bugs from PR #90 and Issues #140/…