Skip to content

fix: skip approval gate for full shell exec policy#23

Merged
houko merged 1 commit into
mainfrom
fix/full-exec-approval-gate-clean
Mar 13, 2026
Merged

fix: skip approval gate for full shell exec policy#23
houko merged 1 commit into
mainfrom
fix/full-exec-approval-gate-clean

Conversation

@houko

@houko houko commented Mar 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • skip the approval gate for shell_exec when the effective agent exec_policy.mode is Full
  • keep approval required for non-full exec policies
  • add runtime tests covering both branches

Problem

LibreFang already deserializes per-agent exec_policy overrides correctly, but execute_tool() was still running the approval gate before it knew whether the effective policy was Full.

That meant agents configured with exec_policy = "allow" could still be blocked by the human approval flow before the shell-exec policy was considered.

Verification

  • cargo fmt --all --check
  • cargo check -p librefang-runtime
  • cargo test -p librefang-runtime test_shell_exec_full_policy_skips_approval_gate
  • cargo test -p librefang-runtime test_shell_exec_non_full_policy_still_requires_approval

Closes #22

Upstream reference: RightNow-AI/openfang#222

@houko
houko merged commit ec18097 into main Mar 13, 2026
8 checks passed
@houko
houko deleted the fix/full-exec-approval-gate-clean branch March 13, 2026 04:05
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.

Skip approval gate for shell_exec when agent exec_policy is full

1 participant