Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 26, 2026, 1:14 AM ET / 05:14 UTC (Revision 4). ClawSweeper reviewWhat this changesThe branch compares validated configuration before and after a delegated change, requires human approval when permission authority changes, rechecks automatic writes, and adds documentation and approval tests. Merge readiness⛔ Blocked before merge - 4 items remain The current head addresses both findings from the previous review, and current main still automatically applies Full Access delegated changes. No concrete new patch defect emerged. The intentional change to existing Full Access workflows needs an explicit maintainer upgrade decision. Priority: P1 Review scores
Verification
How this fits togetherA regular agent can delegate a configuration request to OpenClaw's system agent. The Gateway decides whether to apply it automatically or request approval, and the config writer saves an authorized change. flowchart LR
A[Delegated config request] --> B[Canonical config evaluation]
B --> C[Permission comparison]
C --> D[Automatic or human approval]
D --> E[Final write check]
E --> F[Saved config or no change]
Decision needed
Why: This intentionally changes an established automatic workflow. The related owner-trust comment endorses a small floor but does not settle the unattended upgrade case. Before merge
Agent review detailsSecurityNone. PR surfaceSource +528, Tests +1092, Docs +55, Other +156. Total +1831 across 20 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the effect-based gate and final-write recheck, obtain explicit acceptance of the Full Access upgrade behavior, and demonstrate the current approval round trip on Telegram's Test Server. Do we have a high-confidence way to reproduce the issue? Yes, current-main source shows the Full Access branch applying delegated config proposals automatically, and the branch includes focused cases for the changed boundary. This read-only review did not execute a current-main reproduction. Is this the best way to solve the issue? Yes, comparing validated effects and rechecking the final write snapshot is a focused way to distinguish authority changes from harmless neighboring edits. Acceptance of the changed default remains a product choice. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 4ed4df0e9b3f. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
Compare canonical validated config effects instead of path proximity. Keep no-op and operational edits automatic, reserve real authority changes for human decisions, and recheck automatic admission against the final write snapshot. Co-authored-by: obviyus <[email protected]> Co-authored-by: fuller-stack-dev <[email protected]>
Complete the effect-based approval comparison for channel tool policies, subagent tools, and effective browser origins. Preserve intentionally configured human delegates and prove allowed, unauthorized, revoked, and unattended final config effects. Merge pinned main c817021 to resolve the existing conflict without rewriting published ancestry. Co-authored-by: obviyus <[email protected]> Co-authored-by: fuller-stack-dev <[email protected]>
|
@clawsweeper re-review Updated head: The missing channel tool-policy and browser-origin comparisons are implemented, including account overrides, meaningful empty overrides, Telegram direct-entry shadowing, effective public-origin inheritance, and subagent tool policy. No-op, operational, and policy-preserving writes remain automatic. The reviewer-authority contract is intentionally the existing authorized-human contract, not a new owner-only restriction. Owners can designate nonowner approvers; The PR body includes the exact final-effect matrix, source-contract references and measured results: 114 selected cases; a 53-case Gateway replay and a final five-case reviewer replay after fixture-contract corrections; core/all core-test and extension type graphs, changed lint and remaining selected guards passed. The isolated socket-QA attempt was blocked by the host proxy; it is not claimed as completed or live Telegram proof. The completed production-handler evidence is distinguished explicitly. A local review’s group-wildcard hypothesis was checked against the registered group resolver and disproven: a prompt-only exact group retains the wildcard deny list. Direct-message selection differs and is protected. Adding that group gate would unnecessarily restrict ordinary edits. Please assess the current code and evidence. This is review-only, not a merge request. |
|
🦞👀 Re-review progress:
|
Include sender and conversation admission, account inheritance, canonical nested DM policies, and browser embed privileges in the existing human-decision floor. Preserve channel-specific wildcard semantics, legacy Matrix room admission, automatic token setup and operational edits. Prove approved risky choices still reach the real config writer. Co-authored-by: obviyus <[email protected]> Co-authored-by: fuller-stack-dev <[email protected]>
|
@clawsweeper re-review New head: Final frozen candidate: 160 focused cases passed (89.43s), relevant type/lint/format/ratchet/cycle/docs checks passed, and completed independent P0/P1 review found no actionable defect. Account inheritance, conversation membership, real wildcard-selection differences, canonical nested/group-DM policies and shipped Matrix compatibility were checked against their actual owners. Strict Telegram topic-tool rejection is retained rather than inventing unsupported settings. Token-only setup, model-routing metadata and authority-preserving operational edits remain automatic. A valid human approval still applies the requested less restrictive setting, and intentionally configured nonowner approvers retain their authority. The proposed Full Access default is unchanged; release acceptance is not fabricated. No new live/socket proof or full repository test run is claimed. Please assess this current revision; no merge or manual rating-label change is requested. |
|
🦞👀 Re-review progress:
|
…agent in chat (#158120) ## What Problem This Solves Fixes: owners who ask their agent in chat to change a key, a config value, or one of their own skills get refused, sent to a dashboard, or told to file a Workshop proposal. Examples: "you can't post API keys here", switching the embeddings provider routed to the web-search wizard, only proposals for handwritten skills. ## User Impact An owner can hand the agent an API key or token in chat, ask it to change config such as the embeddings provider, and have it edit skills they own. Session permission modes are unchanged: Full Access applies, restricted sessions ask. - **Keys from chat.** Masked setup flows still keep keys out of model context and remain the default. If the user already pasted a key or token, the agent stores it in the shared secret store and points the config key at it with a `store` SecretRef instead of refusing. It never echoes the value back. The pasted message already reached the model provider and transcript; redaction covers later logs and output only, and the docs say so. - **Existing store entries are never touched.** Each save inserts a new entry named after the config key plus a random suffix (`GATEWAY_REMOTE_TOKEN_9B139B5E231299BC`). Nothing is overwritten, revived, or deleted, and a new name can never match anything already pointing into the store, including a stale reference to a removed and purged entry. Replacing a key leaves its previous entry for `openclaw secrets store rm`. Rotating a key keeps its configured store provider alias, and the audit records the alias actually used. - **Embeddings.** The agent now treats the memory embeddings provider, model, and key as `memory.search.*` config, not the web-search setup wizard. - **Skills.** When the user asks, the agent edits skills they own directly: repository skill source, workspace `skills/`, project `.agents/skills/`, and configured extra skill directories. Bundled, ClawHub-installed, and plugin-provided skills are replaced by their owners' updates. For those, the agent says so and offers to capture the change as a Workshop skill. - **Tone.** The "never request / paste credentials in chat" lines are gone from the `openclaw` tools and system-agent prompts. "Never echo secret values" stays, and so do factual pointers for flows that genuinely need a UI: channel sign-in, provider OAuth/accounts, and model onboarding. No config option, schema, or protocol change. The Full Access permission-policy floor from the first revision moved to #158142 for its own security review. ## Why This Change Was Made After #149870, approved config writes may target any path. What still blocked owners was model-facing text telling the agent to refuse credentials, plus the missing ability to store a chat-provided value anywhere but plaintext config. `config_set_ref` gains an optional `secret` argument (read without trimming; only emptiness is checked). With it, the system agent: 1. registers the value for redaction when the proposal is built; 2. keeps the key's existing store provider alias when it has one; 3. sends one `secrets.writeForConfigRef` command to the SQLite state worker with the requester's live-authority guard. The host re-checks that guard at the worker's transaction and commit admission (`createSqliteWorkerWriteAdmission`), so a run stopped while the command is queued writes nothing. The transaction inserts a new row under a freshly minted `NAME_<16 random hex>`; 4. writes the ref through the existing config writer, which re-checks authority. If that write fails (before or after the writer commits), OpenClaw rereads the config and the error says the key was saved as `<NAME>` and whether the config key points at it. There is no automatic delete: another consumer may have linked the fresh entry, or the writer may have committed before failing; 5. the normal config reload picks up the new ref, since its id always changes. Nothing new runs SQLite on the Gateway main thread. <details> <summary>Out of scope / follow-ups</summary> - Found while proving this: in Full Access, after a delegated change applies, the next agent turn in the same chat fails with `SQLite database already belongs to another worker backend`. It reproduces on unmodified `origin/main` (`71bb516`) with a `logging.level` change followed by one more message. This PR does not fix it. - Built-in provider sign-in and model onboarding stay handoffs; they own live verification of the active inference route. - Other secret-store set/delete paths remain synchronous migration debt, as `worker-access.md` already records. </details> ## Evidence Real Telegram Test Server (Convex-leased userbot, fresh Gateway, QA mock provider, Full Access, tester is owner), first revision: | | Screenshot | |---|---| | Token given in chat, applied with no approval prompt and no refusal (synthetic QA token) |  | ### Final effects at this head qa-channel scenario `system-agent-owner-trust` passes through a real Gateway and state worker. The Gateway is seeded with an unrelated `GATEWAY_REMOTE_TOKEN` entry, then: 1. A command-allowed **non-owner** (`bob`) sends the key. The `openclaw` tool is owner-only. 2. The **owner** (`alice`, Full Access) sends it. Captured step details (redacted by the Gateway; the store ref id prints as `__OPENCLAW_REDACTED__`): ```json { "nonOwnerEntryNames": ["GATEWAY_REMOTE_TOKEN"], "storedRef": { "source": "store", "provider": "default", "id": "__OPENCLAW_REDACTED__" }, "storeEntryNames": ["GATEWAY_REMOTE_TOKEN", "GATEWAY_REMOTE_TOKEN_9B139B5E231299BC"] } ``` - After the non-owner turn: only the seeded entry exists and `gateway.remote.token` is unset. - After the owner turn: `gateway.remote.token` is a `store` SecretRef, the token is in its own minted entry (`GATEWAY_REMOTE_TOKEN_9B139B5E231299BC`), and the seeded entry's `updatedAt`/`updatedBy` are unchanged. No approval prompt was posted, and the token is absent from chat, config, and the store listing. **Revoked request**, through the production worker (Node main thread, real broker, `writeSecretStoreEntryForConfigRef`). The requester's guard passes the caller's check, then reports the run stopped: ```text seeded: [ 'GATEWAY_REMOTE_TOKEN (cli)' ] revoked request rejected: requesting run is no longer active after revoked request: [ 'GATEWAY_REMOTE_TOKEN (cli)' ] owner request saved as: GATEWAY_REMOTE_TOKEN_F1657B971F691824 after owner request: [ 'GATEWAY_REMOTE_TOKEN (cli)', 'GATEWAY_REMOTE_TOKEN_F1657B971F691824 (openclaw)' ] seeded value intact: true ``` Tests (each fails without the behavior it covers): - production worker path (`secret-store-config-ref.worker.test.ts`, forked database-worker lane with the real broker): a chat secret gets its own minted entry beside a live `GATEWAY_REMOTE_TOKEN` without touching it; a requester revoked after the caller's check writes nothing; - store kernel: a refusal at commit admission rolls the transaction back; each save mints a new `NAME_<hex>` and leaves the key's previous entry unchanged; a stale name whose entry was removed and purged still resolves to nothing after a chat save; - operations: stored and referenced with no value in output or audit; authority gone before the store write writes nothing; a failed config write names the saved entry and leaves it in place; rotating a key keeps its configured store provider alias, and the audit records it; - tool: proposes a store write without repeating the key, preserving leading and trailing whitespace. Measured single-worker wall time per new or materially changed test file at this head (`node scripts/run-vitest.mjs run <file>`, local M-series; vitest Duration includes import and setup): | File | Tests | Wall | Vitest duration | |---|---:|---:|---:| | `src/secrets/store/secret-store-config-ref.worker.test.ts` (new, database-worker lane) | 2 | 14 s | 2.05 s | | `src/secrets/store/secret-store.test.ts` | 32 | 16 s | 13.37 s | | `src/system-agent/operations.test.ts` | 43 | 18 s | 15.30 s | | `src/agents/tools/system-agent-tool.test.ts` | 36 | 15 s | 12.89 s | QA scenarios: `system-agent-owner-trust` (mock-openai) runs in about 27 s after build; `skill-owner-direct-edit-live` is live-frontier only and took about 3 min with `claude-cli/claude-sonnet-4-6`. Wording pins for the removed lecture text were deleted. The focused store, worker, exclusivity, operations, tool, approval, and delegate suites pass. `node scripts/check-changed.mjs` passes every gate except core lint, which fails only on three files this PR does not touch (`server-chat-metadata-lifecycle.integration.test.ts`, `session-companion-ask.ts`, `app-sidebar-session-list-render.ts` over `max-lines` on the base); oxlint on the changed files is clean. Security decision: a Full Access owner's pasted key goes to the Gateway-wide team store without a separate approval. Maintainer (@obviyus) accepted this in the PR conversation. **Rotation with a second consumer**, through the production worker (Node main thread, real broker). A second consumer references the key's first entry before the next save lands; value fingerprints only: ```text owner saves key #1 -> MODELS_PROVIDERS_OPENAI_API_KEY_6D96F6E92B59E935 (sha256:4a5c5a4aa8de) second consumer now references MODELS_PROVIDERS_OPENAI_API_KEY_6D96F6E92B59E935 (e.g. linked while the next save is queued) owner saves key #2 -> MODELS_PROVIDERS_OPENAI_API_KEY_4066F18ABAAE6903 (sha256:28bc4e3fe10d) second consumer's entry MODELS_PROVIDERS_OPENAI_API_KEY_6D96F6E92B59E935 after rotation: sha256:4a5c5a4aa8de unchanged: true ``` **Config write fails after the save, with a second consumer on the fresh entry**, through the production worker and the system-agent apply path (fingerprints only): ```text owner result: Saved the secret as GATEWAY_REMOTE_TOKEN_6B68C031E571F81C, but could not point gateway.remote.token at it: config write failed after commit (rollbackStatus: not-restored). Retry, or remove the entry with `openclaw secrets store rm GATEWAY_REMOTE_TOKEN_6B68C031E571F81C`. config gateway.remote.token: null second consumer's entry GATEWAY_REMOTE_TOKEN_6B68C031E571F81C: sha256:09ae5b4fd36b second consumer keeps the credential: true ``` **Stale reference to a removed and purged entry**, production worker for purge and save: ```text purged rows: 1 stale ref GATEWAY_REMOTE_TOKEN after purge: SECRET_STORE_NOT_FOUND chat save -> GATEWAY_REMOTE_TOKEN_8F698B5396990ADD resolves (value hidden) stale ref GATEWAY_REMOTE_TOKEN after chat save: SECRET_STORE_NOT_FOUND ``` **Owned-skill edit with a live model.** New scenario `skill-owner-direct-edit-live` (live-frontier; run with `claude-cli/claude-sonnet-4-6`, subscription auth) passes at this head. It seeds workspace skill `qa-owner-greeting` replying `OWNER-GREETING-V1`, and the owner asks in plain words: "Please change my qa-owner-greeting skill so it replies OWNER-GREETING-V2 instead of OWNER-GREETING-V1." Captured result: Skill file after the turn: ```markdown --- name: qa-owner-greeting description: Greets the owner with a fixed marker --- When the user asks for the owner greeting, reply with exactly: OWNER-GREETING-V2 ``` Agent reply: "Let me find the skill file. Done. The `qa-owner-greeting` skill now replies `OWNER-GREETING-V2` instead of `OWNER-GREETING-V1`." The model edited the skill file in place and confirmed it; it did not refuse or file a Workshop proposal. Co-authored-by: Ayaan Zaidi <[email protected]>
|
Closing. A Full Access agent can already change its config through shell and file tools, so gating only the |
…agent in chat (openclaw#158120) ## What Problem This Solves Fixes: owners who ask their agent in chat to change a key, a config value, or one of their own skills get refused, sent to a dashboard, or told to file a Workshop proposal. Examples: "you can't post API keys here", switching the embeddings provider routed to the web-search wizard, only proposals for handwritten skills. ## User Impact An owner can hand the agent an API key or token in chat, ask it to change config such as the embeddings provider, and have it edit skills they own. Session permission modes are unchanged: Full Access applies, restricted sessions ask. - **Keys from chat.** Masked setup flows still keep keys out of model context and remain the default. If the user already pasted a key or token, the agent stores it in the shared secret store and points the config key at it with a `store` SecretRef instead of refusing. It never echoes the value back. The pasted message already reached the model provider and transcript; redaction covers later logs and output only, and the docs say so. - **Existing store entries are never touched.** Each save inserts a new entry named after the config key plus a random suffix (`GATEWAY_REMOTE_TOKEN_9B139B5E231299BC`). Nothing is overwritten, revived, or deleted, and a new name can never match anything already pointing into the store, including a stale reference to a removed and purged entry. Replacing a key leaves its previous entry for `openclaw secrets store rm`. Rotating a key keeps its configured store provider alias, and the audit records the alias actually used. - **Embeddings.** The agent now treats the memory embeddings provider, model, and key as `memory.search.*` config, not the web-search setup wizard. - **Skills.** When the user asks, the agent edits skills they own directly: repository skill source, workspace `skills/`, project `.agents/skills/`, and configured extra skill directories. Bundled, ClawHub-installed, and plugin-provided skills are replaced by their owners' updates. For those, the agent says so and offers to capture the change as a Workshop skill. - **Tone.** The "never request / paste credentials in chat" lines are gone from the `openclaw` tools and system-agent prompts. "Never echo secret values" stays, and so do factual pointers for flows that genuinely need a UI: channel sign-in, provider OAuth/accounts, and model onboarding. No config option, schema, or protocol change. The Full Access permission-policy floor from the first revision moved to openclaw#158142 for its own security review. ## Why This Change Was Made After openclaw#149870, approved config writes may target any path. What still blocked owners was model-facing text telling the agent to refuse credentials, plus the missing ability to store a chat-provided value anywhere but plaintext config. `config_set_ref` gains an optional `secret` argument (read without trimming; only emptiness is checked). With it, the system agent: 1. registers the value for redaction when the proposal is built; 2. keeps the key's existing store provider alias when it has one; 3. sends one `secrets.writeForConfigRef` command to the SQLite state worker with the requester's live-authority guard. The host re-checks that guard at the worker's transaction and commit admission (`createSqliteWorkerWriteAdmission`), so a run stopped while the command is queued writes nothing. The transaction inserts a new row under a freshly minted `NAME_<16 random hex>`; 4. writes the ref through the existing config writer, which re-checks authority. If that write fails (before or after the writer commits), OpenClaw rereads the config and the error says the key was saved as `<NAME>` and whether the config key points at it. There is no automatic delete: another consumer may have linked the fresh entry, or the writer may have committed before failing; 5. the normal config reload picks up the new ref, since its id always changes. Nothing new runs SQLite on the Gateway main thread. <details> <summary>Out of scope / follow-ups</summary> - Found while proving this: in Full Access, after a delegated change applies, the next agent turn in the same chat fails with `SQLite database already belongs to another worker backend`. It reproduces on unmodified `origin/main` (`e51d576`) with a `logging.level` change followed by one more message. This PR does not fix it. - Built-in provider sign-in and model onboarding stay handoffs; they own live verification of the active inference route. - Other secret-store set/delete paths remain synchronous migration debt, as `worker-access.md` already records. </details> ## Evidence Real Telegram Test Server (Convex-leased userbot, fresh Gateway, QA mock provider, Full Access, tester is owner), first revision: | | Screenshot | |---|---| | Token given in chat, applied with no approval prompt and no refusal (synthetic QA token) |  | ### Final effects at this head qa-channel scenario `system-agent-owner-trust` passes through a real Gateway and state worker. The Gateway is seeded with an unrelated `GATEWAY_REMOTE_TOKEN` entry, then: 1. A command-allowed **non-owner** (`bob`) sends the key. The `openclaw` tool is owner-only. 2. The **owner** (`alice`, Full Access) sends it. Captured step details (redacted by the Gateway; the store ref id prints as `__OPENCLAW_REDACTED__`): ```json { "nonOwnerEntryNames": ["GATEWAY_REMOTE_TOKEN"], "storedRef": { "source": "store", "provider": "default", "id": "__OPENCLAW_REDACTED__" }, "storeEntryNames": ["GATEWAY_REMOTE_TOKEN", "GATEWAY_REMOTE_TOKEN_9B139B5E231299BC"] } ``` - After the non-owner turn: only the seeded entry exists and `gateway.remote.token` is unset. - After the owner turn: `gateway.remote.token` is a `store` SecretRef, the token is in its own minted entry (`GATEWAY_REMOTE_TOKEN_9B139B5E231299BC`), and the seeded entry's `updatedAt`/`updatedBy` are unchanged. No approval prompt was posted, and the token is absent from chat, config, and the store listing. **Revoked request**, through the production worker (Node main thread, real broker, `writeSecretStoreEntryForConfigRef`). The requester's guard passes the caller's check, then reports the run stopped: ```text seeded: [ 'GATEWAY_REMOTE_TOKEN (cli)' ] revoked request rejected: requesting run is no longer active after revoked request: [ 'GATEWAY_REMOTE_TOKEN (cli)' ] owner request saved as: GATEWAY_REMOTE_TOKEN_F1657B971F691824 after owner request: [ 'GATEWAY_REMOTE_TOKEN (cli)', 'GATEWAY_REMOTE_TOKEN_F1657B971F691824 (openclaw)' ] seeded value intact: true ``` Tests (each fails without the behavior it covers): - production worker path (`secret-store-config-ref.worker.test.ts`, forked database-worker lane with the real broker): a chat secret gets its own minted entry beside a live `GATEWAY_REMOTE_TOKEN` without touching it; a requester revoked after the caller's check writes nothing; - store kernel: a refusal at commit admission rolls the transaction back; each save mints a new `NAME_<hex>` and leaves the key's previous entry unchanged; a stale name whose entry was removed and purged still resolves to nothing after a chat save; - operations: stored and referenced with no value in output or audit; authority gone before the store write writes nothing; a failed config write names the saved entry and leaves it in place; rotating a key keeps its configured store provider alias, and the audit records it; - tool: proposes a store write without repeating the key, preserving leading and trailing whitespace. Measured single-worker wall time per new or materially changed test file at this head (`node scripts/run-vitest.mjs run <file>`, local M-series; vitest Duration includes import and setup): | File | Tests | Wall | Vitest duration | |---|---:|---:|---:| | `src/secrets/store/secret-store-config-ref.worker.test.ts` (new, database-worker lane) | 2 | 14 s | 2.05 s | | `src/secrets/store/secret-store.test.ts` | 32 | 16 s | 13.37 s | | `src/system-agent/operations.test.ts` | 43 | 18 s | 15.30 s | | `src/agents/tools/system-agent-tool.test.ts` | 36 | 15 s | 12.89 s | QA scenarios: `system-agent-owner-trust` (mock-openai) runs in about 27 s after build; `skill-owner-direct-edit-live` is live-frontier only and took about 3 min with `claude-cli/claude-sonnet-4-6`. Wording pins for the removed lecture text were deleted. The focused store, worker, exclusivity, operations, tool, approval, and delegate suites pass. `node scripts/check-changed.mjs` passes every gate except core lint, which fails only on three files this PR does not touch (`server-chat-metadata-lifecycle.integration.test.ts`, `session-companion-ask.ts`, `app-sidebar-session-list-render.ts` over `max-lines` on the base); oxlint on the changed files is clean. Security decision: a Full Access owner's pasted key goes to the Gateway-wide team store without a separate approval. Maintainer (@obviyus) accepted this in the PR conversation. **Rotation with a second consumer**, through the production worker (Node main thread, real broker). A second consumer references the key's first entry before the next save lands; value fingerprints only: ```text owner saves key #1 -> MODELS_PROVIDERS_OPENAI_API_KEY_6D96F6E92B59E935 (sha256:4a5c5a4aa8de) second consumer now references MODELS_PROVIDERS_OPENAI_API_KEY_6D96F6E92B59E935 (e.g. linked while the next save is queued) owner saves key #2 -> MODELS_PROVIDERS_OPENAI_API_KEY_4066F18ABAAE6903 (sha256:28bc4e3fe10d) second consumer's entry MODELS_PROVIDERS_OPENAI_API_KEY_6D96F6E92B59E935 after rotation: sha256:4a5c5a4aa8de unchanged: true ``` **Config write fails after the save, with a second consumer on the fresh entry**, through the production worker and the system-agent apply path (fingerprints only): ```text owner result: Saved the secret as GATEWAY_REMOTE_TOKEN_6B68C031E571F81C, but could not point gateway.remote.token at it: config write failed after commit (rollbackStatus: not-restored). Retry, or remove the entry with `openclaw secrets store rm GATEWAY_REMOTE_TOKEN_6B68C031E571F81C`. config gateway.remote.token: null second consumer's entry GATEWAY_REMOTE_TOKEN_6B68C031E571F81C: sha256:09ae5b4fd36b second consumer keeps the credential: true ``` **Stale reference to a removed and purged entry**, production worker for purge and save: ```text purged rows: 1 stale ref GATEWAY_REMOTE_TOKEN after purge: SECRET_STORE_NOT_FOUND chat save -> GATEWAY_REMOTE_TOKEN_8F698B5396990ADD resolves (value hidden) stale ref GATEWAY_REMOTE_TOKEN after chat save: SECRET_STORE_NOT_FOUND ``` **Owned-skill edit with a live model.** New scenario `skill-owner-direct-edit-live` (live-frontier; run with `claude-cli/claude-sonnet-4-6`, subscription auth) passes at this head. It seeds workspace skill `qa-owner-greeting` replying `OWNER-GREETING-V1`, and the owner asks in plain words: "Please change my qa-owner-greeting skill so it replies OWNER-GREETING-V2 instead of OWNER-GREETING-V1." Captured result: Skill file after the turn: ```markdown --- name: qa-owner-greeting description: Greets the owner with a fixed marker --- When the user asks for the owner greeting, reply with exactly: OWNER-GREETING-V2 ``` Agent reply: "Let me find the skill file. Done. The `qa-owner-greeting` skill now replies `OWNER-GREETING-V2` instead of `OWNER-GREETING-V1`." The model edited the skill file in place and confirmed it; it did not refuse or file a Workshop proposal. Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
Fixes: Full Access delegated setup can change the rules governing agents and Gateway clients without an explicit human decision. At the same time, a path-only approval floor unnecessarily interrupts harmless edits merely because they sit beside permission settings.
Split out of #158120 so the setup-usability changes and this approval boundary can be reviewed independently. This refinement keeps the user in control without treating every nearby config write as self-escalation.
User Impact
Full Access applies ordinary delegated changes automatically. Approval depends on the actual validated before/after authority change, not just the config path:
The existing approval card or
/approveflow remains available. An authorized human can approve the less restrictive choice and it is applied; this is not a blanket refusal. Restricted sessions retain their existing approval behavior. The existing authorized-human contract is intentional: owners may designate channel approvers, including nonowners, and authorized approval clients retain their scoped/device-bound access. This introduces neither an owner-only restriction nor a broader reviewer set.No new config option, config schema, or wire-protocol change. The boundary concerns delegated config operations; it is not a sandbox for an otherwise unrestricted host process.
Why This Change Was Made
The canonical config-set runner now exposes a host-only admission callback over validated before/after values. Proposal inspection uses that same parser, roster mapping, environment/topology preparation, and validator without committing a write. The permission comparison resolves known exec inheritance and sandbox/filesystem defaults while preserving meaningful explicit policy layers. Unresolved host exec defaults are not assumed to mean Full Access; this is not a universal privilege-ranking algorithm.
An automatically admitted operation carries the comparison into the actual write snapshot as well. A concurrent policy tightening cannot turn an earlier no-op decision into automatic restoration of old authority. Existing snapshot-conflict, live-run, cancellation, and human-approval checks remain in place.
Contributor: @obviyus. Follow-up commits preserve the verified co-author credits.
Work sessions
The original discussion session also contains the follow-up implementation and verification.
Evidence
Follow-up candidate
9f8790c53c6b78bf4afb513ed9f22215ed0495d4The revision-3 review accepted the real reviewer-to-writer proof, but identified missing sender-admission and embed-trust settings. This follow-up repairs those comparisons rather than adding a blanket channel/config approval rule:
The original omission was reproduced with ten failing real config-evaluation cases. Additional review findings were checked against actual owners and repaired with regression cases, including Matrix's admitted conflicting legacy/canonical fields and its shipped room alias. An unsupported Telegram
topics.*.toolshypothesis was rejected by the strict schema and the real evaluator; no unsupported policy surface was invented.Final frozen-candidate verification: 160 tests passed in 89.43s wrapper wall time across policy comparison (32), real canonical config evaluation/writing (69), and registered Gateway approval integration (59). The Gateway file took 67.90s. Core production and affected services/Gateway-method test type graphs passed, as did changed-file lint, formatting, assertion/line-cap/max-lines ratchets, runtime cycles and all 14,620 internal doc links. The completed independent staged-source review found no actionable P0/P1 defect. Commit creation preserved the exact validated tree. Earlier whole-core/extension checks below remain tied to their earlier revision; no fresh full repository suite or live/socket replay is claimed.
The existing Full Access default and unattended wait/expiry behavior are unchanged from the proposal. Maintainer acceptance of that release/upgrade tradeoff remains explicit; this code update does not fabricate that decision. The author's published direction remains trusting owners with keys and a separately reviewed small floor.
Earlier candidate and authority proof at
8fb5a6ac26821fe501cfc8470a928079239b1ef8The comparison now covers validated channel group/direct/channel/room/guild/team tool policies and account overrides, meaningful empty overrides and Telegram direct-entry shadowing, subagent tool restrictions, and effective Control UI allowed origins (including
gateway.publicOrigininheritance) plus Host-header fallback. Ordinary prompts/display settings and policy-preserving writes remain automatic. Unsupported Telegram topictoolspaths are rejected by the strict schema, not invented as a new policy surface.The final composed-tree run passed 114 tests in 137.92s: permission comparison 20, canonical config validation 41, and registered Gateway approval integration 53. The Gateway file used 81.78s wall / 73.90s summed test time; its existing fixture is reused, without per-case Gateway process boots. The extension test facade exposes the real Telegram approval capability for the boundary proof.
Actual reviewer-to-config effects
The fixture uses production
openclaw.chatandapproval.resolvehandlers, real Telegram authorization/custody resolution, the real approval manager and SQLite decision owner, and the canonical config writer. Inference and client identities are synthetic; this is in-process production-boundary proof, not live Telegram or socket-Gateway proof.A valid consumed approval is distinct from an attempt made after reviewer revocation; this proof does not invent retroactive revocation semantics. Current requester liveness and write-time effect guards remain in force. Existing saved Full Access modes need no schema migration. An unattended protected proposal waits or expires/cancels rather than silently writing or granting itself authority.
Reviewer-authority disposition
Configured approval delegation is existing documented behavior, not a new privilege grant:
docs/tools/exec-approvals-advanced.mddefinesoperator.approvalsas deliberately granted remote-execution-grade authority and explicitly permits configured channel approvers who are not command owners.extensions/telegram/src/exec-approvals.tsresolves explicit approvers before the owner fallback.approval-channel-custody.tsandapproval.tsrecheck current actor/account custody and decision authority. The title/docs therefore say authorized human, not owner-only. The positive delegate and negative unauthorized/revoked cases prove that boundary without taking authority away from user-configured delegates.Fresh staged-tree automated review completed; one reported group-wildcard finding was independently disproven against the registered production resolver. Telegram groups resolve through
resolveTelegramGroupToolPolicy→resolveScopeToolsPolicy, which retains wildcard tools for a prompt-only exact entry. Actual resolver execution returned identicaldeny: [exec]policy before/after andrequiresApproval: false. Telegram direct-entry selection differs and is separately protected. Adding the proposed group restriction would unnecessarily gate an operational edit.The current-main conflict was resolved by merging pinned
c817021248a9without rewriting published ancestry. Core production, all 25 core test type graphs, extension production/test types, changed core/extension lint, formatting, docs links/baseline, doctor-contract guards, dead exports, import cycles and remaining selected guards passed. Broader checks found fixture-only type/import/manager-constructor issues and an unbound spy assertion; these were fixed against the real contracts without suppressions or weaker assertions. The Gateway file was replayed after the constructor fix (53 passed, 80.81s wrapper), and the five reviewer cases were replayed after the spy-handle fix (5 passed, 48 deliberately filtered, 21.53s wrapper), with affected type graphs rechecked. Successful earlier stages were retained; failed aggregate commands are not presented as green full-wrapper runs. The only changes after independent semantic review were those fixture-contract corrections. The committed tree was verified equal to the validated staged tree.Socket-QA limitation
An isolated QA Gateway started, but its synthetic local QA-bus poll received a non-JSON host-proxy response, and mock-provider calls saw connection resets. Proxy controls were not bypassed; task-owned processes and temporary Gateway state were cleaned up. The expanded socket scenario is present but has no passing socket-QA receipt. The production-boundary matrix above is completed substitute evidence; no full repository test run or live channel replay is claimed.
Original-revision channel evidence
The following Telegram Test Server evidence belongs to the initial
23e0666d1165revision (Convex-leased userbot, isolated Gateway, QA mock provider, Full Access owner). The live channel scenario has not been rerun for the effect-based refinement.approvals.exec.enabledchange waits for the ownerThis remains a draft. Earlier screenshots are historical evidence, not a claim of current-head live-channel execution.
View the OpenClaw team session