Skip to content

Add SOP_MODE=observe, a dry run for the barrier - #762

Merged
gerardrecinto merged 2 commits into
masterfrom
observe-mode
Nov 14, 2026
Merged

gerardrecinto merged 2 commits into
masterfrom
observe-mode

Conversation

@gerardrecinto

Copy link
Copy Markdown
Collaborator

Adds an opt-in dry run for the barrier, for trying a runbook on real agent traffic before enforcing it.

With SOP_MODE=observe, a step that would be blocked runs anyway. The result has executed true, would_have_blocked with the missing state, and a hint that nothing is being blocked. The decision log and joltrin_steps_total record it as observed, and the server warns on stderr at startup.

It is off by default. Any value other than observe or enforce is refused at startup. Enforcing mode is unchanged and has a test for it.

Not covered: validate_step still reports unsafe in observe mode, and the A2A server ignores the mode. In observe mode the check and commit are two lock steps, so parallel calls on one trace_id can interleave. That is harmless when nothing is enforced.

Tested: go test on tools, cmd and verify, plus the real binary in default, observe and invalid modes.

Thanks,
Gerard

With SOP_MODE=observe a step that would be blocked runs anyway. The result
says executed with would_have_blocked and the reason, the decision log and
metrics record it as observed, and the server warns on stderr at startup.
Off by default, and any value other than observe or enforce is refused.

Thanks,
Gerard
@gerardrecinto gerardrecinto self-assigned this Nov 12, 2026
@gerardrecinto
gerardrecinto enabled auto-merge (squash) November 12, 2026 00:07
@github-actions

Copy link
Copy Markdown

Gemini PR Review

Reviewed commit: 5b59cdd7995309602bedda219491337cf178ba13
Verdict: FAIL

  • Correctness Bug: In tools/mcpserver/server.go, when SOP_MODE=observe is set and a step that would normally be blocked is allowed to execute, the wf.Commit operation is performed. If this Commit operation fails (e.g., due to an underlying storage issue), the executeStepHandler currently returns unknownStepResult. This result indicates Executed: false and sets the Blocked field. This contradicts the intended behavior of SOP_MODE=observe, which is to report Executed: true along with a WouldHaveBlocked reason, and is an unhandled edge case for commit failures in this mode.

This result blocks merge. Push a fix and comment /gemini review. To contest a finding, see the Gemini dispute process in CONTRIBUTING.md.

@github-actions

Copy link
Copy Markdown

Gemini PR Review

Reviewed commit: 2e03702a353e0644dcf3220f4d7af35b69940b54
Verdict: PASS

  • Security Risk (Operational Transparency): cmd/sop-mcp-server/main.go and docs/OPERATIONS.md: The new SOP_MODE=observe environment variable significantly changes the behavior of the server from blocking steps to allowing them while logging the would-be block. While this is intentional for a "dry run" mode, it represents a temporary weakening of security enforcement. The diff includes crucial mitigations: a prominent warning printed to stderr at startup when in observe mode, and clear documentation in OPERATIONS.md emphasizing that "NOTHING IS BLOCKED" and warning against leaving it on for production systems. These measures are adequate for making the operational state and its security implications transparent to users.

@gerardrecinto
gerardrecinto merged commit aec7f33 into master Nov 14, 2026
39 checks passed
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.

1 participant