@openclaw/fs-safe provides capability-style filesystem roots and related
primitives for Node.js applications that handle untrusted paths.
Filesystem boundaries, identity checks, archive extraction, permissions, and secret handling are security-sensitive public contracts.
- GitHub:
https://github.com/openclaw/fs-safe - npm:
https://www.npmjs.com/package/@openclaw/fs-safe - Docs:
https://fs-safe.io - Default branch:
main - Runtime: Node.js
>=22 - Package manager:
pnpm; use the version declared inpackage.json - Human contribution guide:
CONTRIBUTING.md - Security policy:
SECURITY.md
CLAUDE.md is a compatibility symlink to this file. Edit AGENTS.md only.
Shared maintainer skills live in openclaw/agent-skills; do not vendor copies
into this repository unless a repo-specific snapshot is intentionally required.
- Never weaken root confinement, path normalization, symlink or hardlink rejection, post-operation identity checks, or pinned file behavior.
- Treat pathnames as attacker-controlled unless a public API explicitly says otherwise.
- Keep unsafe fallback behavior explicit, bounded, and documented.
- Preserve fail-closed behavior for ambiguous filesystem identity and ownership states.
- Add focused regression tests for traversal, swap races, archive extraction, permissions, secret files, and platform-specific fallbacks.
- Do not add raw filesystem primitives that bypass the shared guarded helpers.
- Keep exports, generated declarations, README examples, and docs aligned.
- Treat exported types, error codes, option defaults, and package subpaths as compatibility surfaces.
- Update
CHANGELOG.mdunderUnreleasedfor public, security, compatibility, package, or operational changes. - Never commit generated
dist/output. - Releases are tag-driven from
mainthrough.github/workflows/release.yml; never publish locally or add npm tokens.
Use repository scripts rather than invoking underlying tools directly:
pnpm build
pnpm test
pnpm test:security
pnpm check
pnpm pack:checkRun the smallest relevant test while iterating. Run pnpm check and
git diff --check before handoff.
- Keep one logical concern per change.
- Use conventional commit and pull request titles.
- Do not edit dependency lockfiles by hand.
- Never commit credentials, private paths, private hosts, or unredacted logs.
- Run the shared
autoreviewskill before shipping non-trivial changes.