Repository navigation
hitl: named permission modes (Manual / Accept Edits / Locked) - #197
Merged
Merged
Conversation
…ked)
Add PermissionMode::{Manual, AcceptEdits, Locked} and Governance::apply_mode,
a thin layer over hitl_classes/pattern rules (phases 2-3) rather than a new
authorization mechanism: a mode only pre-seeds hitl_classes and a new
deny_unapproved fallback, never touching hitl_tools, the ACL, or loaded
pattern rules.
- Manual: file writes ask for approval, same as shell commands.
- Accept Edits: file writes run free; shell still gated.
- Locked: for scripted/non-interactive runs — anything not covered by an
explicit `allow` pattern is denied outright instead of prompting, since
nothing can answer a prompt.
Note Manual is stricter than the bare `Governance::default()` (which leaves
hitl_classes empty) — a mode is an explicit, opt-in policy a session adopts,
distinct from the minimal library default any caller gets by not touching
modes at all. The TUI applies Manual at session startup so the footer label
and actual enforcement agree from the first frame; this is a deliberate,
documented behavior change (file writes now ask by default in the TUI,
where they didn't before).
Wired into forge-tui: Alt+P cycles the mode (AgentSession::apply_permission_mode
mutates governance in place), shown in the sidebar under Mode and confirmed
via feedback toast on change.
Phase 4 (final phase) of the HITL/permission-model redesign in
docs/hitl-permission-model-research.md. OS-level sandboxing was explicitly
out of scope per the brief; docs/sandboxing-followup.md notes what a
follow-up would need to hook into.
3 tasks done
github-actions Bot
pushed a commit
that referenced
this pull request
Aug 3, 2026
…de (#198) Two corrections to the just-merged permission-mode PR (#197), caught in review before landing further work: 1. Manual mode was gating file writes by default (hitl_classes = [Write]). That's backwards for a coding agent whose core job is writing files — it would make every session nag constantly. Manual now matches today's actual default (writes free, only bash gated), as originally intended. Accept Edits currently behaves identically to Manual as a result, since Forge doesn't gate any other write-class tool by default; documented as such rather than papering over it. 2. Cut PermissionMode::Locked and Governance::deny_unapproved entirely. Locked's only reason to exist was CI/scripted runs where nothing can answer a prompt, but Forge has no non-interactive/headless entry point today — reachable only via Alt+P inside an interactive TUI session, which is a strange thing to want interactively. Re-add it once headless execution is real; docs/sandboxing-followup.md notes the dependency. The mode cycle is now Manual <-> Accept Edits only.
mohitranka
added a commit
that referenced
this pull request
Aug 21, 2026
…ked) (#197) Add PermissionMode::{Manual, AcceptEdits, Locked} and Governance::apply_mode, a thin layer over hitl_classes/pattern rules (phases 2-3) rather than a new authorization mechanism: a mode only pre-seeds hitl_classes and a new deny_unapproved fallback, never touching hitl_tools, the ACL, or loaded pattern rules. - Manual: file writes ask for approval, same as shell commands. - Accept Edits: file writes run free; shell still gated. - Locked: for scripted/non-interactive runs — anything not covered by an explicit `allow` pattern is denied outright instead of prompting, since nothing can answer a prompt. Note Manual is stricter than the bare `Governance::default()` (which leaves hitl_classes empty) — a mode is an explicit, opt-in policy a session adopts, distinct from the minimal library default any caller gets by not touching modes at all. The TUI applies Manual at session startup so the footer label and actual enforcement agree from the first frame; this is a deliberate, documented behavior change (file writes now ask by default in the TUI, where they didn't before). Wired into forge-tui: Alt+P cycles the mode (AgentSession::apply_permission_mode mutates governance in place), shown in the sidebar under Mode and confirmed via feedback toast on change. Phase 4 (final phase) of the HITL/permission-model redesign in docs/hitl-permission-model-research.md. OS-level sandboxing was explicitly out of scope per the brief; docs/sandboxing-followup.md notes what a follow-up would need to hook into.
mohitranka
added a commit
that referenced
this pull request
Aug 21, 2026
…de (#198) Two corrections to the just-merged permission-mode PR (#197), caught in review before landing further work: 1. Manual mode was gating file writes by default (hitl_classes = [Write]). That's backwards for a coding agent whose core job is writing files — it would make every session nag constantly. Manual now matches today's actual default (writes free, only bash gated), as originally intended. Accept Edits currently behaves identically to Manual as a result, since Forge doesn't gate any other write-class tool by default; documented as such rather than papering over it. 2. Cut PermissionMode::Locked and Governance::deny_unapproved entirely. Locked's only reason to exist was CI/scripted runs where nothing can answer a prompt, but Forge has no non-interactive/headless entry point today — reachable only via Alt+P inside an interactive TUI session, which is a strange thing to want interactively. Re-add it once headless execution is real; docs/sandboxing-followup.md notes the dependency. The mode cycle is now Manual <-> Accept Edits only.
mohitranka
added a commit
that referenced
this pull request
Sep 11, 2026
…ked) (#197) Add PermissionMode::{Manual, AcceptEdits, Locked} and Governance::apply_mode, a thin layer over hitl_classes/pattern rules (phases 2-3) rather than a new authorization mechanism: a mode only pre-seeds hitl_classes and a new deny_unapproved fallback, never touching hitl_tools, the ACL, or loaded pattern rules. - Manual: file writes ask for approval, same as shell commands. - Accept Edits: file writes run free; shell still gated. - Locked: for scripted/non-interactive runs — anything not covered by an explicit `allow` pattern is denied outright instead of prompting, since nothing can answer a prompt. Note Manual is stricter than the bare `Governance::default()` (which leaves hitl_classes empty) — a mode is an explicit, opt-in policy a session adopts, distinct from the minimal library default any caller gets by not touching modes at all. The TUI applies Manual at session startup so the footer label and actual enforcement agree from the first frame; this is a deliberate, documented behavior change (file writes now ask by default in the TUI, where they didn't before). Wired into forge-tui: Alt+P cycles the mode (AgentSession::apply_permission_mode mutates governance in place), shown in the sidebar under Mode and confirmed via feedback toast on change. Phase 4 (final phase) of the HITL/permission-model redesign in docs/hitl-permission-model-research.md. OS-level sandboxing was explicitly out of scope per the brief; docs/sandboxing-followup.md notes what a follow-up would need to hook into.
mohitranka
added a commit
that referenced
this pull request
Sep 11, 2026
…de (#198) Two corrections to the just-merged permission-mode PR (#197), caught in review before landing further work: 1. Manual mode was gating file writes by default (hitl_classes = [Write]). That's backwards for a coding agent whose core job is writing files — it would make every session nag constantly. Manual now matches today's actual default (writes free, only bash gated), as originally intended. Accept Edits currently behaves identically to Manual as a result, since Forge doesn't gate any other write-class tool by default; documented as such rather than papering over it. 2. Cut PermissionMode::Locked and Governance::deny_unapproved entirely. Locked's only reason to exist was CI/scripted runs where nothing can answer a prompt, but Forge has no non-interactive/headless entry point today — reachable only via Alt+P inside an interactive TUI session, which is a strange thing to want interactively. Re-add it once headless execution is real; docs/sandboxing-followup.md notes the dependency. The mode cycle is now Manual <-> Accept Edits only.
mohitranka
added a commit
that referenced
this pull request
Sep 11, 2026
…ked) (#197) Add PermissionMode::{Manual, AcceptEdits, Locked} and Governance::apply_mode, a thin layer over hitl_classes/pattern rules (phases 2-3) rather than a new authorization mechanism: a mode only pre-seeds hitl_classes and a new deny_unapproved fallback, never touching hitl_tools, the ACL, or loaded pattern rules. - Manual: file writes ask for approval, same as shell commands. - Accept Edits: file writes run free; shell still gated. - Locked: for scripted/non-interactive runs — anything not covered by an explicit `allow` pattern is denied outright instead of prompting, since nothing can answer a prompt. Note Manual is stricter than the bare `Governance::default()` (which leaves hitl_classes empty) — a mode is an explicit, opt-in policy a session adopts, distinct from the minimal library default any caller gets by not touching modes at all. The TUI applies Manual at session startup so the footer label and actual enforcement agree from the first frame; this is a deliberate, documented behavior change (file writes now ask by default in the TUI, where they didn't before). Wired into forge-tui: Alt+P cycles the mode (AgentSession::apply_permission_mode mutates governance in place), shown in the sidebar under Mode and confirmed via feedback toast on change. Phase 4 (final phase) of the HITL/permission-model redesign in docs/hitl-permission-model-research.md. OS-level sandboxing was explicitly out of scope per the brief; docs/sandboxing-followup.md notes what a follow-up would need to hook into.
mohitranka
added a commit
that referenced
this pull request
Sep 11, 2026
…de (#198) Two corrections to the just-merged permission-mode PR (#197), caught in review before landing further work: 1. Manual mode was gating file writes by default (hitl_classes = [Write]). That's backwards for a coding agent whose core job is writing files — it would make every session nag constantly. Manual now matches today's actual default (writes free, only bash gated), as originally intended. Accept Edits currently behaves identically to Manual as a result, since Forge doesn't gate any other write-class tool by default; documented as such rather than papering over it. 2. Cut PermissionMode::Locked and Governance::deny_unapproved entirely. Locked's only reason to exist was CI/scripted runs where nothing can answer a prompt, but Forge has no non-interactive/headless entry point today — reachable only via Alt+P inside an interactive TUI session, which is a strange thing to want interactively. Re-add it once headless execution is real; docs/sandboxing-followup.md notes the dependency. The mode cycle is now Manual <-> Accept Edits only.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
docs/hitl-permission-model-research.md).forge_governance::PermissionMode(Manual,AcceptEdits,Locked) andGovernance::apply_mode— a thin layer that pre-seedshitl_classes/a newdeny_unapprovedfallback in place, never touchinghitl_tools, the ACL, or loaded pattern rules from phases 2–3.allowpattern is denied outright instead of prompting, since nothing can answer a prompt.Manualis stricter than the bareGovernance::default()(which leaveshitl_classesempty, so writes are currently unguarded). A mode is an explicit, opt-in policy — the TUI appliesManualat session startup so the sidebar label and actual enforcement agree from the first frame, which means file writes now ask for approval by default in the TUI, where they previously didn't. Callers that never touch modes (e.g. tests constructingGovernance::default()directly) are unaffected.Alt+Pcycles the mode (AgentSession::apply_permission_modemutates the session's live governance in place), shown in the sidebar under "Mode", confirmed via a feedback toast on change, documented in?help and the README keybinding table.docs/sandboxing-followup.md: the required note on what an OS-level sandboxing follow-up would need to hook into — explicitly out of scope per the brief, since it's the larger, separate effort that makes the rest of this redesign safe to loosen with confidence.Test plan
cargo fmt --all -- --checkcargo clippy --workspace --all-targets --locked -- -D warningscargo test --workspace --all-targets --locked(0 failures across all 18 crates; 693 in forge-tui, 44 in forge-governance)forge-governance), keybinding mapping + end-to-end dispatch provingLockedmode actually denies through the real turn loop instead of pausing (forge-tui).