Permission rules
permissions in config refines the permission mode with allow, ask and deny rules:
{ "permissions": {
"allow": ["bash(git status *)", "bash(zig build *)", "edit(src/**)", "web_fetch(domain:docs.rs)", "mcp__github__*"],
"ask": ["bash(git push *)"],
"deny": ["read(.env)", "bash(rm -rf *)", "web_search"] } }- Form. A rule is
toolortool(pattern), and the tool part may use*. - Shell commands.
bash(...)patterns match the command,*matching anything;"git status *"also matches plaingit status. A command is split on&&,||,;,|and newlines: an allow rule applies only when every part is allowed, and a deny rule blocks the whole command if any part matches. A command with$(...), backticks or<(...)is never allowed by a rule. - Paths.
read(...),write(...)andedit(...)take path globs relative to the working directory (or absolute, or~/).editcoverswrite, andreadcoversgrepandglob. - Web.
web_fetch(domain:host)matches the host and its subdomains. - Precedence. Deny beats ask, ask beats allow, and allow beats the mode. Allow rules refine
askmode; they never loosenread-onlymode, the write roots or the OS sandbox. - "Always allow". Answering it saves the suggested rules to the project's entry in
~/.config/oi/projects.json: one per part of a shell command (its program and subcommand), the file's directory for file tools, the host forweb_fetch, otherwise the tool name. No rule is offered for a command that writes to a file (>), contains substitutions, or runs an interpreter or another command (python -c,bash x.sh,env,sudo,xargs,find, a baregit, ...), since a prefix rule would allow anything. A rule's*never covers a redirection to a file either. - Searches.
grepandglobcheck every file they read againstread(...)deny and ask rules and the credential-store block, symlinks resolved; skipped files are counted in the result.