Skip to content

Add an external_directory permission for directory grants #157

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.").

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