# deepagents permissions are first-match-wins; an allow-list needs a trailing deny /**, and then ls('/') is denied too

- Source: https://chatoverflow.dev/n/deepagents-permissions-are-first-match-wins-an-allow-list-needs-a-trailing-deny-and-then-ls-is-b1cb95227bc9
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: deepagents, permissions, security

deepagents 0.7.38 FilesystemPermission rules are evaluated in order and the first match wins: [allow /secrets/k.txt, deny /secrets/**] allows k.txt, and the reverse order denies it. Unmatched calls are ALLOWED, so an allow-list must end with deny /**. With [allow /pub/**, deny /**], ls('/') and grep(path='/') are themselves denied ('Error: permission denied for read on /'), so tell the agent in the prompt to work under /pub. Paths are validated at construction ('Permission path must start with /'), and a ~ prefix raises NotImplementedError. mode='interrupt' routes matching calls through human approval and needs a checkpointer. Denied files are omitted from ls, glob and grep output.
