Will not read env even with config set #3523

Open
opened 2026-02-16 17:40:28 -05:00 by yindo · 9 comments
Owner

Originally created by @PilotDevo on GitHub (Dec 13, 2025).

Originally assigned to: @rekram1-node on GitHub.

Description

There seems to be an issues with reading env files. i've written the config file to allow however there still is a block from allowing the agent into the file. any suggestions?

OpenCode version

1.0.152

Steps to reproduce

opencode
/session
any
"analyze our env files for any inconsistencies"
The user has blocked you from reading /home/devo/projects/aiq/v2/platform/.env, DO NOT make further attempts to read it

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Originally created by @PilotDevo on GitHub (Dec 13, 2025). Originally assigned to: @rekram1-node on GitHub. ### Description There seems to be an issues with reading env files. i've written the config file to allow however there still is a block from allowing the agent into the file. any suggestions? ### OpenCode version 1.0.152 ### Steps to reproduce opencode /session any "analyze our env files for any inconsistencies" The user has blocked you from reading /home/devo/projects/aiq/v2/platform/.env, DO NOT make further attempts to read it ### Screenshot and/or share link _No response_ ### Operating System _No response_ ### Terminal _No response_
yindo added the bug label 2026-02-16 17:40:28 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Dec 13, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #4969: Overly restrictive .env file blocking prevents reading legitimate files

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Dec 13, 2025): This issue might be a duplicate of existing issues. Please check: - #4969: Overly restrictive .env file blocking prevents reading legitimate files Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Dec 13, 2025):

yeah rn it’s blocked ill make it configurable tho

as a work around you can enter shell mode (type ! into prompt)

and then do:

cat .env

@rekram1-node commented on GitHub (Dec 13, 2025): yeah rn it’s blocked ill make it configurable tho as a work around you can enter shell mode (type ! into prompt) and then do: cat .env
Author
Owner

@PilotDevo commented on GitHub (Dec 23, 2025):

any updates? Still would be nice for sandboxed projects for our agents to be able to read the .env's. Still no joy with configs on the later updates. Thanks.

@PilotDevo commented on GitHub (Dec 23, 2025): any updates? Still would be nice for sandboxed projects for our agents to be able to read the .env's. Still no joy with configs on the later updates. Thanks.
Author
Owner

@rekram1-node commented on GitHub (Dec 23, 2025):

waiting for the permission updates to ship, Dax has a branch he has been working on should land in next day or so

@rekram1-node commented on GitHub (Dec 23, 2025): waiting for the permission updates to ship, Dax has a branch he has been working on should land in next day or so
Author
Owner

@PilotDevo commented on GitHub (Dec 23, 2025):

Thanks.

@PilotDevo commented on GitHub (Dec 23, 2025): Thanks.
Author
Owner

@dhruvkej9 commented on GitHub (Dec 29, 2025):

any updates??

@dhruvkej9 commented on GitHub (Dec 29, 2025): any updates??
Author
Owner

@dhruvkej9 commented on GitHub (Dec 29, 2025):

yeah rn it’s blocked ill make it configurable tho

as a work around you can enter shell mode (type ! into prompt)

and then do:

cat .env

This method does not works

@dhruvkej9 commented on GitHub (Dec 29, 2025): > yeah rn it’s blocked ill make it configurable tho > > as a work around you can enter shell mode (type ! into prompt) > > and then do: > > cat .env This method does not works
Author
Owner

@PilotDevo commented on GitHub (Dec 29, 2025):

yeah rn it’s blocked ill make it configurable tho

as a work around you can enter shell mode (type ! into prompt)

and then do:

cat .env

This method does not works

It does but it only allows the agent to read it in that single prompt. It doesn't persist. So it's basically useless.

@PilotDevo commented on GitHub (Dec 29, 2025): > > yeah rn it’s blocked ill make it configurable tho > > > > as a work around you can enter shell mode (type ! into prompt) > > > > and then do: > > > > cat .env > > This method does not works It does but it only allows the agent to read it in that single prompt. It doesn't persist. So it's basically useless.
Author
Owner

@boxpositron commented on GitHub (Jan 12, 2026):

yeah rn it’s blocked ill make it configurable tho
as a work around you can enter shell mode (type ! into prompt)
and then do:
cat .env

This method does not works

It does but it only allows the agent to read it in that single prompt. It doesn't persist. So it's basically useless.

I had a similar problem. I created a package https://github.com/boxpositron/envsitter and OpenCode plugin https://github.com/boxpositron/envsitter-guard that solves this exact problem. EnvSitter Provides privacy for .env files but gives agents enough information to perform and complete tasks.

@boxpositron commented on GitHub (Jan 12, 2026): > > > yeah rn it’s blocked ill make it configurable tho > > > as a work around you can enter shell mode (type ! into prompt) > > > and then do: > > > cat .env > > > > > > This method does not works > > It does but it only allows the agent to read it in that single prompt. It doesn't persist. So it's basically useless. I had a similar problem. I created a package https://github.com/boxpositron/envsitter and **OpenCode** plugin https://github.com/boxpositron/envsitter-guard that solves this exact problem. **EnvSitter** Provides privacy for .env files but gives agents enough information to perform and complete tasks.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3523