Skip to content

Add engine.permission-mode as a first-class Claude engine config field#33658

Draft
Copilot wants to merge 3 commits into
mainfrom
copilot/decouple-engine-permission-mode
Draft

Add engine.permission-mode as a first-class Claude engine config field#33658
Copilot wants to merge 3 commits into
mainfrom
copilot/decouple-engine-permission-mode

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 21, 2026

The network egress firewall injects bash: ["*"], which triggered the hasBashWildcardInTools heuristic and silently forced --permission-mode bypassPermissions, making --allowed-tools enforcement ineffective. The only override was a fragile engine.args workaround relying on Claude CLI's last-flag-wins behavior.

Changes

  • EngineConfig struct — adds PermissionMode string field; extracted from frontmatter engine.permission-mode in both standard and inline-definition code paths
  • ValidationvalidateEnginePermissionMode rejects any value outside {auto, acceptEdits, plan, bypassPermissions}; wired into both compiler orchestrator paths
  • claude_engine.go — explicit permission-mode takes priority over the bash-wildcard auto-selection; fallback behavior is unchanged
  • Schemapermission-mode added with an enum constraint to engine_config variants 1 and 2 in main_workflow_schema.json; autocomplete-data.json regenerated

Usage

engine:
  id: claude
  permission-mode: auto   # auto | acceptEdits | plan | bypassPermissions

Setting permission-mode: auto (or acceptEdits) with the firewall enabled now keeps --allowed-tools enforcement active, decoupling tool-boundary policy from the firewall's bash wildcard injection.

Copilot AI and others added 2 commits May 21, 2026 00:53
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…de engine

- Add PermissionMode field to EngineConfig struct
- Extract permission-mode from frontmatter in ExtractEngineConfig (both standard and inline-definition paths)
- Add validateEnginePermissionMode that accepts: auto, acceptEdits, plan, bypassPermissions
- Wire validation in compiler_orchestrator_workflow.go and compiler_string_api.go
- Update GetExecutionSteps in claude_engine.go to honor explicit permission-mode before falling back to bash-wildcard logic
- Add permission-mode to main_workflow_schema.json (engine_config oneOf variants 1 and 2)
- Regenerate docs/public/editor/autocomplete-data.json
- Add tests for extraction, validation, and Claude engine override behavior

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Decouple engine.permission-mode from bash-wildcard auto-selection Add engine.permission-mode as a first-class Claude engine config field May 21, 2026
Copilot AI requested a review from pelikhan May 21, 2026 01:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Decouple engine.permission-mode from bash-wildcard auto-selection

2 participants