Skip to content

fix(governance): honour policy timeout in shell execution β€” remove 60s cap (#28)#86

Merged
jpleva91 merged 1 commit intomainfrom
fix/governance-timeout-override
Mar 30, 2026
Merged

fix(governance): honour policy timeout in shell execution β€” remove 60s cap (#28)#86
jpleva91 merged 1 commit intomainfrom
fix/governance-timeout-override

Conversation

@jpleva91
Copy link
Copy Markdown
Contributor

Summary

  • Removes the unconditional 60-second cap applied in both runShellWithRTK and runShellRaw
  • The governance engine (via engine.GetTimeout()) is now the sole source of truth for execution timeout β€” the value flows through unchanged
  • The default agentguard.yaml bounded-execution policy sets 300s; this fix ensures that value is actually honoured

Root cause

Both shell execution paths silently overrode the caller-supplied timeout:

if timeout > 60*time.Second {
    timeout = 60 * time.Second  // governance policy value discarded
}

Operators who configured generous timeouts had no indication their policy was being ignored β€” the governance log showed the policy matched, but the actual enforcement happened at the hardcoded limit.

Test plan

  • go build ./cmd/shellforge/ passes
  • Manual: run a command that takes >60s β€” verify it is not killed early
  • CI green

Closes #28

πŸ€– Generated with Claude Code

…rdcoded 60s cap (#28)

Both runShellWithRTK and runShellRaw unconditionally capped execution
at 60s, silently overriding whatever timeout_seconds the governance
engine computed from agentguard.yaml. Operators setting longer timeouts
(e.g. the default 300s bounded-execution policy) had no indication their
policy value was being ignored.

Remove the cap in both code paths so the governance engine is the sole
source of truth for execution limits.

Closes #28

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
jpleva91 added a commit that referenced this pull request Mar 30, 2026
- P0 COMPLETE: PRs #83/#84/#85 merged, all P0 governance bugs closed
- Issue #59 closed (already fixed by PR #83)
- PR #86 opened: fix P1 #28 β€” governance timeout override (60s cap removed)
- PR budget: 1/3 (was 3/3 at-limit)
- Dogfood (#76) unblocked from governance side β€” needs human trigger
- P1 remaining: #28 (in PR #86), #63/#68 (qa-agent)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jpleva91 jpleva91 merged commit 3c356f6 into main Mar 30, 2026
5 checks passed
@jpleva91 jpleva91 deleted the fix/governance-timeout-override branch March 30, 2026 04:00
jpleva91 added a commit that referenced this pull request Mar 30, 2026
- P0 COMPLETE: PRs #83/#84/#85 merged, all P0 governance bugs closed
- Issue #59 closed (already fixed by PR #83)
- PR #86 opened: fix P1 #28 β€” governance timeout override (60s cap removed)
- PR budget: 1/3 (was 3/3 at-limit)
- Dogfood (#76) unblocked from governance side β€” needs human trigger
- P1 remaining: #28 (in PR #86), #63/#68 (qa-agent)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
jpleva91 added a commit that referenced this pull request Mar 30, 2026
Sprint goal ACHIEVED: all P0/P1 governance bugs closed.
- PR #86 merged: P1 #28 (timeout override) closed
- PR #88 merged: P1 #63 (classifyShellRisk word-boundary) closed
- PR #89 open: P1 #68 (test coverage) + P2 #66 (dead code), CI green 5/5

Remaining blocker: PR #89 requires human review (@jpleva91).
Dogfood (#76) blocked on setup.sh remote Ollama gap.
Next sprint proposal: dogfood readiness + P2 batch.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
jpleva91 added a commit that referenced this pull request Mar 30, 2026
Sprint goal ACHIEVED: all P0/P1 governance bugs closed.
- PR #86 merged: P1 #28 (timeout override) closed
- PR #88 merged: P1 #63 (classifyShellRisk word-boundary) closed
- PR #89 open: P1 #68 (test coverage) + P2 #66 (dead code), CI green 5/5

Remaining blocker: PR #89 requires human review (@jpleva91).
Dogfood (#76) blocked on setup.sh remote Ollama gap.
Next sprint proposal: dogfood readiness + P2 batch.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
jpleva91 added a commit that referenced this pull request Mar 30, 2026
Sprint goal ACHIEVED: all P0/P1 governance bugs closed.
- PR #86 merged: P1 #28 (timeout override) closed
- PR #88 merged: P1 #63 (classifyShellRisk word-boundary) closed
- PR #89 open: P1 #68 (test coverage) + P2 #66 (dead code), CI green 5/5

Remaining blocker: PR #89 requires human review (@jpleva91).
Dogfood (#76) blocked on setup.sh remote Ollama gap.
Next sprint proposal: dogfood readiness + P2 batch.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

bug: bounded-execution policy timeout (300s) is silently overridden to 60s in shell execution

1 participant