How Permissions Work
When the agent calls a tool, the permission system checks your rules in priority order:- Deny rules — Checked first. If matched, the action is blocked immediately.
- Ask rules — Checked second. If matched, you’re always prompted (overrides any allow rules).
- Allow rules — Checked last. If matched, the action proceeds without prompting.
- Default — If no rule matches, you’re prompted for approval.
Because deny is checked before ask, and ask is checked before allow, a deny rule always wins. If the same scope matches both a deny and an ask rule, the deny takes effect.
Configuration
Add permissions to your config file’spermissions section:
- Project config
- User config
- Local override
Permission Syntax
There are two types of permission matchers: scope-based (controlling what paths/commands/URLs are accessible) and tool-based (controlling which tools can be used).Scope-Based Permissions
Read(glob)
Read(glob)
Controls file read access. The glob pattern matches file paths.Directory paths automatically match all files within them.
Write(glob)
Write(glob)
Controls file write/edit access.
Exec(prefix)
Exec(prefix)
Controls shell command execution. Matches commands that start with the given prefix.
Exec(git) matches “git”, “git status”, “git commit -m ‘msg’” but NOT “gitk” or “github-cli”. The prefix must match as a complete word.Fetch(pattern)
Fetch(pattern)
Controls HTTP fetch access using URL patterns.URL patterns follow the WHATWG URL Pattern standard. The
domain: shorthand matches any path on the exact domain.Tool-Based Permissions
Match by tool name to control entire tools:read, edit, grep, glob, exec
MCP Tool Permissions
Control access to MCP server tools:| Pattern | Matches |
|---|---|
mcp__server__tool | One specific tool |
mcp__server__* | All tools on a server |
mcp__* | All MCP tools everywhere |
Path Patterns
Glob patterns inRead() and Write() support:
| Pattern | Meaning |
|---|---|
* | Any characters in a single path segment |
** | Any characters across path segments (recursive) |
~ | Home directory expansion |
Persistence Options
When the agent asks for permission during a session, you can choose how to save your decision:| Option | Where it’s saved | Shared with team? |
|---|---|---|
| Allow once | Not saved | No |
| Allow for session | In memory only | No |
| Allow for project | .cognition/config.json | Yes |
| Allow for project (local) | .cognition/config.local.json | No |
| Allow globally | ~/.config/cognition/config.json | No |
Precedence
When multiple permission sources define rules, they’re merged with this precedence (highest first):- Organization/team settings (if enterprise)
- Session-level grants (interactive approvals)
- Project local config (
.cognition/config.local.json) - Project config (
.cognition/config.json) - User config (
~/.config/cognition/config.json)

