Permissions

Manage interactive tool-approval rules from the CLI with praisonai permissions

Manage interactive tool-approval rules from the CLI — praisonai permissions lists, adds, removes, and shares your project’s approval rules.

Diagram

Rule match

No rule

Agent

Tool Call

Permission Check

Allow / Deny

Prompt User

Allow / Deny / Persist

Quick Start

  1. Run with interactive approval
    bash
    praisonai --approval console run "Check git status"

    When a sensitive tool runs, you see the approval prompt.

  2. Persist with always

    Press a at the prompt to write a persistent allow-rule to approvals.json.

  3. Re-run without prompting
    bash
    praisonai --approval console run "Check git status again"

    Matching rules are applied automatically.

Approval prompt

🔒 Tool Approval Required
Function: execute_command
Risk Level: MEDIUM
Agent: researcher
Arguments:
  command: git status

Allow execute_command?  [o] once   [s] this session   [a] always (bash:git status *)   [n] no   [d] deny & redirect
Choice [o/s/a/n/d] (n):

The five keys choose how long the approval lasts:

  • [o] once — consumed after this exact call; a second matching call re-prompts
  • [s] session — kept in memory for this process
  • [a] always — persisted to ~/.praisonai/permissions/ and reused across runs
  • [n] no — deny once
  • [d] deny & redirect — deny, then type what the agent should do instead at the What should the agent do instead? follow-up; the guidance steers the next turn

See Interactive Tool Approval for the full scope semantics.

Diagram
DiskPermissionManagerCLIUserDiskPermissionManagerCLIUseropt[a (always)]alt[Rule matches][No rule]check(target, agent)ALLOW / DENYShow prompto / s / a / napprove(target, reusable_scope=True)approvals.json

CLI approval modes

FlagModeBehaviour
--approval consoleDEFAULTPrompt for sensitive tools
--approval planPLANBlock write, edit, delete, bash, shell
--plan (shortcut)PLANAlias for --approval plan. Read-only — write, edit, delete, bash, shell are denied. Cannot be combined with --approval, --allow, --deny, or --permission-default.
--approval accept-editsACCEPT_EDITSAuto-approve edit/write tools
--approval bypassBYPASSSkip all checks (dangerous)
bash
praisonai --approval plan run "Explore the codebase"
praisonai --approval accept-edits run "Refactor utils.py"

Read-only mode shortcut

--plan on praisonai run and praisonai code is a discoverable shortcut for --approval plan.

bash
praisonai run  --plan "Explore the codebase"
praisonai code --plan "Draft a migration plan"

Both wrap --approval plan (PermissionMode.PLAN) — the underlying enforcement is unchanged. --plan cannot be combined with --approval, --allow, --deny, or --permission-default (and on code, not with --no-safe / --dangerously-skip-approval); contradictory combinations exit 1. See Permission Modes.

Non-interactive mode

OptionTypeDefaultDescription
--yes / -yflagoffSkip prompts; approval defaults to deny
PRAISONAI_NON_INTERACTIVE=1envunsetSame as --yes for CI and scripts
bash
praisonai --yes --approval console run "Deploy check"
PRAISONAI_NON_INTERACTIVE=1 praisonai --approval console run "Deploy check"

Subcommands

list

List all permission rules in the current project.

bash
praisonai permissions list

allow

Add an ALLOW rule.

bash
praisonai permissions allow "bash:git *" --description "Allow git"
OptionTypeDefaultDescription
--agentstringall agentsScope rule to one agent
--descriptionstringautoHuman-readable label
--priorityint100Higher values are checked first

deny

Add a DENY rule.

bash
praisonai permissions deny "bash:rm *" --priority 200
OptionTypeDefaultDescription
--agentstringall agentsScope rule to one agent
--descriptionstringautoHuman-readable label
--priorityint100Higher values are checked first

ask

Add an ASK rule (always prompt).

bash
praisonai permissions ask "bash:*" --agent researcher
OptionTypeDefaultDescription
--agentstringall agentsScope rule to one agent
--descriptionstringautoHuman-readable label
--priorityint50Higher values are checked first

remove

Remove a rule by ID prefix (from list output).

bash
praisonai permissions remove a1b2c3d4

reset

Delete all rules and approvals (requires confirmation).

bash
praisonai permissions reset

export

Print rules as JSON to stdout.

bash
praisonai permissions export > rules.json

import

Import rules from a JSON file.

bash
praisonai permissions import rules.json

Rule patterns

Patterns use tool_name:argument_pattern glob syntax:

PatternMatches
bash:git *All git bash commands
bash:ls *ls commands
read:*All read tool calls — does not authorise .env/private keys — see Secret-File Read Gate
read:*.env.env reads — required to opt in past the Secret-File Read Gate
read:*.pemReads of PEM private keys — gated by default
read:id_rsaReads of SSH private keys — gated by default
write:*.envWrites to .env files
write:/etc/*Truncating redirections to /etc/ (e.g. cat foo > /etc/hosts)
external_dir:/data/*Access to /data/ when workspace_root is set
external_dir:*All out-of-workspace access (use with deny to hard-block)

external_dir: patterns

When workspace_root is set on PermissionManager, any path that resolves outside the root emits an external_dir:<parent>/* sub-target defaulting to ask. Use the CLI to pre-authorise or hard-block these:

bash
# Allow a specific external data directory
praisonai permissions allow "external_dir:/data/*" --description "Shared data volume"

# Hard-block all out-of-workspace access (no prompt, immediate deny)
praisonai permissions deny "external_dir:*" --description "Lock down external filesystem"

See Workspace Boundary for full details on what triggers the gate and how to configure it.

Opt in to reading .env

Reading .env/private keys defaults to ask even with a broad read:* allow. Teams who genuinely need credential-file reads opt in with a secret-specific rule:

bash
# Allow reading .env files (secret-specific — a broad read:* won't do)
praisonai permissions allow "read:*.env" --description "CI reads .env"

When you choose [a] always, the CLI auto-generates a scoped pattern — for example bash:git status * for a git subcommand, or tool:<tool_name> as the default.

Project storage

Rules and session approvals are stored under the current working directory:

FilePurposeCommit to git?
.praisonai/permissions/rules.jsonPersistent allow/deny rulesYes — share team rules
.praisonai/permissions/approvals.jsonPer-developer session approvalsNo — local only

Best practices

Commit rules.json for team alignment

Share .praisonai/permissions/rules.json so everyone gets the same allow/deny defaults.

Never use bypass in production

--approval bypass skips every check. Reserve it for fully trusted local sandboxes.

Use plan for exploration

--approval plan blocks writes and shell commands while you inspect a codebase.

Broaden patterns with wildcards

Use bash:git * instead of one-off rules so related commands stay covered.

Related