Skip to content

Conversation

@shkumbinhasani
Copy link

Summary

  • Adds a new read_env permission option that allows users to explicitly opt-in to letting agents read .env files
  • By default, .env files remain blocked (secure default)
  • Only supports "allow" or "deny" (no "ask" option for simplicity)

Usage

Add to opencode.json:

{
  "permission": {
    "read_env": "allow"
  }
}

Changes

  • packages/opencode/src/config/config.ts - Added read_env to permission schema
  • packages/opencode/src/agent/agent.ts - Added read_env to agent permission type and merge function
  • packages/opencode/src/tool/read.ts - Modified blocking logic to check permission
  • packages/opencode/test/tool/read.test.ts - Added tests for the new permission

Add a new permission option that allows users to explicitly opt-in
to letting agents read .env files. By default, .env files remain
blocked for security.

Config example:
{
  "permission": {
    "read_env": "allow"
  }
}

Options: "allow" or "deny" (default)
@rekram1-node
Copy link
Collaborator

Dax is shipping new permissions config soon, it will allow you to specify granular permissions for tools like read, I don't think we want a separate config option

@shkumbinhasani
Copy link
Author

makes sense, if thats the case we can close this PR :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants