Skip to content

fix: harden OpenClaw approval fallback behavior#275

Merged
peg merged 3 commits into
stagingfrom
feat/openclaw-approval-hardening
Apr 26, 2026
Merged

fix: harden OpenClaw approval fallback behavior#275
peg merged 3 commits into
stagingfrom
feat/openclaw-approval-hardening

Conversation

@peg

@peg peg commented Apr 25, 2026

Copy link
Copy Markdown
Owner

Summary

This PR hardens Rampart's OpenClaw integration around approval handling and timeout behavior.

It adds a dedicated OpenClaw hardening layer that:

  • detects whether the installed OpenClaw dist matches a supported bundle shape
  • refuses blind patching on unknown shapes
  • patches approval fallback behavior to fail closed on timeout
  • replaces misleading async completion wording that implied prior user approval
  • aligns Rampart plugin approval timeout to 120000 ms
  • wires the checks into rampart setup openclaw-plugin, rampart doctor, and rampart doctor --fix

It also:

  • fixes flaky proxy tests by isolating test HOME state so local ~/.rampart/policies/user-overrides.yaml files cannot leak into test behavior
  • makes allow-always user-override writeback more robust on Windows, which fixed the CI failure that surfaced on this branch

Why

We saw approval flows that could be confusing or unsafe:

  • timeout/fallback behavior could effectively fail open
  • async completion text could imply the user had already approved a command
  • local OpenClaw/Rampart timeout settings could drift
  • approval-related test coverage was vulnerable to host state
  • Windows file replacement around durable user-override writeback was less robust than it should be

This PR makes those cases stricter, more truthful, and more predictable.

Changes

OpenClaw hardening

  • add internal/openclaw/hardening
  • inspect current hardening state before patching
  • patch only supported OpenClaw bundle shapes
  • fail closed on approval timeout/fallback
  • update async approval completion wording
  • enforce plugins.entries.rampart.config.approvalTimeoutMs = 120000

Setup / doctor integration

  • apply hardening during rampart setup openclaw-plugin
  • add doctor warnings for:
    • unsupported bundle shape
    • unsafe fallback behavior
    • misleading completion attribution
    • timeout misalignment
  • allow rampart doctor --fix to repair approval-hardening drift

Test and platform reliability

  • isolate HOME in proxy tests by default
  • add explicit helper for tests that intentionally need a specific HOME
  • keep durable user override tests working with explicit test-owned state
  • make allow-always writeback retry file replacement more defensively on Windows

Validation

Passed:

go test ./... -count=1

Notes

  • patching intentionally depends on exact supported bundle markers
  • unknown OpenClaw dist layouts are rejected rather than patched heuristically
  • gateway restart remains best-effort, with clear manual fallback messaging

@peg
peg merged commit 53ee1af into staging Apr 26, 2026
4 checks passed
@peg
peg deleted the feat/openclaw-approval-hardening branch April 26, 2026 03:24
This was referenced Apr 27, 2026
peg added a commit that referenced this pull request Apr 27, 2026
* fix: harden agent integration checks (#261)

* fix: harden agent integration checks

* fix: require preload library before codex wrapper

* fix: make codex wrapper setup idempotent

* test: handle macos codex path canonicalization

* docs: align platform integration behavior

---------

Co-authored-by: clap [bot] <[email protected]>

* docs: polish integration platform guidance (#262)

Co-authored-by: clap [bot] <[email protected]>

* chore: prepare v0.9.19 release notes (#263)

Co-authored-by: clap [bot] <[email protected]>

* docs: refresh rampart landing page (#265)

* docs: refresh rampart landing page

* docs: deepen landing page SEO and visuals

* docs: overhaul landing page hero and sections

* docs: replace generated feature cards with product mechanics

* docs: soften landing page origin note

---------

Co-authored-by: clap [bot] <[email protected]>

* docs: update deployed landing page source on staging (#269)

Co-authored-by: clap [bot] <[email protected]>

* docs: polish rampart landing page (#270)

Co-authored-by: clap [bot] <[email protected]>

* fix: preserve modified built-in policy profiles (#273)

* fix: preserve modified built-in policy profiles

* fix: clarify built-in policy drift detection

---------

Co-authored-by: clap [bot] <[email protected]>

* fix: harden OpenClaw approval fallback behavior (#275)

* harden openclaw approval handling

* test: isolate proxy HOME state

* fix: make allow-always writeback more robust on windows

---------

Co-authored-by: clap [bot] <[email protected]>

* docs: tighten README and landing page voice (#274)

Co-authored-by: clap [bot] <[email protected]>

* chore: prepare v0.9.20 release notes (#276)

Co-authored-by: clap [bot] <[email protected]>

* docs: sync deployed landing page source with canonical page

---------

Co-authored-by: clap [bot] <[email protected]>
peg added a commit that referenced this pull request Apr 29, 2026
* release: v0.9.20 (#277)

* fix: harden agent integration checks (#261)

* fix: harden agent integration checks

* fix: require preload library before codex wrapper

* fix: make codex wrapper setup idempotent

* test: handle macos codex path canonicalization

* docs: align platform integration behavior

---------

Co-authored-by: clap [bot] <[email protected]>

* docs: polish integration platform guidance (#262)

Co-authored-by: clap [bot] <[email protected]>

* chore: prepare v0.9.19 release notes (#263)

Co-authored-by: clap [bot] <[email protected]>

* docs: refresh rampart landing page (#265)

* docs: refresh rampart landing page

* docs: deepen landing page SEO and visuals

* docs: overhaul landing page hero and sections

* docs: replace generated feature cards with product mechanics

* docs: soften landing page origin note

---------

Co-authored-by: clap [bot] <[email protected]>

* docs: update deployed landing page source on staging (#269)

Co-authored-by: clap [bot] <[email protected]>

* docs: polish rampart landing page (#270)

Co-authored-by: clap [bot] <[email protected]>

* fix: preserve modified built-in policy profiles (#273)

* fix: preserve modified built-in policy profiles

* fix: clarify built-in policy drift detection

---------

Co-authored-by: clap [bot] <[email protected]>

* fix: harden OpenClaw approval fallback behavior (#275)

* harden openclaw approval handling

* test: isolate proxy HOME state

* fix: make allow-always writeback more robust on windows

---------

Co-authored-by: clap [bot] <[email protected]>

* docs: tighten README and landing page voice (#274)

Co-authored-by: clap [bot] <[email protected]>

* chore: prepare v0.9.20 release notes (#276)

Co-authored-by: clap [bot] <[email protected]>

* docs: sync deployed landing page source with canonical page

---------

Co-authored-by: clap [bot] <[email protected]>

* fix: tighten openclaw setup trust signals

* test: cover openclaw plugin doctor warnings

* fix: tighten trust signals and self-mod policy

* docs: align OpenClaw approval guide

* docs: tidy support matrix placement

---------

Co-authored-by: clap [bot] <[email protected]>
peg added a commit that referenced this pull request Apr 29, 2026
* fix: harden agent integration checks (#261)

* fix: harden agent integration checks

* fix: require preload library before codex wrapper

* fix: make codex wrapper setup idempotent

* test: handle macos codex path canonicalization

* docs: align platform integration behavior

---------

Co-authored-by: clap [bot] <[email protected]>

* docs: polish integration platform guidance (#262)

Co-authored-by: clap [bot] <[email protected]>

* chore: prepare v0.9.19 release notes (#263)

Co-authored-by: clap [bot] <[email protected]>

* docs: refresh rampart landing page (#265)

* docs: refresh rampart landing page

* docs: deepen landing page SEO and visuals

* docs: overhaul landing page hero and sections

* docs: replace generated feature cards with product mechanics

* docs: soften landing page origin note

---------

Co-authored-by: clap [bot] <[email protected]>

* docs: update deployed landing page source on staging (#269)

Co-authored-by: clap [bot] <[email protected]>

* docs: polish rampart landing page (#270)

Co-authored-by: clap [bot] <[email protected]>

* fix: preserve modified built-in policy profiles (#273)

* fix: preserve modified built-in policy profiles

* fix: clarify built-in policy drift detection

---------

Co-authored-by: clap [bot] <[email protected]>

* fix: harden OpenClaw approval fallback behavior (#275)

* harden openclaw approval handling

* test: isolate proxy HOME state

* fix: make allow-always writeback more robust on windows

---------

Co-authored-by: clap [bot] <[email protected]>

* docs: tighten README and landing page voice (#274)

Co-authored-by: clap [bot] <[email protected]>

* chore: prepare v0.9.20 release notes (#276)

Co-authored-by: clap [bot] <[email protected]>

* docs: sync deployed landing page source with canonical page

* fix: tighten OpenClaw trust signals and setup coherence (#278)

* release: v0.9.20 (#277)

* fix: harden agent integration checks (#261)

* fix: harden agent integration checks

* fix: require preload library before codex wrapper

* fix: make codex wrapper setup idempotent

* test: handle macos codex path canonicalization

* docs: align platform integration behavior

---------

Co-authored-by: clap [bot] <[email protected]>

* docs: polish integration platform guidance (#262)

Co-authored-by: clap [bot] <[email protected]>

* chore: prepare v0.9.19 release notes (#263)

Co-authored-by: clap [bot] <[email protected]>

* docs: refresh rampart landing page (#265)

* docs: refresh rampart landing page

* docs: deepen landing page SEO and visuals

* docs: overhaul landing page hero and sections

* docs: replace generated feature cards with product mechanics

* docs: soften landing page origin note

---------

Co-authored-by: clap [bot] <[email protected]>

* docs: update deployed landing page source on staging (#269)

Co-authored-by: clap [bot] <[email protected]>

* docs: polish rampart landing page (#270)

Co-authored-by: clap [bot] <[email protected]>

* fix: preserve modified built-in policy profiles (#273)

* fix: preserve modified built-in policy profiles

* fix: clarify built-in policy drift detection

---------

Co-authored-by: clap [bot] <[email protected]>

* fix: harden OpenClaw approval fallback behavior (#275)

* harden openclaw approval handling

* test: isolate proxy HOME state

* fix: make allow-always writeback more robust on windows

---------

Co-authored-by: clap [bot] <[email protected]>

* docs: tighten README and landing page voice (#274)

Co-authored-by: clap [bot] <[email protected]>

* chore: prepare v0.9.20 release notes (#276)

Co-authored-by: clap [bot] <[email protected]>

* docs: sync deployed landing page source with canonical page

---------

Co-authored-by: clap [bot] <[email protected]>

* fix: tighten openclaw setup trust signals

* test: cover openclaw plugin doctor warnings

* fix: tighten trust signals and self-mod policy

* docs: align OpenClaw approval guide

* docs: tidy support matrix placement

---------

Co-authored-by: clap [bot] <[email protected]>

* chore: prepare v0.9.21 release notes (#279)

Co-authored-by: clap [bot] <[email protected]>

---------

Co-authored-by: clap [bot] <[email protected]>
peg added a commit that referenced this pull request Apr 30, 2026
* fix: harden agent integration checks (#261)

* fix: harden agent integration checks

* fix: require preload library before codex wrapper

* fix: make codex wrapper setup idempotent

* test: handle macos codex path canonicalization

* docs: align platform integration behavior

---------

Co-authored-by: clap [bot] <[email protected]>

* docs: polish integration platform guidance (#262)

Co-authored-by: clap [bot] <[email protected]>

* chore: prepare v0.9.19 release notes (#263)

Co-authored-by: clap [bot] <[email protected]>

* docs: refresh rampart landing page (#265)

* docs: refresh rampart landing page

* docs: deepen landing page SEO and visuals

* docs: overhaul landing page hero and sections

* docs: replace generated feature cards with product mechanics

* docs: soften landing page origin note

---------

Co-authored-by: clap [bot] <[email protected]>

* docs: update deployed landing page source on staging (#269)

Co-authored-by: clap [bot] <[email protected]>

* docs: polish rampart landing page (#270)

Co-authored-by: clap [bot] <[email protected]>

* fix: preserve modified built-in policy profiles (#273)

* fix: preserve modified built-in policy profiles

* fix: clarify built-in policy drift detection

---------

Co-authored-by: clap [bot] <[email protected]>

* fix: harden OpenClaw approval fallback behavior (#275)

* harden openclaw approval handling

* test: isolate proxy HOME state

* fix: make allow-always writeback more robust on windows

---------

Co-authored-by: clap [bot] <[email protected]>

* docs: tighten README and landing page voice (#274)

Co-authored-by: clap [bot] <[email protected]>

* chore: prepare v0.9.20 release notes (#276)

Co-authored-by: clap [bot] <[email protected]>

* docs: sync deployed landing page source with canonical page

* fix: tighten OpenClaw trust signals and setup coherence (#278)

* release: v0.9.20 (#277)

* fix: harden agent integration checks (#261)

* fix: harden agent integration checks

* fix: require preload library before codex wrapper

* fix: make codex wrapper setup idempotent

* test: handle macos codex path canonicalization

* docs: align platform integration behavior

---------

Co-authored-by: clap [bot] <[email protected]>

* docs: polish integration platform guidance (#262)

Co-authored-by: clap [bot] <[email protected]>

* chore: prepare v0.9.19 release notes (#263)

Co-authored-by: clap [bot] <[email protected]>

* docs: refresh rampart landing page (#265)

* docs: refresh rampart landing page

* docs: deepen landing page SEO and visuals

* docs: overhaul landing page hero and sections

* docs: replace generated feature cards with product mechanics

* docs: soften landing page origin note

---------

Co-authored-by: clap [bot] <[email protected]>

* docs: update deployed landing page source on staging (#269)

Co-authored-by: clap [bot] <[email protected]>

* docs: polish rampart landing page (#270)

Co-authored-by: clap [bot] <[email protected]>

* fix: preserve modified built-in policy profiles (#273)

* fix: preserve modified built-in policy profiles

* fix: clarify built-in policy drift detection

---------

Co-authored-by: clap [bot] <[email protected]>

* fix: harden OpenClaw approval fallback behavior (#275)

* harden openclaw approval handling

* test: isolate proxy HOME state

* fix: make allow-always writeback more robust on windows

---------

Co-authored-by: clap [bot] <[email protected]>

* docs: tighten README and landing page voice (#274)

Co-authored-by: clap [bot] <[email protected]>

* chore: prepare v0.9.20 release notes (#276)

Co-authored-by: clap [bot] <[email protected]>

* docs: sync deployed landing page source with canonical page

---------

Co-authored-by: clap [bot] <[email protected]>

* fix: tighten openclaw setup trust signals

* test: cover openclaw plugin doctor warnings

* fix: tighten trust signals and self-mod policy

* docs: align OpenClaw approval guide

* docs: tidy support matrix placement

---------

Co-authored-by: clap [bot] <[email protected]>

* chore: prepare v0.9.21 release notes (#279)

Co-authored-by: clap [bot] <[email protected]>

* fix: harden config resolution and hook approval integrity (#286)

* ci: migrate workflows to Node 24-safe actions

* fix: harden cli config resolution and hook failure handling

* test: harden config parsing and ask-failure regressions

* docs: polish config semantics and api override flows

* fix: finalize rc hardening and release polish

---------

Co-authored-by: clap [bot] <[email protected]>

---------

Co-authored-by: clap [bot] <[email protected]>
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