Skip to content

Add an external_directory permission for directory grants #157

Open

Description

@Sewer56

Status

Speculative. Depends on a future TUI (or other interactive frontend)
being added to this project. ReloadedCode is headless today.

Problem

Agents get file access through a PathResolver
(AllowedPathResolver, AllowedGlobResolver) built once, at agent
construction time.

The permission model (reloaded_code_core::permissions::Ruleset) already gates
tools (read, write, edit, bash, task, ...) with default-deny,
last-match-wins allow/deny rules.

A TUI would let a user point an agent at a new folder during a
session, for example "also work in ~/other-project". Today there is
no permission key that governs which directories a session may ever
add.

Current behavior

  • permission: in agent frontmatter has no external_directory key.
  • Path resolvers fix their allowed directories at construction time.
  • Nothing in reloaded-code-core gates a runtime directory grant.

Expected behavior

Add external_directory as a permission key, evaluated with the same
Ruleset used for every other permission:

permission:
  external_directory:
    "~/other-project/**": allow
    "/etc/**": deny
    "**": deny
  • Default is deny, matching every other unlisted permission today.
  • Patterns match against the candidate directory path (or a path
    inside it), using the existing glob/wildcard pattern syntax.
  • Evaluation is last-match-wins, same as read/write/task rules.

Evidence

  • src/reloaded-code-core/src/permissions.rs - Ruleset,
    PermissionAction, last-match-wins evaluation.
  • src/reloaded-code-core/src/path/allowed.rs - AllowedPathResolver.
  • src/reloaded-code-core/src/path/allowed_glob/ - AllowedGlobResolver,
    GlobPolicy.
  • src/reloaded-code-agents/README.md (permission table, pattern
    rules for read/write/edit/glob/grep/bash/task).
  • README.MD ("No TUI. Embed it anywhere.").

Activity

  1. coderabbitai commented on Aug 19, 2026

    @coderabbitai
    🔗 Related PRs

    #80 - Added: Support wildcard patterns in permission keys [merged]
    #89 - Add AllowedGlobResolver for fine-grained path sandboxing with glob patterns [merged]
    #94 - Added: External directory permission for path resolvers [merged]
    #95 - Optimize external directory path resolution and add benchmarks [merged]
    #98 - Rework path resolvers to use workspace-rooted semantics [merged]


    📝 Issue Planner

    Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.

    • Create Plan

    🧪 Issue enrichment is currently in open beta.

    You can configure auto-planning by selecting labels in the issue_enrichment configuration.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions