Skip to content

Extend normal creation with private permissions and atomic publication #482

Closed

Description

@steipete

Problem

OpenClaw duplicates complete-file publication and private Windows creation because the ordinary fs-safe creation APIs do not expose all of those guarantees. Privacy should be a creation option instead of a growing family of private-specific methods.

Accepted direction

  • Add private: true to normal directory and file creation, using restrictive POSIX permissions or protected Windows ACLs from the moment the object exists. Existing directories must satisfy the requested policy; do not silently repair their permissions or modify existing ancestors.
  • Add atomic: true to buffered Root.create() and forward it through createJson(). Streamed creation already stages complete contents. Atomic visibility remains distinct from durability, and callers requesting it must not receive a weaker direct-write fallback.
  • Reuse current guarded creation/staging owners and the existing Windows system-command fallback. Preserve confinement, live mutation authority, existing entries, native-mode behavior, and originating descriptor ownership.
  • Surface cleanup/close failures with accurate publication state. Resolve strict file-flush behavior independently of atomic visibility; keep directory-sync limitations explicit.
  • Provide ordinary synchronous creation operations where the SQLite consumers require them, with the same privacy policy and an owned disposable file descriptor rather than an unowned number.

Validation and rollout

Exercise real filesystem creation, collisions, failures, permissions, cancellation, and installed-package behavior on macOS, Linux, and Windows, including native-off operation. Keep existing published APIs compatible and document new options and platform limitations.

This work does not authorize a package release. OpenClaw adoption of new APIs remains unmerged until those APIs are published.

Activity

  1. added
    P2
    impact:security
    issue-rating: 🌊 off-meta tidepool
    on Sep 18, 2026
  2. clawsweeper commented on Sep 18, 2026

    @clawsweeper
    Contributor

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed September 18, 2026, 2:57 PM ET / 18:57 UTC.

    Summary
    Keep open: current main provides reusable staging and Windows security helpers, but normal creation still lacks the requested privacy, atomic-publication, and synchronous ownership contracts. No open PR currently owns this implementation.

    Reproducibility: not applicable. this requests new guarantees and APIs; source, documentation, and existing tests establish the current limitations without executing a reproduction.

    Ways to help us reproduce this

    • Add a screenshot or short recording showing the behavior.
    • Add expected vs actual behavior.

    Next step
    Route implementation through the filesystem-security owners; the accepted scope spans public APIs and platform authority boundaries beyond a bounded automatic repair.

    Security
    None.

    Review details

    Best possible solution:

    Extend the existing guarded owners with opt-in guarantees, preserve defaults and existing entries, and validate installed packages across platforms before separately authorized publication and consumer adoption.

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

    Not applicable: this requests new guarantees and APIs; source, documentation, and existing tests establish the current limitations without executing a reproduction.

    Is this the best way to solve the issue?

    Yes: extending ordinary creation and reusing guarded staging is consistent with the existing architecture; private stores and streamed creation cover only parts of the requested contract.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • Cross-platform private creation, strict file-flush semantics, and synchronous descriptor settlement still require implementation and validation.

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

    Label changes

    Label changes:

    • add P2: This is a concrete creation-API improvement with substantial remaining work, without evidence of an active emergency.
    • add impact:security: The request governs creation-time permissions, Windows ACLs, confinement, live mutation authority, and descriptor ownership.
    • add issue-rating: 🌊 off-meta tidepool: Current issue advisory state selects this label.

    Label justifications:

    • P2: This is a concrete creation-API improvement with substantial remaining work, without evidence of an active emergency.
    • impact:security: The request governs creation-time permissions, Windows ACLs, confinement, live mutation authority, and descriptor ownership.
    Evidence reviewed

    What I checked:

    • Requested options remain absent: RootCreateOptions derives from RootWriteOptions without private or atomic options; RootMkdirOptions likewise has no privacy option. Root.createJson forwards creation options, but cannot expose guarantees absent from those options. (src/root-options.ts:66, 34156e0730f5)
    • Buffered fallback still publishes before writing: The guarded fallback handles buffered create-only input by opening the final name with O_CREAT and O_EXCL before writing content. docs/writing.md lines 140–147 documents this limitation, and test/root-create-publication.test.ts explicitly expects an empty destination to be visible before writing in native-off mode. (src/pinned-write.ts:327, 34156e0730f5)
    • Existing staging is a useful foundation: Streamed creation already stages complete content, using native no-replace rename or guarded JavaScript hardlink publication. Its documented collision, cancellation, authority, and post-publication cleanup semantics provide an existing owner to extend. (docs/writing.md:186, 34156e0730f5)
    • Existing private stores do not fulfill ordinary creation: Private FileStore mode exists, including synchronous text/JSON writes, but the synchronous store retains permission-repair behavior on POSIX and does not provide the requested ordinary creation descriptor contract. Root's public creation methods remain asynchronous. (docs/private-file-store.md:38, 34156e0730f5)
    • Merged Windows prerequisite: GitHub verifies feat(windows): support secure operations without native addon #476 as merged at the reviewed main SHA. It adds protected private-directory creation through the Windows system-command fallback while keeping native require mode strict; it does not add the requested ordinary creation options. (src/private-directory.ts:37, 34156e0730f5)
    • Release boundary: The latest published release is v0.15.0. The Windows command fallback is listed under Unreleased, and no local release tag contains its main commit. The normal creation option definitions are unchanged between the v0.15.0 release commit and reviewed main. (CHANGELOG.md:3, 34156e0730f5)

    Likely related people:

    • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
    • openclaw/openclaw-secops: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
    How this review workflow works
    • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
    • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
    • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
    • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
    • Maintainers can also comment @clawsweeper review to request a fresh review only.
    • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
    • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
  3. added a commit that references this issue on Oct 16, 2026
    edb9227
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2impact:securityissue-rating: 🌊 off-meta tidepool

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions