Lists the permission rules in effect, or adds and removes rules. A rule is tool or
tool(spec): a path glob for read, write, edit, grep, find and ls
(write(results/**), relative to the project root; ~/... for the home; //... for other
absolute paths); for r, level<=n, fn:name,... (every flagged function covered),
category:name,..., sh:<command glob> (r(sh:git status*)), sql:<keywords>
(r(sql:select)) and secret:NAME (the only rule that pre-approves a guarded secret read);
MCP tools by name (mcp__github__*). Deny rules win over ask rules, which win over allow
rules. Allow rules never loosen plan mode and never pre-approve level-4 (critical or control)
actions.
Usage
gptr_permissions(
allow = NULL,
ask = NULL,
deny = NULL,
remove = NULL,
scope = c("session", "project", "user")
)Value
A gptr_permissions data frame with columns rule, list, scope and source;
invisibly when rules were added or removed.
Details
Scopes: "session" is this R process; "project" is the user-level project file
tools::R_user_dir("gptr", "config")/projects/<hash>.json, personal and never inside the
project tree; "user" is the user settings file. The listing also shows the shared project
rules of .gptr/settings.json (an untrusted project contributes only deny and ask
rules) and the deny/ask rules of a legacy .gptr/settings.local.json in a trusted
project.
Called from model code during a run, adding or removing rules needs the user's approval of
that call; otherwise it signals gptr_error_permission.