Repository navigation
feat(visitor-access): internal Cloudflare Access visitor plugin - #132073
Conversation
Manage a dedicated app-scoped email allow policy without changing maintainer policies or identity providers. Add invite, revoke, and bounded drift-aware list tools with durable grant records and default 14-day expiry. Share one Gateway-owned manager across tool discovery and expiry sweeps; preserve cleanup records through remote failures and fence stopped services. Keep this private source-built plugin out of the npm release.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
Dependency GuardThis PR changes dependency-related files. Maintainers should confirm these changes are intentional. Changed files:
Maintainer follow-up:
|
Dependency graph changes notedThis PR includes dependency graph changes. The dependency guard is informational because the PR author is a repository admin, a member of
Security review is still recommended before merge when the dependency graph change is intentional. |
|
Codex review: found issues before merge. Reviewed August 28, 2026, 4:22 PM ET / 20:22 UTC. ClawSweeper reviewWhat this changesThis PR adds a bundled internal plugin that lets agent sessions invite, list, revoke, and expire email-based Cloudflare Access visitors. Merge readinessKeep this PR open: the private visitor-plugin direction fits the team deployment, but retargeting its Cloudflare policy configuration can leave expired visitor access active permanently. Priority: P1 Review scores
Verification
How this fits togetherVisitor Access turns approved agent tool calls into updates of one Cloudflare Access email policy. Plugin state retains issued grants so later expiry sweeps can revoke external access. flowchart LR
A[Agent session] --> B[Visitor tools]
B --> C[Visitor grant service]
C --> D[Durable grant records]
C --> E[Cloudflare Access policy]
D --> F[Expiry sweep]
F --> E
Decision needed
Why: Changing target identity affects durable external authorization and requires an explicit operator-safe lifecycle rather than a best-effort documentation warning. Before merge
Findings
Agent review detailsSecurityNeeds attention: The PR can orphan durable cleanup for an external Access grant after policy retargeting. PR surfaceSource +769, Tests +974, Docs +147, Config +24, Other +13. Total +1927 across 18 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the visitor manager plugin-local, but bind outstanding grants to one immutable Cloudflare target and refuse retargeting until that target has been explicitly reconciled or revoked. Do we have a high-confidence way to reproduce the issue? Yes, from source: invite into target A, retarget configuration to B, then run an expiry sweep; the sweep queries B and deletes the local record while A retains the email grant. Is this the best way to solve the issue? No. A README warning and manual revoke instruction do not enforce the durable authorization invariant at the state owner. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c417dcf392bf. LabelsLabel changes:
Label justifications:
EvidenceSecurity concerns:
What 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 (1 earlier review cycle)
|
The bundled typed-hook contract keeps hook registrations on an explicit allowlist; visitor-access registers gateway_start for its expiry sweep.
|
Merged via squash.
|
…claw#132073) * feat(visitor-access): add internal Cloudflare Access visitor grants Manage a dedicated app-scoped email allow policy without changing maintainer policies or identity providers. Add invite, revoke, and bounded drift-aware list tools with durable grant records and default 14-day expiry. Share one Gateway-owned manager across tool discovery and expiry sweeps; preserve cleanup records through remote failures and fence stopped services. Keep this private source-built plugin out of the npm release. * test(plugins): allow visitor-access gateway_start hook registration The bundled typed-hook contract keeps hook registrations on an explicit allowlist; visitor-access registers gateway_start for its expiry sweep.
What Problem This Solves
team.openclaw.ai sits behind Cloudflare Access with a single allow policy: membership in the openclaw GitHub org. There is no way to let a non-org member in — no visitor tier, no expiry, no operator surface. Granting someone temporary access today means hand-editing the Access app in the Cloudflare dashboard and remembering to undo it.
The gateway side of visitor support already shipped:
gateway.roleswithdefault: "guest"gives unknown authenticated users view-only access to others' sessions, a single allowed agent, and forced per-principal sandboxing (#128548, #129926, #130229, #131147, #131156). What was missing was the front door.Why This Change Was Made
This adds
extensions/visitor-access, an internal plugin (monorepo, excluded from the npm release via thefilesexclusion;"private": truefollowing theqa-channelpattern). Because team builds from source, landing on main deploys it there via the hourly updater with no packaging work.Mechanism: the plugin manages exactly one app-scoped Access allow-policy — an email include-list found strictly by its configured name. Access ORs allow policies, so the maintainer org policy is never read, written, or reordered. Visitors authenticate with their own GitHub account: the GitHub IdP authenticates any GitHub account (the org restriction lives in the policy, not the IdP), so no IdP changes are needed and
auto_redirect_to_identitystays on — zero UX change for maintainers.Three agent tools:
visitor_invite(email or GitHub login; public-email resolution with an actionable error when the email is private; default 14-day expiry,forevermust be explicit),visitor_revoke,visitor_list(includes drift reporting). Grants live in the plugin keyed store; an hourly sweep plus gateway-start sweep removes expired emails from the policy. Records are persisted before the Cloudflare write so a lost API response still leaves a cleanup record for the next sweep. All policy mutations reread fresh state first, so dashboard edits between calls are preserved; emails added by hand in the dashboard are reported as unmanaged and never auto-deleted.Trust model (also in the README): plugin tools are not in the sandbox tool allowlist and guest sessions are always sandboxed, so guests cannot reach these tools; anyone who can drive an unsandboxed session (maintainers, by role policy) can manage visitors. The API token is config-supplied and redacted from all error text.
User Impact
Maintainer-only, team-infrastructure feature. Not part of the npm release; no user-facing OpenClaw behavior changes. Operators of other deployments can enable it with their own Cloudflare account/app IDs.
Evidence
pnpm test extensions/visitor-access), covering create-if-missing, tamper refusal (non-allow decision, non-email rules, duplicate policy names), invite idempotency and expiry refresh, private-email guidance, maxVisitors cap, revoke by login/email, sweep expiry vs unmanaged retention.0b9863cf…) → revoke empties and deletes the policy → final read absent. App state verified byte-identical afterward: one policy (OpenClaw Maintainers (org)=allow), same IdP allowlist, autoredirect unchanged.CI=true pnpm check:changedexit 0;pnpm buildexit 0 with dist entrypoints present and noINEFFECTIVE_DYNAMIC_IMPORT; oxlint clean; autoreview clean.