Skip to content

feat(openclaw-id): guest member role with sandboxed session tools - #197748

Merged
jalehman merged 8 commits into
mainfrom
ocf-520-guest-preset
Nov 15, 2026
Merged

jalehman merged 8 commits into
mainfrom
ocf-520-guest-preset

Conversation

@jalehman

@jalehman jalehman commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

OpenClaw ID members are either Operators, whose sessions run tools on the Gateway host, or Viewers, who cannot start work. An owner has no role for someone who should be able to work with the session's tools kept in a sandbox.

User Impact

User impact: turning on OpenClaw ID also writes a guest role definition. A guest member reads shared sessions and starts their own work, and the exec and file tools of their sessions run in a per-person sandbox. Operator stays the default invite role. OpenClaw ID is a Labs feature and is off by default.

Important limit: a required sandbox contains a session's exec and file tools only. It does not contain Code Mode under the default node executor, CLI backends, or direct node.invoke calls by a role that also has operator.write or operator.admin. These limits apply to every sandbox-required role, named roles included, and are listed in docs/gateway/operator-scopes.md. With default settings a guest can reach the first two. The maintainer accepted these limits for now; this PR changes none of those paths.

A guest needs a Docker or Podman sandbox backend. Without one their runs fail; they never fall back to the host. The invite form does not offer Guest at this head: the role picker arrives in #197770, and until then a Guest is invited through the signed invite RPC. The missing-backend warning in the form therefore only becomes reachable for the stock Guest role with #197770.

Why This Change Was Made

  • The guest preset is sessions.others: "view", agents: "*", scopes: ["operator.sessions.write"], sandbox: "required". It is written with the other presets, only when missing.
  • A member's sandbox requirement comes from the membership role, so it holds when named-role enforcement is off (definitions without gateway.roles.default), which is the normal state of a personal claw.
  • Sessions a guest creates are stamped sandbox-required at creation. Forks, rewinds, spawned children, cron jobs and recovered runs keep the stamp. A guest cannot start a run in an existing host-execution session.
  • The connection decides the role: a person who is a guest member and also has a non-sandboxed named role gets a sandboxed session over the member connection and an unsandboxed one over the other sign-in.
  • The People data marks which roles require a sandbox and whether a backend is available. The backend probe runs only for that owner-only view.

Evidence

  • Focused runs: 127 Gateway tests, 36 cron tests, 24 UI tests and 23 People projection tests pass, with targeted typechecks, lint, format, docs checks and ratchets.
  • New tests cover the preset being written; a guest's session stamped sandbox-required with enforcement on and off; forks, rewinds, children, cron and recovery keeping the requirement; refusal to run in a host-execution session; fail-closed with no backend; an operator member's sessions staying unsandboxed; and the two-sign-in case.
  • These tests prove stamping, propagation and admission. They do not run a tool inside a real container.
  • An independent review found the membership propagation consistent on every surface it listed, and reported the three uncontained paths above. The second commit corrects docs, UI copy and test names so nothing claims a guest has no host access.

Not run: a live Docker or Podman model run, a real restart and recovery cycle, the full repository suite.

Six commits before a second rebase. The last three of those fix how this PR's early read of a scheduled job's stored authority classifies refusals, found by CI and by independent reviews of each head:

  • a job whose stored authority cannot be decoded crashed the read; it is now listed by Doctor and refused;
  • that refusal, and the refusal for a member who was removed or whose role changed, was treated as a generic failure, so a recurring job retried up to the ten-failure limit; both are now permanent refusals that disable the job after one occurrence, before any session is created, as on main. Transient lookup failures stay retryable.

A review of head b3c7d200bc3e found no P0-P2.

Live proof (isolated Gateway, staging testnet), see the proof comment: checks 1-8 on bfc792e9f1f9, and setup, sandbox stamp and admission, and removal through Access on 0e0d8879feb8. Sandbox evidence is admission only; no tool ran in a container. A member cannot create a scheduled job directly (it needs operator.admin), so the scheduled-job fixes are covered by unit tests only. Commits after 0e0d8879feb8 change scheduled-job handling only.

Rebased again onto current main (8b94cfb556c3), which had added existing-person invitations, private preset exports, the member agent ceiling at session creation and per-job Access selection for cron. Production behavior of this PR is unchanged by the rebase; two test-only commits follow it (tests use their own expected-preset fixture; one cron test follows main's changed alert wording). Eight commits. A review of the rebased head abe84f6d062b found no P0-P2. The live proof predates this rebase.

CI on abe84f6d062b, one failure not from this PR: checks-node-compact-small-1, src/cli/cron-cli/cron-suppression.gateway.test.ts ("distinguishes intentional silence from failures across repeated runs of one stored job") reads lastDeliveryError, which is undefined. It fails identically on the CI merge base 7acc3158247e without this PR (3 of 3 runs under Node and under Bun), and this PR does not touch the test. A lint job was also killed by the runner's memory limit on the first attempt; the same lint stripe passes locally on the base and on the merge.

@clawsweeper

clawsweeper Bot commented Nov 12, 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.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime plugin: openclaw-id-access size: XL labels Nov 12, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 12, 2026
@clawsweeper

clawsweeper Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

This PR adds a Guest membership preset and carries its required sandbox policy through session creation, execution, scheduling, and recovery.

Example: A Guest member creates agent:main:guest-work while the agent's sandbox mode is off.

  • Before: Membership alone does not stamp the session as sandbox-required.
  • After: The session records sandbox: required, so its exec and file tools require a sandbox backend.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The existing-owner design is coherent, but Guest invitation is incomplete, required runtime and upgrade evidence is absent, and the execution-boundary choice remains open.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Product

Kind: Feature · Worth it: Yes · Fix scope: Complete
User problem: Owners lack a built-in member role that can start work while requiring session exec and file tools to use a sandbox.
Reason: The supplied maintainer-authorship fact establishes feature direction, and the change extends existing policy owners; the body separately reserves the execution-boundary choice.

Merge readiness

⛔ Blocked before merge - 2 items remain

Keep this maintainer-directed feature open; Guest invitation is incomplete, and the explicitly unresolved execution-boundary choice needs an owner decision.

Priority: P2
Reviewed head: 3e39ea1c533c79c4d7dec00f4eed3fb394db4a86
Owner decision: Required. See Decision needed.

Decision needed

  • Question: Should the stock Guest role retain access to host-side Code Mode and CLI backends, or require stricter execution defaults?
  • Recommendation: Choose stricter Guest execution: Use the existing execution and model-policy owners to keep Guest work on approved isolated paths, with corresponding user-facing guidance.
  • Why: The PR explicitly leaves this choice open; approval of the feature direction does not settle its stated default-execution tradeoff.

Before merge

  • Expose Guest through the invite role picker (P2) - Installing this preset does not let an owner invite a Guest through Access. ROLE_OPTIONS in people-sections.tsx still contains only operator and viewer, and its onSelect callback maps every other value to operator. Consequently the new Guest workflow and its backend warning cannot be exercised through the product's invitation UI. Include Guest in the existing picker and preserve its exact role when creating the invitation; verify the submitted role and unavailable-backend warning through InviteForm.
  • Add data-model compatibility proof - The review found that existing stored data may not work after upgrade. Show that existing data still loads and works with this change.

Findings

  • [P2] Expose Guest through the invite role picker — src/gateway/openclaw-id/member-role-presets.ts:26-30

Tests

  • Missing end-to-end proof: Provide redacted real-Gateway evidence of Guest invitation, container tool execution, restart recovery, and the unavailable-backend warning with inspected before/after screenshots, plus a latest-stable upgrade preserving existing settings and sessions.
Agent review details

How this fits together

The Gateway resolves authenticated membership into role policy, stamps new sessions, and passes that isolation requirement to existing session, automation, and agent execution owners.

flowchart TD
  A[Authenticated member] --> B[Membership role definition]
  B --> C[Session creation provenance]
  C --> D[Session sandbox stamp]
  B --> E[Run admission]
  D --> E
  E --> F[Session exec and file tools]
  D --> G[Children and recovered work]
Loading

Technical review

Best possible solution:

Complete Guest invitation through the existing picker and preserve membership-derived sandbox stamps under an explicitly chosen execution boundary.

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

Source inspection establishes that Access cannot select Guest: its picker offers only Operator and Viewer and coerces other values to Operator; no target code or tests were executed.

Is this the best way to solve the issue?

Reusing membership authority, creation provenance, and existing sandbox admission is a coherent minimal implementation, but the invitation consumer must be completed.

Full review comments:

  • [P2] Expose Guest through the invite role picker — src/gateway/openclaw-id/member-role-presets.ts:26-30
    Installing this preset does not let an owner invite a Guest through Access. ROLE_OPTIONS in people-sections.tsx still contains only operator and viewer, and its onSelect callback maps every other value to operator. Consequently the new Guest workflow and its backend warning cannot be exercised through the product's invitation UI. Include Guest in the existing picker and preserve its exact role when creating the invitation; verify the submitted role and unavailable-backend warning through InviteForm.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Creator-owned sandboxing keeps the original intent (7f7448e: Keep isolation stable for a session's lifetime and refuse sandbox-required callers inside unstamped sessions.)
  • Creation provenance and propagation keeps the original intent (076b7b5: Record creator isolation across creation paths and retain stronger inherited requirements for children.)
  • Membership versus profile policy keeps the original intent (feat(openclaw-id): member roles come from gateway.roles.definitions #197739: Membership definitions govern member connections independently of named-role enforcement and profile assignments.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Josh Lehman: Raw commit e29577b adds extensions/openclaw-id-access/browser/people-sections.tsx:20 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: e29577b7d7df; files: extensions/openclaw-id-access/browser/people-sections.tsx)

PR surface

Source +132, Tests +626, Docs +56, Other +4. Total +818 across 33 files. Added test files: 3.

View PR surface stats
Area Files Added Removed Net
Source 18 158 26 +132
Tests 12 745 119 +626
Docs 2 67 11 +56
Config 0 0 0 0
Generated 0 0 0 0
Other 1 4 0 +4
Total 33 974 156 +818

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
Persisted preset addition 1 additional automatically installed role; 0 new config keys Guest is added through the existing role-definition and missing-only activation machinery.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is an off-by-default Labs feature with an incomplete invitation flow and no demonstrated urgent production incident.
  • merge-risk: 🚨 security-boundary: The new Guest permission set permits work while the owner has explicitly left its host-execution exclusions unresolved.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

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.

Reviewed November 12, 2026, 8:36 AM ET / 13:36 UTC.

@jalehman
jalehman force-pushed the ocf-518-member-roles-from-definitions branch 2 times, most recently from ec6da85 to 2b648ec Compare November 13, 2026 20:06
@jalehman
jalehman force-pushed the ocf-520-guest-preset branch 3 times, most recently from cbb2ca1 to a9aac82 Compare November 14, 2026 01:19
@jalehman
jalehman force-pushed the ocf-518-member-roles-from-definitions branch from 8d8aa19 to 536bf87 Compare November 14, 2026 02:33
@jalehman
jalehman force-pushed the ocf-520-guest-preset branch 2 times, most recently from 5537a5b to 5d1cb61 Compare November 14, 2026 05:48
Base automatically changed from ocf-518-member-roles-from-definitions to main November 14, 2026 05:51
@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Nov 14, 2026
@jalehman
jalehman force-pushed the ocf-520-guest-preset branch from 5d1cb61 to bfc792e Compare November 14, 2026 06:54
@openclaw-barnacle openclaw-barnacle Bot removed the scripts Repository scripts label Nov 14, 2026
@jalehman
jalehman marked this pull request as ready for review November 14, 2026 06:54
@github-actions

github-actions Bot commented Nov 14, 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: abe84f6d062bbeea51027ea46bac6cb77d97b512
  • Maintainer: @jalehman
  • Repository role: admin

These security sensitive changes were made:

  • src/gateway/openclaw-id/sandbox-availability.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.
  • src/gateway/operator-role-policy.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.

Carefully review these changes before merging.

@jalehman

Copy link
Copy Markdown
Contributor Author

Live proof covered two heads on separate disposable staging claws.

At bfc792e9f1f9, checks 1–8 passed: enabling OpenClaw ID wrote the three presets without a default; restart preserved an edited Guest definition; Guest invitation, approval, tunnel access and Discovery publication worked; Guest could read another member's shared session but could not change or send to it; Guest could create its own sandbox-required session and was refused entry to its own older host-execution session. Operator permissions and Viewer read-only behavior were preserved. The removal check stopped before confirmation because the test selector was ambiguous.

At 0e0d8879feb8, the targeted follow-up passed setup, publication, stored sandbox stamps and admission again. Guest selects the sandbox; Operator selects host execution. Guest is still absent from the invite picker, so its invitation used the supported signed RPC and approval used Access.

The removal gap is now closed. I dry-ran exact selectors, removed Guest through Access and confirmed the action. Access reported two connections closed. The held Guest connection closed, reconnect was denied by the relay as unauthorized, and Operator's existing connection and subsequent RPCs continued working.

Scheduled work remains a live-proof limitation: both Guest and Operator were refused direct cron.add with missing scope: operator.admin. With no model configured, I did not exercise an authenticated agent-tool route, so this run does not prove a stored member job or scheduled execution context. A separate harness assertion incorrectly expected an empty cron store; the sole job was the product's Memory Dreaming Promotion job, not a member-created proof job. I did not change permissions or fabricate stored authority to make this test pass.

Docker was already available, but both runs prove sandbox admission—not model/tool execution inside a container. No model run or container provisioning was attempted.

Cleanup is complete for both runs: each disposable claw was retired with all four database counts verified zero, all test-account sessions were revoked and verified signed out, and isolated processes, ports, checkouts, state, logs and recovery kits were removed. No task containers remain.

Note on the head: the PR head is now b3c7d200bc3e. The two commits after 0e0d8879feb8 change only how a scheduled job's stored authority refusal is classified, which this proof could not reach live.

@jalehman
jalehman force-pushed the ocf-520-guest-preset branch from b3c7d20 to abe84f6 Compare November 15, 2026 18:56
@jalehman
jalehman merged commit 3ddc56c into main Nov 15, 2026
205 of 211 checks passed
@jalehman
jalehman deleted the ocf-520-guest-preset branch November 15, 2026 20:03
@jalehman

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 16, 2026
…enclaw#197748)

* feat: add sandbox-required OpenClaw ID guest members

* docs: clarify member sandbox boundaries and proof

* refactor(gateway): reconcile restacked operator run authority

* fix(cron): reject undecodable scheduled authority safely

* fix(cron): permanently refuse undecodable isolated authority

* fix(cron): retire revoked member sources before session creation

* test(openclaw-id): adapt guest fixtures to private presets

* test(openclaw-id): align rebased authority refusal fixtures
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation gateway Gateway runtime merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. plugin: openclaw-id-access rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. security-sensitive-changed size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant