Skip to content

fix: require approval for delegated changes without effective authority - #196984

Merged
joshavant merged 3 commits into
mainfrom
security/delegated-administration-policy
Nov 11, 2026
Merged

joshavant merged 3 commits into
mainfrom
security/delegated-administration-policy

Conversation

@joshavant

@joshavant joshavant commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes automatic persistent OpenClaw changes when a Default run's effective authority is restricted or cannot be established.

User Impact

Delegated changes follow the selected permission mode and tools.openclaw.autoApproveChanges (with per-agent overrides):

Permission state Setting omitted false true
Explicit OpenClaw Full Access Automatic Exact approval Automatic
Default with established effective Full Access Automatic Exact approval Automatic
Default with restricted or unknown authority Exact approval Exact approval Automatic

Unknown Default native authority now requires approval unless an independent standing grant exists. Choose OpenClaw Full Access or configure autoApproveChanges: true to authorize future permitted delegated changes; allow-once applies only to the current proposal. A standing delegation grant does not enable denied direct tools or override containment, inherited authority, operation limits, or current-run validity. Broadening that grant requires exact approval or direct operator configuration.

Why This Change Was Made

Use the existing delegation and approval owners to check current authority at the point of effect. Only available, unrestricted Gateway execution establishes inferred Full Access; requested native modes and tool catalogs cannot establish effective authority. Permission labels use the same execution facts, and approval guidance explains the restriction and recovery controls.

The complete fix includes the runtime, harness, SDK and bridge consumers, configuration/help, labels, and boundary regressions. It adds no new profile or separate policy owner. The simplification pass retained one coherent authority correction and removed the previous settings-only authorization shortcut; the remaining growth supports the affected entry paths and distinct regression boundaries. Against the base, production changes are +469/−43 lines and test changes are +1192/−37 lines (net 1155 test lines).

The generated core config inventory increases by four entries: the global and per-agent openclaw namespace and autoApproveChanges boolean. The baseline increase records this intentional, documented standing-authority control; no unrelated config budget is added.

Evidence

  • 180 focused tests passed, including delegation, exact approval, revocation, caller context, affected consumers, and prompt-prefix stability. Focused lint, formatting, core/test type checks, docs validation and internal links passed.
  • Full build, SDK declarations/exports, package integrity and import-graph checks passed.
  • Real isolated Gateway proof passed eight scenarios; registered external CLI proof passed six. Live Claude Code 2.1.319 and Codex 0.164.0 each passed seven scenarios, including restricted Default approval, allow-once isolation, explicit Full Access, per-agent false, and standing grants with direct execution denied. This is bounded flow evidence, not certification of arbitrary native permission engines.
  • Fresh and published-stable-to-candidate package replacement passed on Linux and macOS arm64, including config preservation and eight delegated-effect scenarios per lane. Both artifacts identify as 2026.11.3; this was a distinct-artifact replacement, not a version-increasing upgrade.
  • Local autoreview covered the complete 37-path snapshot against base afa73f35c911300fb096043e713dc393ff2b7a32: Codex GPT-6.1 Sol, P0–P2, complete and scoped-clean with no actionable findings. Two generated config-baseline files and one export-preserving test-mock repair were subsequently added without runtime changes; the repaired suite passes all 37 tests, scoped type/lint/format checks, and the mock-export guard. Local ClawSweeper was unavailable; hosted review is requested through the normal ready-for-review flow.
  • Windows runtime proof remains unperformed because suitable verified test media was unavailable. Three nonfatal UI asset-budget warnings matched the unchanged base byte-for-byte; no budgets were changed.

Persistent-writer follow-up

The real Gateway regression found a retained-reader gap during revocation: an admitted config copy could match the active runtime values and resolution provenance while carrying a different origin object. The existing reader now binds equivalent active-runtime copies as well as authored-source matches. Scoped configs and differing resolution provenance remain separate; no policy owner or production test hook was added.

The test first permits a real persistent write, then pauses a second proposal before its writer reads/prepares the base snapshot. An operator revokes standing authority through config.patch and waits for live publication before the writer resumes. The rejected operation must leave the post-revocation config byte-identical and report the false policy. Unchanged d1d3864 failed by persisting the forbidden value. AWS reproduced that effect with old reader behavior, restored the candidate source, and passed all 115 focused tests in five files. The final fixture signature is also checked independently. The followup adds exactly 186 net test LF lines; the shared scalar is unchanged. Local ratchet measurement reports seven lines of inherited debt beyond the branch's exact allocation.

Local autoreview of the followup delta against d1d386499328591a8711ba4f08cdf4d926d55e0a completed through P2 with no actionable findings. A subsequent fixture-only type correction makes the unused restart-recovery callback synchronous. Focused Gateway/config type graphs, lint and format passed. Independent SecOps review of SECURITY.md remains requested and pending.

Sanitized evidence is directly inspectable in the live/native/package/config-preservation record and persistent-writer revocation record. The older package artifacts retain their original source binding; they do not contain this later reader correction.

CI follow-up

The current-head CI run is complete for head e24c54fb2919594b2f4be2a3bc2c630043fff336, tested as merge b3955965330dc8d48523753064dbd9caf3609a68 against main c719f9e11a1063528e16b71bef200feb682941bd: 76 jobs passed, 26 skipped, three test jobs failed, and the aggregate CI gate failed. Build artifacts, baseline ratchets and the test-line budget passed. CI is not green.

The three test failures are source-attributed to existing main behavior; no branch-caused failure remains identified:

Failed job Observed failure Attribution
UI E2E 1/3 Agent-default click and screen-routing timeouts Main commit 086d2574a92 requires advertised agent/tools/config read methods that these fixtures omit. The entire UI tree is identical between the tested merge and its main parent; the access owner and fixtures match the previously captured denial failures.
Node compact-small-27-1 Telegram loopback expects spaced JSON, receives compact JSON Test and serializer match both PR base and tested main. Existing commit 3d6699cb9d9 changed formatting; the unchanged assertion still requires whitespace. Retained focused replay reproduces the mismatch.
Node compact-small-27-2 Two provider-auth fixture failures in model-auth.profiles.test.ts Tests and implicated auth/provider owners match both PR base and tested main. Candidate-reader and exact old-reader controls each reproduce the same two failures and 36 passes. The closed provider mock lacks resolveActivatableProviderOwnerPluginIds; matching-credential selection also fails. This is a reader-delta control, not a whole-repository baseline run.

These are failed checks, not passing proof. Source and captured failure evidence provide attribution where the CI helper has no comparable main job. No CI rerun was requested merely to obtain green.

The initial CI run also found a branch-caused incomplete mock in tool-resolution.exclude.test.ts; that fixture was repaired to preserve real exports while retaining synthetic executor overrides, and the obsolete mock-baseline exception was removed. Its focused 37-test suite, type/lint/format checks and mock-export guard passed.

Current hosted review

ClawSweeper revision 2 reviewed head e24c54fb2919594b2f4be2a3bc2c630043fff336 with no actionable code findings. It accepted the real persistent-writer revocation and source-bound live/native/package evidence, resolving the prior proof requests. Independent current-head SecOps approval of SECURITY.md and satisfaction of the CI gate or an authorized inherited-failure exception remain before landing. This PR has not been merged.

@clawsweeper

clawsweeper Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@joshavant
joshavant marked this pull request as ready for review November 11, 2026 02:24
@joshavant
joshavant requested a review from a team as a code owner November 11, 2026 02:24
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime security Security documentation agents Agent runtime and tooling size: XL labels Nov 11, 2026
@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components.

No secops approval is required. This comment is informational because the PR author has Maintain or Admin access.

  • Current SHA: e24c54fb2919594b2f4be2a3bc2c630043fff336
  • Maintainer: @joshavant
  • Repository role: admin

These security sensitive changes were made:

  • src/agents/execution-authority.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.

Carefully review these changes before merging.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 11, 2026
@joshavant

Copy link
Copy Markdown
Collaborator Author

@clawsweeper explain

@clawsweeper

clawsweeper Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

ClawSweeper status:

  • Current PR: 196984
  • Branch: security/delegated-administration-policy
  • Checks: SUCCESS:75 SKIPPED:50 FAILURE:2 IN_PROGRESS:1 PENDING:1 NEUTRAL:1
  • Check blockers: checks-ui-e2e (1/2):FAILURE, checks-node-changed-1:IN_PROGRESS, checks-node-changed-compact-small-26:FAILURE, openclaw/ci-gate:PENDING

@clawsweeper

clawsweeper Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

This PR requires current execution authority or an explicit standing grant for automatic delegated changes and adds global and per-agent approval controls.

Example: A Default agent with exec denied requests logging.level = warn.

  • Before: Full/off exec settings could authorize the persistent change automatically despite exec being unavailable.
  • After: The proposal requires exact approval unless an independent standing delegation grant authorizes it.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful authority repair with source-bound behavioral and compatibility evidence and no actionable code findings; required security review and the failed CI gate remain landing constraints.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): Source-bound installed Gateway, native Claude/Codex, and registered CLI results show permitted writes and denied proposals preserving configuration. The final reader correction has a real Gateway-to-writer revocation run: an allowed write succeeds, config.patch revokes authority before writer preparation, rejection preserves post-revocation bytes, and restoring the old reader reproduces the forbidden write. Both previous rank-up requests are satisfied; historical screenshots are not counted as current proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A restricted or unverified Default run can make persistent administrative changes without an operator decision.
Reason: The maintainer-authored direction corrects a concrete authority gap and explicitly owns the new standing-grant control and its security tradeoff.

Merge readiness

⛔ Blocked before merge - 1 item remains

This PR addresses an authority gap still present on main; no introduced correctness defect was found, and the new evidence resolves the previous proof requests.

Priority: P1
Reviewed head: e24c54fb2919594b2f4be2a3bc2c630043fff336

Before merge

  • Await maintainer action - Obtain independent current-head SecOps approval for SECURITY.md and satisfy the required CI gate or an authorized inherited-failure exception before landing.

Findings

None.

Agent review details

How this fits together

Agent tool assembly supplies host-owned caller authority to the Gateway approval owner, which authorizes an exact system-agent proposal and rechecks authority through the persistent writer.

flowchart TD
A[Agent tool assembly] --> B[Host caller authority]
B --> C[Gateway approval owner]
D[Live configuration] --> B
C --> E[Exact human approval]
C --> F[System agent executor]
E --> F
F --> G[Persistent config writer]
B --> G
Loading

Technical review

Best possible solution:

Retain the existing approval and writer owners with live delegation checks, exact approval for grant expansion, and documented independent standing authority.

Do we have a high-confidence way to reproduce the issue?

Current-main source establishes the settings-only authorization path, and the published negative control shows the old reader persisting logging.level = error after revocation; no target code was executed during this review.

Is this the best way to solve the issue?

The patch repairs authority at the existing delegation and persistent-effect boundaries, preserves exact human approval, and uses one shared execution predicate rather than another executor.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against ec1549a15e36.

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

PR surface

Source +426, Tests +1155, Docs +95, Generated 0, Other +1. Total +1677 across 44 files. Added test files: 2.

View PR surface stats
Area Files Added Removed Net
Source 19 469 43 +426
Tests 15 1192 37 +1155
Docs 6 110 15 +95
Config 0 0 0 0
Generated 2 3 3 0
Other 2 2 1 +1
Total 44 1776 99 +1677

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Standing delegation control One optional boolean at global and per-agent scope autoApproveChanges adds an explicit authorization control; omission preserves automatic behavior only where independent authority is established.

Labels

Label changes:

  • add P1: Current main can automatically persist delegated changes despite unavailable or restricted effective execution authority.
  • add merge-risk: 🚨 compatibility: Default native and SDK callers with unknown authority now require exact approval; the maintainer-authored direction documents explicit Full Access and standing grants as recovery controls.
  • add merge-risk: 🚨 security-boundary: The patch changes standing administrative authority and its revocation checks; its documented direct-tool independence is an accepted maintainer direction, with SecOps review still required.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: ⏳ waiting on maintainer: Only explicit maintainer approvals or decisions remain; merge is still blocked.

Label justifications:

  • P1: Current main can automatically persist delegated changes despite unavailable or restricted effective execution authority.
  • merge-risk: 🚨 compatibility: Default native and SDK callers with unknown authority now require exact approval; the maintainer-authored direction documents explicit Full Access and standing grants as recovery controls.
  • merge-risk: 🚨 security-boundary: The patch changes standing administrative authority and its revocation checks; its documented direct-tool independence is an accepted maintainer direction, with SecOps review still required.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: ⏳ waiting on maintainer: Only explicit maintainer approvals or decisions remain; merge is still blocked.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-11-11T02:55:48.040Z sha d1d3864 :: needs real behavior proof before merge. :: none

Reviewed November 10, 2026, 10:40 PM ET / November 11, 2026, 03:40 UTC (Revision 2).

@joshavant

Copy link
Copy Markdown
Collaborator Author

Inspectable delegated-administration validation evidence

This republishes sanitized observed results from the completed isolated runs. It adds no new execution claim. The JSON below is an allowlisted projection of captured results: host paths, device/session identifiers, transcripts, environment values and credentials are omitted. The package effects were checked from persistent configuration, rather than inferred from model replies.

Source and artifact binding

All 37 frozen source paths match commit c2eab8082c4db9e17a8042a789437e036b932e3e byte-for-byte. Their sorted-map SHA256 is 01228ee9f35db09450aeff4196622bf0faaabe961f9e62a086a160ae8c0bb763; the full file map is below. The proof was executed from base afa73f35c911300fb096043e713dc393ff2b7a32 plus those frozen changes. Commit d1d386499328591a8711ba4f08cdf4d926d55e0a subsequently repaired a closed test mock, removed its obsolete mock-export exception and increased the regression-test allocation from 968 to 969. It changed no runtime source; 36 of 37 original frozen paths remain exact, with only that allocation differing.

Candidate package SHA256: 4731603560f3616a923f8b2765278116264ab630ab54b01da62441d75a400857 (117,873,704 bytes). Published baseline SHA256: dae4c4f7549561db2fe5ac43af7ba0c9491f876380f070f7ffb87bf9721a10df. Both say 2026.11.3: this proves replacement between distinct same-version artifacts, not a version-increasing upgrade or a shipped fixed release. Canonical package integrity/import checks passed.

Installed Gateway and persistent effects

Linux AWS and macOS arm64 UTM each passed fresh installation and published-stable-to-candidate replacement. Both replacement lanes preserved existing config bytes exactly. Candidate omitted/true/false/unset round trips and validation passed, with Gateway health/readiness successful. Linux replacement preserved config SHA256 252b6320b9b3fb6b4de33c50a432dacdb97ee543462b3aa0163f6870405e3c86.

Every lane exercised the following eight effects through the installed Gateway, agent runner, approval owner and persistent writer. Only model Responses HTTP was synthetic. The owner connection was normally paired and signed, held admin authority, and remained live. The permanent source test is system-agent-delegation-authority.e2e.test.ts.

Scenario (in sequence) Decision Observed persisted logging
Restricted Default, setting omitted Exact allow-once warn
Established unrestricted Default, editing tools denied Automatic debug
Explicit OpenClaw Full Access, direct exec denied Automatic error
Standing autoApproveChanges: true, direct exec denied Automatic info
false overrides Full Access Exact deny stays info
Execution on a node does not establish Gateway authority Exact deny stays info
Parent-object expansion of another agent's grant Exact allow-once stays info; exact target grant becomes true
Revoke own standing grant Automatic stays info; own grant becomes false

Pending exact approvals left logging and the target standing grant unchanged. Four distinct exact decisions were observed per lane. These self-revocation scenarios do not establish revocation during another operation's preparation; that is separate proof.

Native and externally registered CLI flows

Backend Observed result Real boundary exercised
Codex 0.164.0 Seven scenarios passed, five distinct exact decisions Real OpenAI API, native runtime and delegated helper, owner approvals, whole-config comparisons and persistent writes
Claude Code 2.1.319 Seven scenarios passed, five distinct exact decisions Real native model/helper, managed exec denial, owner approvals and persistent writes
Registered CLI child Six scenarios passed Plugin registration, actual child execution, scoped MCP bridge, available/denied exec effects, owner approvals and persistent writes; helper-model HTTP synthetic

The nearest allowed/forbidden Claude pair is concrete: managed exec denial plus Default/omitted requested warn → error, exact deny retained warn; a fresh exact allow-once persisted error; the next request again required approval and denial retained error. The same managed exec denial with the independent standing grant persisted info → warn automatically while the direct-exec marker stayed absent. Explicit OpenClaw Full Access also permitted delegation without enabling the denied tool.

Codex Default/omitted required exact allow-once for info → warn, and the next proposal's denial retained warn. Explicit Full Access and Default/true completed automatically; false still required approval. A broadening proposal under Full Access was denied without altering the grant, then a fresh exact allow-once changed only that target grant. Pending/final whole-config assertions protected unrelated configuration.

The external child actually executed and host-mediated exec worked where allowed, yet neither backend self-report nor that mediated tool independently authorized automatic Default delegation. Exact denials preserved error. Operator true and explicit OpenClaw Full Access completed without redundant delegation approval. Its passing replay test SHA256 is e11020050be9728bccd069020f2c75b165915a7089a9db827593235c7b3c3238; captured result: one test passed, 24,672 ms execution.

Execution receipts and limits

These run links identify the captured AWS executions; the sanitized results below are included directly so inspection does not depend on portal access:

macOS proof ran on an isolated macOS 27.2.1 (26B131) arm64 VM with Node 24.22.1. Its initial driver hit kill EPERM during a negative process-group check after replacement readiness. Process/listener inspection established no runtime remained, and the unfinished replacement scenarios were resumed on the retained installation using the unchanged cleared fixture. Final results and task-only cleanup passed. This setup failure is retained as a limitation of the harness, not presented as a product pass.

Windows remains untested. macOS results cover packaged CLI/Gateway, not native-app TCC/signing or Codex/Claude on macOS. These bounded versions and direct-tool/managed-policy cases do not certify arbitrary native policy engines. Unknown Default native authority without an independent grant still requires approval. All task-owned AWS/UTM resources and isolated native policy/state for these runs were cleaned.

Sanitized captured results and full frozen source hash map
{
  "scope": "Sanitized observed results from completed isolated proof. No new tests were executed to prepare this publication.",
  "source": {
    "proofBaseHead": "afa73f35c911300fb096043e713dc393ff2b7a32",
    "frozenChangedPathCount": 37,
    "frozenChangedPathFingerprint": "01228ee9f35db09450aeff4196622bf0faaabe961f9e62a086a160ae8c0bb763",
    "fingerprintAlgorithm": "sha256(canonical compact sorted-key JSON of sha256 map)",
    "publicationHead": "d1d386499328591a8711ba4f08cdf4d926d55e0a",
    "currentMatch": "36 of 37 frozen paths byte-identical; the only difference is regression-test allocation 968 to 969. Three-path final commit only repairs a test mock, removes its obsolete mock-export exception and updates that allocation. No production runtime source changed.",
    "frozenPathSha256": {
      "SECURITY.md": "daefeaf9c585716faaa8faf5eabe0a2968a630870e6e815fcee7fd43cd0bb75a",
      "config/test-lines-allocations/delegated-administration-policy.txt": "93d3681329edb640b10dc2fdc69d4811d243a9bd03cc8fbb3f48ec425133a396",
      "docs/cli/openclaw.md": "0f0f99ded179f47140a74001fe33d549b75278bb593d808060a156a43589e7d7",
      "docs/gateway/config-tools.md": "480a5f629e20989dc547f16d676d5c445e8e3a30250c3b6f87d1bb4e390d87d9",
      "docs/gateway/config-tools/built-in-tools.md": "6d5ce083ede95dc05772a77703a20181c28e012046762acb3f99e601d880480d",
      "docs/gateway/permission-modes.md": "b4b594bd39cf5c82f814f52ada8374198acebba25f675e63390c895846986925",
      "docs/gateway/security/tool-permissions.md": "b48a92a7b0d359527d0fdac0c36f71df48fd05b86b705ca190d433559ac71f3f",
      "src/agents/agent-tools.assembly.ts": "9c25ad3f8a6f82f896649fcc82bd4d56d6e1ae17330f051a5e09bb594a37d513",
      "src/agents/agent-tools.async.ts": "85d8b6185fc59ec09b6477fea5741c490a0bc3935e7d6d99c626e240152ab555",
      "src/agents/agent-tools.options.ts": "6834cd18eac794d6ee597ea79dc58f2ac631c8441332254b70e44621a85c7094",
      "src/agents/agent-tools.ts": "1171422f70a0f3cf3220d97a4cdd94cb9bd3b42b2ffeb35beba732b6e853c55b",
      "src/agents/exec-defaults.preparation.ts": "395789508c8e1f856cbc5527f9a0a588e6f8ac8cbbf070cc7f81d5933ec15455",
      "src/agents/execution-authority.ts": "1b08b4ebf0d3879f3f872cba55b21f68a29775c96f5670646c9a11c0d2f8c36c",
      "src/agents/harness/host-capability.ts": "c05a0c61e1f4f2fb3e8acdf7c8861e4184af45410667fbc25bfe1961904cddfc",
      "src/agents/openclaw-tools.types.ts": "59eebcda77cd3f9f62e31a382983250adf17925baf624d0d5f54580e75d1d4a9",
      "src/agents/tools/gateway-caller-context.test.ts": "67db979adbfec339b465fca881b50c698b163feeefb2edfc33e201891ceb7353",
      "src/agents/tools/gateway-caller-context.ts": "785210a1049bbc2674b93cdd69c730e1e52b0747c86594cc780ba430d429cec4",
      "src/agents/tools/gateway-caller-context.types.ts": "b6b11b0d37bb48c1fd853503a0ed58fce70cf40f34abdeb49b76699b55d186c3",
      "src/agents/tools/openclaw-delegate-tool.exec-preparation.test.ts": "a476add6de710c029fff67ec84b1f2d9ca5913364bf38d2f8911df32f1201213",
      "src/agents/tools/openclaw-delegate-tool.test.ts": "c6476a5357ea8c98470010796cbd11439ec5a37ccea4e6ebbed954c1d16ff31c",
      "src/agents/tools/openclaw-delegate-tool.ts": "9f6d1a71268a8995dd728f55c3ed7d8e8148c41ae6184867c9e6ea8ff108b085",
      "src/config/schema.help.runtime.ts": "e338a9a402482bcaef934d55d86e48bbf7618b9b23ad174750e526e32e467a22",
      "src/config/schema.labels.ts": "78890214c254a719f2c862de1548c5ac63bf201e7649ab2883e1bf10cfd31f7b",
      "src/config/zod-schema.agent-runtime.ts": "df0b6b5af0a2ccfe790fd85828ae918ec13a665970be0b33c74b03624c2006ee",
      "src/config/zod-schema.agents.test.ts": "0050e8c67e14fae5d8a12382941911f84eeb71c35cd55e316e5de4a994d31aa0",
      "src/gateway/mcp-http.test-support.ts": "5e13b6806213b777024babea85068f740744e06993b7aa8d610d55f6ec6865e3",
      "src/gateway/server-methods/system-agent-approval-authority.test.ts": "fdd71e0b13f5fb14b8e5a900a078c69d0e80a4c437b11e11b65434609a7dfe60",
      "src/gateway/server-methods/system-agent-approval.test.ts": "ab3155445c56434540e4e75b79f6863db1b8fc088c34b7904eec6b7ee5dba4df",
      "src/gateway/server-methods/system-agent-approval.ts": "cb4616208e46241abdb58be18665cec2354454fc9dfc63190e45ebc5ba504b40",
      "src/gateway/server-methods/system-agent-owner-write.integration.test.ts": "7b1220ad604d6b53e318cf14cc7d03fcd4f7e909b4cfe9c8896ab8653fb36d9b",
      "src/gateway/server-methods/system-agent.host-lifecycle.test.ts": "4c02e63cf4d7b4f50b44b69967c0a55033aac0c13c4a53fd1d455298b767ea5c",
      "src/gateway/session-utils-store.ts": "41edf67505943f2e213cc99cf7ed1a03101eda9266078a1a6729cabecab06af7",
      "src/gateway/session-utils.permissions.test.ts": "2920f7cab1b4375eaba49b62c8f0a86af723b1dc3cd010d7d3ddda159af71760",
      "src/gateway/tool-resolution.effects.test-support.ts": "4f5ee7adb444ea298e9412ac20ede4e115beb716f0e8f86939e932fa60ebecce",
      "src/gateway/tool-resolution.ts": "2cb8bad568af25bebabe02bee52a3da233b2149be614a139d20f13c453f13932",
      "src/system-agent/delegated-change-policy.ts": "cb43fc95fc76ca4b09f35d3266f4185d64ae5ca2438183553d2044380068b7c7",
      "test/system-agent-delegation-authority.e2e.test.ts": "4ceedba598419a78298a48c38b1b1bbdcf1f33ba57e81885ed3349e0528aa76c"
    }
  },
  "packageIdentity": {
    "version": "2026.11.3",
    "candidateSha256": "4731603560f3616a923f8b2765278116264ab630ab54b01da62441d75a400857",
    "candidateBytes": 117873704,
    "publishedStableSha256": "dae4c4f7549561db2fe5ac43af7ba0c9491f876380f070f7ffb87bf9721a10df",
    "comparison": "Distinct artifacts with the same version; not a version-increasing upgrade or a shipped-fixed-release claim.",
    "canonicalPackageIntegrity": "passed",
    "portableFixtureSha256": "273c060b683a2dc7ec44ce2398b2a195695281599a0cc702812890274759932f"
  },
  "linuxInstallation": {
    "result": "passed",
    "node": "24.22.1",
    "lanes": [
      {
        "name": "fresh",
        "healthz": 200,
        "readyz": 200,
        "settingRoundtrip": [
          "omitted",
          "true",
          "false",
          "unset"
        ]
      },
      {
        "name": "replacement",
        "healthz": 200,
        "readyz": 200,
        "settingRoundtrip": [
          "omitted",
          "true",
          "false",
          "unset"
        ],
        "existingConfigByteExact": true,
        "preservedConfigSha256": "252b6320b9b3fb6b4de33c50a432dacdb97ee543462b3aa0163f6870405e3c86"
      }
    ]
  },
  "macosInstallation": {
    "result": "passed",
    "os": "macOS 27.2.1 (26B131)",
    "arch": "arm64",
    "node": "v24.22.1",
    "lanes": [
      {
        "name": "fresh",
        "result": "passed",
        "settingRoundtrip": [
          "omitted",
          "true",
          "false",
          "unset"
        ],
        "candidateGatewayReady": true
      },
      {
        "name": "replacement",
        "result": "passed",
        "baselineGatewayReady": true,
        "byteExactConfigPreserved": true,
        "settingRoundtrip": [
          "omitted",
          "true",
          "false",
          "unset"
        ],
        "candidateGatewayReady": true
      }
    ],
    "recovery": "Initial driver hit kill EPERM on a negative process-group probe after replacement readiness. Guest process/listener checks showed no runtime remained; only unfinished replacement behavior was resumed on the retained candidate. Both lanes and final task-only cleanup passed."
  },
  "installedPersistentEffects": [
    {
      "platform": "linux",
      "lane": "fresh",
      "result": "passed",
      "scenarios": [
        {
          "name": "restricted default",
          "decision": "allow-once",
          "expectedLogging": "warn",
          "persistedLogging": "warn"
        },
        {
          "name": "unrestricted default with edit denied",
          "decision": "automatic",
          "expectedLogging": "debug",
          "persistedLogging": "debug"
        },
        {
          "name": "explicit full with exec denied",
          "decision": "automatic",
          "expectedLogging": "error",
          "persistedLogging": "error"
        },
        {
          "name": "standing delegation grant",
          "decision": "automatic",
          "expectedLogging": "info",
          "persistedLogging": "info"
        },
        {
          "name": "explicit off overrides full",
          "decision": "deny",
          "expectedLogging": "info",
          "persistedLogging": "info"
        },
        {
          "name": "node execution does not authorize Gateway changes",
          "decision": "deny",
          "expectedLogging": "info",
          "persistedLogging": "info"
        },
        {
          "name": "grant expansion through a parent config object",
          "decision": "allow-once",
          "expectedLogging": "info",
          "persistedLogging": "info"
        },
        {
          "name": "revoking its own standing grant",
          "decision": "automatic",
          "expectedLogging": "info",
          "persistedLogging": "info"
        }
      ]
    },
    {
      "platform": "linux",
      "lane": "replacement",
      "result": "passed",
      "scenarios": [
        {
          "name": "restricted default",
          "decision": "allow-once",
          "expectedLogging": "warn",
          "persistedLogging": "warn"
        },
        {
          "name": "unrestricted default with edit denied",
          "decision": "automatic",
          "expectedLogging": "debug",
          "persistedLogging": "debug"
        },
        {
          "name": "explicit full with exec denied",
          "decision": "automatic",
          "expectedLogging": "error",
          "persistedLogging": "error"
        },
        {
          "name": "standing delegation grant",
          "decision": "automatic",
          "expectedLogging": "info",
          "persistedLogging": "info"
        },
        {
          "name": "explicit off overrides full",
          "decision": "deny",
          "expectedLogging": "info",
          "persistedLogging": "info"
        },
        {
          "name": "node execution does not authorize Gateway changes",
          "decision": "deny",
          "expectedLogging": "info",
          "persistedLogging": "info"
        },
        {
          "name": "grant expansion through a parent config object",
          "decision": "allow-once",
          "expectedLogging": "info",
          "persistedLogging": "info"
        },
        {
          "name": "revoking its own standing grant",
          "decision": "automatic",
          "expectedLogging": "info",
          "persistedLogging": "info"
        }
      ]
    },
    {
      "platform": "macos",
      "lane": "fresh",
      "result": "passed",
      "scenarios": [
        {
          "name": "restricted default exact allow-once",
          "decision": "allow-once",
          "persistedLogging": "warn"
        },
        {
          "name": "unrestricted default edit denied",
          "decision": "automatic",
          "persistedLogging": "debug"
        },
        {
          "name": "explicit full exec denied",
          "decision": "automatic",
          "persistedLogging": "error"
        },
        {
          "name": "standing grant exec denied",
          "decision": "automatic",
          "persistedLogging": "info"
        },
        {
          "name": "false overrides full exact deny",
          "decision": "deny",
          "persistedLogging": "info"
        },
        {
          "name": "node execution exact deny",
          "decision": "deny",
          "persistedLogging": "info"
        },
        {
          "name": "parent-object grant expansion exact allow-once",
          "decision": "allow-once",
          "persistedLogging": "info"
        },
        {
          "name": "self-revocation automatic",
          "decision": "automatic",
          "persistedLogging": "info"
        }
      ]
    },
    {
      "platform": "macos",
      "lane": "replacement",
      "result": "passed",
      "scenarios": [
        {
          "name": "restricted default exact allow-once",
          "decision": "allow-once",
          "persistedLogging": "warn"
        },
        {
          "name": "unrestricted default edit denied",
          "decision": "automatic",
          "persistedLogging": "debug"
        },
        {
          "name": "explicit full exec denied",
          "decision": "automatic",
          "persistedLogging": "error"
        },
        {
          "name": "standing grant exec denied",
          "decision": "automatic",
          "persistedLogging": "info"
        },
        {
          "name": "false overrides full exact deny",
          "decision": "deny",
          "persistedLogging": "info"
        },
        {
          "name": "node execution exact deny",
          "decision": "deny",
          "persistedLogging": "info"
        },
        {
          "name": "parent-object grant expansion exact allow-once",
          "decision": "allow-once",
          "persistedLogging": "info"
        },
        {
          "name": "self-revocation automatic",
          "decision": "automatic",
          "persistedLogging": "info"
        }
      ]
    }
  ],
  "nativeCodex": {
    "result": "passed",
    "version": "0.164.0",
    "models": "Real OpenAI API and real delegated helper; no synthetic model responses.",
    "uniqueExactDecisions": 5,
    "wholeConfigAssertions": "Pending approval preserved entire config; each final state compared against the entire previous config with only the explicitly allowed target changed.",
    "scenarios": [
      {
        "name": "default-omitted-allow-once",
        "permissionMode": "default",
        "decision": "allow-once",
        "delegatedApprovalCount": 1,
        "target": "logging.level",
        "requestedValue": "warn",
        "persistedLevel": "warn",
        "offGrant": false,
        "directHostExec": "allowed",
        "hostExecMarkerPresent": true,
        "confirmedToolResult": true
      },
      {
        "name": "default-next-proposal-denied",
        "permissionMode": "default",
        "decision": "deny",
        "delegatedApprovalCount": 1,
        "target": "logging.level",
        "requestedValue": "trace",
        "persistedLevel": "warn",
        "offGrant": false,
        "confirmedToolResult": true
      },
      {
        "name": "explicit-full-automatic",
        "permissionMode": "full",
        "decision": "automatic",
        "delegatedApprovalCount": 0,
        "target": "logging.level",
        "requestedValue": "error",
        "persistedLevel": "error",
        "offGrant": false,
        "confirmedToolResult": true
      },
      {
        "name": "false-overrides-explicit-full",
        "permissionMode": "full",
        "decision": "allow-once",
        "delegatedApprovalCount": 1,
        "target": "logging.level",
        "requestedValue": "info",
        "persistedLevel": "info",
        "offGrant": false,
        "confirmedToolResult": true
      },
      {
        "name": "standing-true-with-denied-direct-exec",
        "permissionMode": "default",
        "decision": "automatic",
        "delegatedApprovalCount": 0,
        "target": "logging.level",
        "requestedValue": "debug",
        "persistedLevel": "debug",
        "offGrant": false,
        "directHostExec": "denied",
        "hostExecMarkerPresent": false,
        "confirmedToolResult": true
      },
      {
        "name": "grant-broadening-denied-despite-full",
        "permissionMode": "full",
        "decision": "deny",
        "delegatedApprovalCount": 1,
        "target": "agents.entries.off.tools.openclaw.autoApproveChanges",
        "requestedValue": "true",
        "persistedLevel": "debug",
        "offGrant": false,
        "confirmedToolResult": true
      },
      {
        "name": "grant-broadening-fresh-exact-allow",
        "permissionMode": "full",
        "decision": "allow-once",
        "delegatedApprovalCount": 1,
        "target": "agents.entries.off.tools.openclaw.autoApproveChanges",
        "requestedValue": "true",
        "persistedLevel": "debug",
        "offGrant": true,
        "confirmedToolResult": true
      }
    ]
  },
  "nativeClaude": {
    "result": "passed",
    "version": "2.1.319 (Claude Code)",
    "models": "Real Claude API and delegated helper.",
    "uniqueExactDecisions": 5,
    "restrictedDefaultInvariantSatisfied": true,
    "scenarios": [
      {
        "scenario": "unknown-default-allow",
        "permissionMode": "default",
        "managedExecDenyActive": false,
        "execMarkerPresent": true,
        "delegatedApproval": true,
        "decision": "allow-once",
        "confirmedToolResult": true,
        "previousLevel": "info",
        "requestedLevel": "warn",
        "persistedLevel": "warn",
        "standingPolicyUnchanged": true
      },
      {
        "scenario": "managed-deny-default-reject",
        "permissionMode": "default",
        "managedExecDenyActive": true,
        "execMarkerPresent": false,
        "delegatedApproval": true,
        "decision": "deny",
        "confirmedToolResult": true,
        "previousLevel": "warn",
        "requestedLevel": "error",
        "persistedLevel": "warn",
        "standingPolicyUnchanged": true
      },
      {
        "scenario": "managed-deny-fresh-allow-once",
        "permissionMode": "default",
        "managedExecDenyActive": true,
        "execMarkerPresent": false,
        "delegatedApproval": true,
        "decision": "allow-once",
        "confirmedToolResult": true,
        "previousLevel": "warn",
        "requestedLevel": "error",
        "persistedLevel": "error",
        "standingPolicyUnchanged": true
      },
      {
        "scenario": "managed-deny-allow-once-not-standing",
        "permissionMode": "default",
        "managedExecDenyActive": true,
        "execMarkerPresent": false,
        "delegatedApproval": true,
        "decision": "deny",
        "confirmedToolResult": true,
        "previousLevel": "error",
        "requestedLevel": "trace",
        "persistedLevel": "error",
        "standingPolicyUnchanged": true
      },
      {
        "scenario": "explicit-full-independent-grant",
        "permissionMode": "full",
        "managedExecDenyActive": true,
        "execMarkerPresent": false,
        "delegatedApproval": false,
        "decision": "automatic",
        "confirmedToolResult": true,
        "previousLevel": "error",
        "requestedLevel": "debug",
        "persistedLevel": "debug",
        "standingPolicyUnchanged": true
      },
      {
        "scenario": "explicit-false-overrides-full",
        "permissionMode": "full",
        "managedExecDenyActive": false,
        "execMarkerPresent": true,
        "delegatedApproval": true,
        "decision": "allow-once",
        "confirmedToolResult": true,
        "previousLevel": "debug",
        "requestedLevel": "info",
        "persistedLevel": "info",
        "standingPolicyUnchanged": true
      },
      {
        "scenario": "standing-true-with-managed-deny",
        "permissionMode": "default",
        "managedExecDenyActive": true,
        "execMarkerPresent": false,
        "delegatedApproval": false,
        "decision": "automatic",
        "confirmedToolResult": true,
        "previousLevel": "info",
        "requestedLevel": "warn",
        "persistedLevel": "warn",
        "standingPolicyUnchanged": true
      }
    ]
  },
  "externalCli": {
    "result": "passed",
    "scenarioCount": 6,
    "executedTestSha256": "e11020050be9728bccd069020f2c75b165915a7089a9db827593235c7b3c3238",
    "runtime": "Real plugin registration, child process, scoped MCP bridge, tool effects, approval owner and persistent writer; synthetic helper model HTTP.",
    "observedByPassingAssertions": [
      {
        "name": "backend self-report",
        "decision": "allow-once",
        "persistedLogging": "debug"
      },
      {
        "name": "mediated exec does not certify native authority",
        "decision": "allow-once",
        "persistedLogging": "error"
      },
      {
        "name": "denied exec",
        "decision": "deny",
        "persistedLogging": "error"
      },
      {
        "name": "false overrides Full Access",
        "decision": "deny",
        "persistedLogging": "error"
      },
      {
        "name": "operator true",
        "decision": "automatic",
        "persistedLogging": "info"
      },
      {
        "name": "explicit Full Access",
        "decision": "automatic",
        "persistedLogging": "warn"
      }
    ],
    "successLogExcerpt": "observes external CLI delegated authority through registration, child execution, MCP, and persistence: passed (24672 ms); Test Files 1 passed; Tests 1 passed."
  },
  "limitations": [
    "This existing proof does not demonstrate revocation during preparation at the real persistent writer; that is a separate new proof task.",
    "Windows untested: no suitable licensed/verified media or disposable VM was available.",
    "macOS proof covers installed CLI/Gateway, not native-app TCC/signing or native Codex/Claude on macOS.",
    "Backend versions, managed-policy cases and direct-tool effects are bounded evidence, not general native-policy certification."
  ],
  "cleanup": "All task-owned AWS and UTM resources for these completed runs were released; isolated native policy/config and test state cleaned."
}

@joshavant

joshavant commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator Author

Followup head: e24c54fb291.

The persistent-writer proof is now part of the branch. It found and corrected a retained-reader gap: an admitted configuration copy could match the active runtime's values and resolution provenance while carrying a different origin object. Its delegation check then retained the old grant across a later operator revocation. The existing reader now also binds equivalent active-runtime copies; scoped or differently resolved configurations remain separate.

The test runs the authenticated Gateway, real OpenClaw agent/delegation engine, shared authority owner, CLI config writer, and persistent config file. Model HTTP responses are synthetic. It first proves an automatic permitted write. A second proposal pauses after operation parsing, before the writer reads/prepares its base snapshot. The operator then sets the per-agent grant to false through config.patch, and the test waits for live publication before resuming. It requires policy-specific rejection and byte-identical post-revocation configuration. It does not depend on stale-hash rejection, a mocked authority owner, or an unobservable approval-event assertion.

Reproduction on unchanged d1d386499328591a8711ba4f08cdf4d926d55e0a failed at the persisted effect: expected logging.level: warn, received error. The repaired flow passed locally with all 44 runtime-config tests. AWS validation also restores the old reader behavior as a negative control, checks that the same persistent-write assertion fails, restores the exact candidate source, and runs the focused authority suites.

The previously collected live/native/package/config-preservation results are published as sanitized embedded data with their original source hashes and limits. They remain evidence for that recorded snapshot, not a claim that those older package artifacts contain this reader correction.

Local autoreview of the followup through P2 completed with no actionable findings. The subsequent fixture-only type correction makes the unused restart-recovery callback synchronous, as its contract requires. The test allocation grows by exactly 186 LF lines: the 182-line real Gateway regression and four net lines extending the existing reader contract. No shared scalar or unrelated test allowance was raised. The local ratchet reports seven lines of inherited debt; the branch adds exactly its allocated 1,155 net test lines.

Independent human review of SECURITY.md remains requested from @openclaw/openclaw-secops. Please review the standing-delegation and Full Access boundary against the permission table in the PR description; automated review is not being represented as that owner review.

Sanitized observed results and source binding
{
  "head": "e24c54fb2919594b2f4be2a3bc2c630043fff336",
  "provider": "aws",
  "lease_id": "cbx_d6b7ee6cd84d",
  "environment": {
    "node": "24.22.1",
    "pnpm": "12.15.0",
    "cpus": 32,
    "mem_total_kib": 64418960
  },
  "negative_control": {
    "run_url": "https://crabbox.openclaw.ai/portal/runs/run_58f5255f02b9577f216d7c5c9a200db2",
    "mutation": "Restore old reader binding behavior by disabling only the active-runtime equivalence clause.",
    "exit_code": 1,
    "expected_persisted_logging": "warn",
    "observed_persisted_logging": "error"
  },
  "restored_candidate": {
    "run_url": "https://crabbox.openclaw.ai/portal/runs/run_58f5255f02b9577f216d7c5c9a200db2",
    "test_files": 5,
    "tests_passed": 115,
    "exit_code": 0,
    "fixture_note": "This run preceded the callback signature type correction; the production bytes match final HEAD."
  },
  "final_fixture": {
    "run_url": "https://crabbox.openclaw.ai/portal/runs/run_1773e48851f3fd5e9c6de228df2ede0e",
    "test_files": 1,
    "tests_passed": 1,
    "exit_code": 0
  },
  "source_sha256": {
    "src/config/runtime-snapshot.ts": "cd522430f2370e237745944cac9d30c39e3ef1768941597ecf7fa7ca1a31e2a9",
    "src/config/runtime-snapshot.test.ts": "9c6964da90b287d1a311ef4e689146c0cdd67b7cf6e3e377501dc808c8b92831",
    "src/gateway/server.delegated-administration.product.test.ts": "cb897e1f1c2c297b540b1c159f325db2662f37e1c2f30dae1e40a7b64838749d",
    "config/test-lines-allocations/delegated-administration-policy.txt": "9ce4b3f9da775ba459cb4b343b4ac5751a6e001f1d3b237b6d359e8bbed55133"
  },
  "local_review": {
    "base": "d1d386499328591a8711ba4f08cdf4d926d55e0a",
    "status": "scoped-clean",
    "priority": "P0-P2",
    "findings": 0,
    "post_review_delta": "Fixture-only synchronous callback signature correction; no production change."
  },
  "checks": {
    "gateway_server_types": "passed",
    "config_cli_types": "passed",
    "focused_type_aware_lint": "passed",
    "format": "passed",
    "diff_check": "passed",
    "test_line_ratchet": "7 lines inherited debt; branch allocation equals its own +1155 LF delta"
  },
  "limits": [
    "Model HTTP responses in this new product test are synthetic.",
    "Prior live/native/package artifacts retain their separately published source binding.",
    "Independent human SecOps review remains pending."
  ]
}

Task-owned AWS validation resources are released; exact-lease inspection confirmed cleanup complete. Current-head CI has settled: 76 jobs passed, 26 skipped, three test jobs and the aggregate gate failed. The PR description links the exact jobs and records source/control evidence attributing those failures to existing UI, Telegram and provider-auth fixtures. CI remains failed; no branch-caused failure is currently identified.

@joshavant

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

Current head: e24c54fb2919594b2f4be2a3bc2c630043fff336. Branch, description, public proof and current-head CI results are updated.

Please reassess the real persistent-writer revocation proof and retained-reader correction, plus the published live/native/package/config-preservation evidence. The proof includes an allowed write, operator revocation through the real config owner, a failing old-reader control, unchanged config after rejection, and 115 passing focused tests. Independent human SecOps review remains requested and pending; this request does not substitute for it.

Evidence: #196984 (comment) and #196984 (comment). Current CI is complete but failed; exact-job attribution and its limits are in the description.

@clawsweeper

clawsweeper Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 11, 2026
@clawsweeper clawsweeper Bot added the status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked. label Nov 11, 2026
@joshavant
joshavant merged commit b8980ca into main Nov 11, 2026
192 of 197 checks passed
@joshavant
joshavant deleted the security/delegated-administration-policy branch November 11, 2026 03:44
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 11, 2026
…ty (openclaw#196984)

* fix: honor effective authority for delegated OpenClaw changes

* test: preserve exec policy exports in scoped tool fixture

* fix: follow live configuration in delegated authority checks
obviyus added a commit that referenced this pull request Nov 11, 2026
Since #196984, Gateway session utilities import the run-entry CLI runtime
selector. The suite's static placement-admission import now evaluates that
graph before the shared harness registers its model-selection mock, so the
selector keeps the real isCliProvider and routes codex-cli turns to the
embedded runner. Import placement admission after harness setup.

Co-authored-by: obviyus <[email protected]>
zeroaltitude added a commit to zeroaltitude/openclaw that referenced this pull request Nov 11, 2026
… fence

The 2026-11-10 main merge brought openclaw#196984, which stopped deriving an automatic
delegated OpenClaw change from `fullPermission` alone: `prepareDelegatedSystemAgentApproval`
now also requires a live `assertAutoApproveChangesCurrent` grant on the caller
identity, and falls through to the exact-approval path when one is absent. This
branch's channel-authority fence predates that commit, so its caller identity
carried no grant and all three cases died at `OpenClaw approval registry
unavailable` instead of reaching the apply owner the test is fencing.

Supply the grant the production caller supplies. The fenced behaviour under test
is unchanged: live still applies once, and a revocation that lands while the
apply owner is awaiting its queued work still rejects before the effect.

Also record the branch's exact net test-line growth as a budget allocation; the
suites it adds for channel-ingress Gateway delegation put the tree 919 lines over
the ceiling.

Validation (worktree openclaw-fix-channel-session-gateway-owner):
- node scripts/run-vitest.mjs run --config test/vitest/vitest.auto-reply-reply.config.ts
  src/auto-reply/reply/get-reply.gateway-authority.delegated-effect.test.ts
  -> Test Files 1 passed (1), Tests 9 passed (9), exit 0
- node --import ./scripts/tsx.mjs scripts/check-test-lines-ratchet.mts --base origin/main
  --no-merge-base -> Test lines OK: 6652679; ceiling: 6652689; slack: 10, exit 0
- node scripts/run-format.mts --check <file> -> correct format
- node scripts/run-oxlint.mjs --tsconfig test/tsconfig/tsconfig.test.root.json <file> -> exit 0
- git diff --check -> clean

Co-Authored-By: Claude <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 12, 2026
…7050)

Since openclaw#196984, Gateway session utilities import the run-entry CLI runtime
selector. The suite's static placement-admission import now evaluates that
graph before the shared harness registers its model-selection mock, so the
selector keeps the real isCliProvider and routes codex-cli turns to the
embedded runner. Import placement admission after harness setup.

Co-authored-by: obviyus <[email protected]>
RomneyDa pushed a commit that referenced this pull request Nov 12, 2026
Adapt #196984 onto the cold-start split tool owners. Keep one shared
assembly, bind authority to surviving callable core exec identity, and
mark both public SDK factories and native harness construction unverified.
Preserve exact approval fallback, live effect checks, grant protection
and honest Full Access labels.

Source: b8980ca
Prior reviewed adaptation: eb452340eaca22fc5dabec41da67dab2da31b47f
Base: 06fe9b8

All 38 original paths retained; 35 byte-identical. Relocate the callback
to agent-tools.assembly.ts and the async SDK marker to agent-tools.async.ts;
preserve canonical async import paths and lazy factory preparation.
Independent integration review found no actionable P0-P2 findings.

Proof: targeted transitive typecheck, five-file lint, relocated-file format,
cold import-boundary and assembly/delegate/Gateway regression tests pass.
Prior full build, base-red durable-write and policy proof are preserved
as prior-head evidence, not relabeled as combined-head validation.
Allocate the source adaptation's exact 1153 net regression lines.

Gap: full-agent model-HTTP proofs remain blocked before inference by
loopback transport failure. Denied NO_PROXY remediation was not bypassed.
No live-provider or stable-upgrade qualification is claimed.

Co-authored-by: RomneyDa <[email protected]>

Co-authored-by: vincentkoc <[email protected]>
wheakerd pushed a commit to wheakerd/clawdbot that referenced this pull request Nov 13, 2026
Refresh the complete v2026.11.3..09aa644
history: 99 in-range PRs, 35 issues, and direct-commit editorial coverage.
Preserve all 62 prior contribution records and original main PR credits.
Include typed Telegram callbacks, worker-heartbeat lease renewal, and the
narrow large-store startup adaptations without claiming post-ready recovery.

Source product: 09aa644
Source tree: f10a88c
Main metadata: 3577724
Notes tooling: 514a224

Release provenance: 3768440 -> openclaw#194840, openclaw#179219, openclaw#196984, openclaw#196337
Release provenance: 00275d2 -> openclaw#194362
Release provenance: 66f0339 -> openclaw#186998
Release provenance: 915956a -> openclaw#186998

Co-authored-by: vincentkoc <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
shad0wca7 added a commit to shad0wca7/openclaw that referenced this pull request Nov 15, 2026
Main's openclaw#196984 gate requires callerIdentity?.assertAutoApproveChangesCurrent
before a delegated change may be applied automatically. Wire (CLI-backend)
callers cross a process boundary and only carry trustedAgentRuntime, so
automatic application was structurally unreachable for them.

The preparing host now registers the live policy closure in a server-owned
handoff map and the signed runtime identity token carries only an opaque
correlation id. The target Gateway redeems it only when the id is bound to the
same agent, session, operational run instance and delegated authority claim the
token verified, and only for a signed full-permission grant; a missing or
unbound handoff still routes the change to a human. The id is never authority
and openclaw#196984's rechecks and closure fences are unchanged.

Tests: wire Full Access lifecycle suite (active/run/tool/gateway/worker/session)
now asserts the revalidated contract; fixtures attach the policy assertion and
supply delegationExecAuthority where automatic authority is expected.
RomneyDa added a commit that referenced this pull request Nov 17, 2026
…9192)

## Problem

After saving a provider key in the Control UI (`models.authSetApiKey`), a live Gateway logged `[plugins] typesafe invalid config: apiKey: must be object` once per prepared model runtime rebuild. The TypeSafe plugin's `apiKey` is a SecretRef object, and its manifest declares it as a secret input, so validation must compare against the authored source, not the resolved string.

Call chain:

1. The auth mutation rebuilds existing prepared-runtime owners (`prepared-model-runtime-auth-publication.ts` → `publishPreparedModelRuntimeOwnerBatch`).
2. Each owner rebuilds from the config it was admitted with, an older runtime generation (`prepared-model-runtime.build.ts`).
3. `projectConfigOntoRuntimeSourceSnapshot` maps that old config onto the current source snapshot. The config write added a top-level `meta` key that the old config lacks, so the projection returns the resolved config as its own source.
4. `loadAgentRuntimePluginRegistryHandle` passes that as `activationSourceConfig`, and plugin config validation sees the resolved string.

## Fix

The runtime snapshot publisher (`publishRuntimeConfigSnapshot`) now records the authored source it publishes with each runtime config object, in a separate map next to the existing captures (`recordPublishedRuntimeConfigSource`). Every publication overwrites it (with the runtime itself when no source is published), so a source republished for the same runtime object (`setRuntimeConfigSourceSnapshotIfCurrent`) stays authoritative. `projectConfigOntoRuntimeSourceSnapshot` uses that record for configs that are not frozen captures, so an older runtime generation projects its own source instead of failing open against a newer one. The record is not a capture: the config keeps its identity, and `captureRuntimeConfig` still freezes an isolated runtime/source pair for rebuilds.

## User impact

Saving a provider key no longer produces false invalid-config errors for plugins with secret inputs, and those plugins validate against their real authored config during rebuilds.

## Proof

- `src/config/runtime-source-projection.test.ts`:
  - "keeps an older runtime generation on its own published source": a held generation still projects its SecretRef after a newer generation adds `meta`, and `captureRuntimeConfig` still returns a frozen copy. Fails on `main` (projects the resolved string).
  - "follows a newer source republished for the same runtime object": republishing the same runtime object with a new source wins, also after the next generation. Fails on the previous head of this PR.
- An isolated Gateway reproduction (TypeSafe with an env SecretRef, bundled plugins on, then `models.authSetApiKey` for `particle`) logged `typesafe invalid config` before the fix and zero after, with `models.list` succeeding. The scratch harness is not committed: it needs a 15 s wait.
- Projection, runtime snapshot, owner, inbound-registry, sources and loader-shared suites pass. `pnpm check:changed` passes. `pnpm check:madge-import-cycles` reports 0 cycles.

Known remaining: `plugins/loader-load-context.ts` (context-engine owner capture) and `decisions/registry-adoption.ts` use the same projection on held configs. They produced no warnings in the reproduction after this fix.

No overlap with Pash/Sarah changes.

## Merge danger

Two-way door: a revert fully undoes it. No state, config or contract change. Blast radius: prepared model runtime rebuilds after config writes.

Co-authored-by: Ayaan Zaidi <[email protected]>

Release adaptation: clean -x backport onto 82f1197; production and regression hunks unchanged. Add a separate 38-line test-budget allocation for the two upstream regression tests; shared scalar unchanged. Preserve baseline e13cf15 and audit pin bd692e9.

Companion dispositions at pinned audit:
- #193903 / b43ad0a: not-applicable; independent catalog/capture-memo optimization, no prerequisite for the source association.
- #196984 / b8980ca: present-equivalent; current reader already follows equivalent runtime copies.
- #199956 / ea69fcb: not-applicable; independent live-reader ownership retention; authored-source association unchanged.
- No later #189192 mention. Existing publication, capture, runtime-plugin, loader and decision consumers retain their interfaces; no generated/registry companion needed. Workflow optimizations excluded from this product-only scope.

Release proof: unmocked production publication/projection regression boundary fails on parent (2 failed, 4 passed) and passes after pick; projection plus snapshot suites 50 passed; retained-runtime plugin consumer suites 18 passed. Targeted type-aware lint (4 files), format and diff checks pass. Upstream live Gateway proof above is historical; this lane does not claim a fresh live Gateway/model run or full release qualification.

Self-review/pr-simplify: retain the minimal separate weak association because raw publication identity and frozen captures have distinct lifetimes. Delta: 27 production and 38 regression lines, plus the 3-line budget record.

(cherry picked from commit 8ca9161)

Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit 7ddb9e2a14671b47081bec40224e1f6f7316690d)
shad0wca7 added a commit to shad0wca7/openclaw that referenced this pull request Nov 21, 2026
Resolve the identity-token conflict on upstream zod schemas and normalization helpers, retaining explicit signed Full Access and the server-owned current-policy assertion handoff and refusal path. Remove the superseded extracted schema module. Preserve openclaw#196984 effective-authority gates and initialization abort fencing.

Validation: 132 focused tests including the six wire lifecycle cases; gateway-methods types; targeted formatting and lint; diff check; line-cap ratchet against pinned upstream 39c3099.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation gateway Gateway runtime merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. security Security documentation security-sensitive-changed size: XL status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant