claude-code - 💡(How to fix) Fix [Feature Request] Add trusted framework paths for autonomous agent permission bypass [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#46855Fetched 2026-04-12 13:31:18
View on GitHub
Comments
0
Participants
1
Timeline
5
Reactions
0
Author
Participants
Timeline (top)
labeled ×3cross-referenced ×2

Fix Action

Fix / Workaround

  1. Build an autonomous agent that polls a queue on a schedule (I use dispatch-monitor under the Claude Code Monitor tool).
  2. The agent is configured to run in the background, with no human present to approve prompts.
  3. The agent attempts any of: - git -C /path/to/worktree show HEAD -- some-file.md - sqlite3 ~/.agency/the-agency/iscp.db "SELECT * FROM dispatches" - ls ~/.agency/ - mkdir -p some-project/{docs,src,tests} (brace expansion)
  4. Observe: Claude Code raises a permission prompt that the agent cannot see, acknowledge, or act on.

For the framework-building use case:

  • the-agency is an open-core framework whose premise is that agents operate with increasing autonomy inside a well-defined framework scope.
  • Every permission friction breaks the framework's promise. "The captain handles this for you" becomes "the captain is frozen on a permission prompt you can't see."
  • We've built elaborate workarounds: dispatch-monitor, block-raw-tools hook, run-in tool, complex settings.json grammar — all of which exist to route around the permission model.
RAW_BUFFERClick to expand / collapse

Bug Description Agent permission model needs a "trusted framework paths" concept for autonomous agents

Problem

Claude Code's permission system is designed around interactive human-in-the-loop sessions: when an unfamiliar command or path appears, the user sees a prompt and decides whether to allow it. That model works well for a human developer sitting at a terminal.

It works poorly for autonomous agents operating inside a framework. I'm building the-agency, a multi-agent framework where agents run unattended: polling queues, reading handoffs, running framework tools, responding to events. Most of these operations are read-only and touch a small, predictable set of paths (claude/, ~/.agency/, .claude/, usr/). They are not commands a human should be asked about — they are the framework's own internal plumbing.

What happens in practice:

  • An autonomous worktree agent hits a permission prompt on ls ~/.agency/, git show HEAD -- claude/config/agency.yaml, or sqlite3 ~/.agency/iscp.db "SELECT ...".
  • The agent is running unattended. There is no human at the terminal to approve the prompt.
  • The agent blocks, or the prompt goes to a buffer the agent can't read, and the agent appears to hang for no reason with no visible signal.
  • By the time the principal notices, minutes or hours have passed.

Adding entries to settings.json helps somewhat, but:

  • Permission changes require a session restart to take effect — an autonomous agent can't restart itself in-place.
  • The settings.json permission grammar is command-oriented, not path-oriented. It's hard to say "any read operation on ~/.agency/" without enumerating every verb (ls, cat, git, sqlite3, find, stat, ...).
  • Brace expansion (mkdir -p {a,b,c}) is treated as a compound command even though the shell expands it to a single mkdir call. Same with cmd1 && cmd2 where both commands are individually allowed.

Steps to reproduce

  1. Build an autonomous agent that polls a queue on a schedule (I use dispatch-monitor under the Claude Code Monitor tool).
  2. The agent is configured to run in the background, with no human present to approve prompts.
  3. The agent attempts any of: - git -C /path/to/worktree show HEAD -- some-file.md - sqlite3 ~/.agency/the-agency/iscp.db "SELECT * FROM dispatches" - ls ~/.agency/ - mkdir -p some-project/{docs,src,tests} (brace expansion)
  4. Observe: Claude Code raises a permission prompt that the agent cannot see, acknowledge, or act on.

Expected behavior

One of the following options (listed in preference order):

Option 1: Trusted framework paths

{ "permissions": { "trustedFrameworkPaths": [ "~/.agency/", "./claude/", "./.claude/" ] } }

Any read-only operation on these paths is auto-approved. Writes still gated. This narrowly expands read-trust without opening write-trust.

Option 2: Agent mode

A session-level flag --agent-mode that marks a session as autonomous. Read operations on any path under the project root are auto-approved. Write operations still gated. Permission prompts replaced with structured errors the agent can handle.

Option 3: Hot-reload permissions

Allow settings.json changes to take effect without a session restart. Current workflow forces autonomous agents to lose conversation context on every permission update.

Option 4: Better prompt visibility

If prompts must remain, expose them via a programmatic channel the agent can see (status-line API, pending-prompt tool call). The current model where prompts go to a terminal buffer the agent can't read is the worst case.

Option 5 (narrower but independently valuable): Fix brace expansion parsing

Brace expansion is a single command — the shell expands it before execution. The permission parser should recognize this and match against the mkdir allowlist normally instead of treating it as multiple commands. Same for compound command patterns where both components are individually allowed.

Why this matters

For the framework-building use case:

  • the-agency is an open-core framework whose premise is that agents operate with increasing autonomy inside a well-defined framework scope.
  • Every permission friction breaks the framework's promise. "The captain handles this for you" becomes "the captain is frozen on a permission prompt you can't see."
  • We've built elaborate workarounds: dispatch-monitor, block-raw-tools hook, run-in tool, complex settings.json grammar — all of which exist to route around the permission model.

For the autonomous agent trend broadly:

  • Claude Code's developer audience is increasingly using it for agent-backed workflows.

Feedback ID: b3bb3ef6-f9ad-4400-8c20-b25f69000d8a Note: Content was truncated.

extent analysis

TL;DR

Implementing a "trusted framework paths" concept or an "agent mode" in the Claude Code permission system can help resolve the issue of autonomous agents being blocked by permission prompts.

Guidance

  • Introduce a "trustedFrameworkPaths" configuration option to auto-approve read-only operations on specific paths, such as ~/.agency/, ./claude/, and ./claude/.
  • Consider adding an "agent mode" flag to mark a session as autonomous, allowing read operations on any path under the project root to be auto-approved.
  • Explore the possibility of hot-reloading permissions to allow settings.json changes to take effect without a session restart.
  • Improve prompt visibility by exposing them via a programmatic channel, such as a status-line API or pending-prompt tool call.

Example

{
  "permissions": {
    "trustedFrameworkPaths": [
      "~/.agency/",
      "./claude/",
      "./.claude/"
    ]
  }
}

This example illustrates how the "trustedFrameworkPaths" configuration option could be implemented in the settings.json file.

Notes

The ideal solution would require modifications to the Claude Code permission system, which may involve significant development and testing efforts. The proposed solutions are based on the provided issue description and may need to be adapted to the specific requirements and constraints of the Claude Code system.

Recommendation

Apply a workaround by implementing the "trusted framework paths" concept, as it narrowly expands read-trust without opening write-trust, and is a more targeted solution compared to the other options.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [Feature Request] Add trusted framework paths for autonomous agent permission bypass [1 participants]