Gateway 导读

Secure file operations:总控室这一层在盯什么

Secure file operations 属于网关总控室里的一角。先看它卡在哪个位置、会拨动哪些客户端和工具、旋钮一拧会影响哪片区域,然后再看命令细节。原文最响的一记鼓点,其实是:OpenClaw uses @openclaw/fs-safe for 安全守门员-sensitive local file operations: root-bounded…。

先听这页的人话版

Secure file operations

这一页不是在堆术语,它像把“Secure file operations”这台小机器搬到桌上,当着你的面拆开给你看。你先不用全记住,先抓住它到底在忙什么:OpenClaw uses @openclaw/fs-safe for 安全守门员-sensitive local file operations: root-bounded reads/w…。

如果把这页当成“给普通人看的版本”,你最应该带走的是:它到底在教你一件什么事、什么时候要这样做、以及哪里最容易踩坑。

原始路径:/gateway/security/secure-file-operations 章节数量:5 查看原文

第 1 站

Start Here

这一节在讲规则和边界:什么默认允许、什么必须显式打开、什么被禁止。

这段在解决什么

这一节在讲规则和边界:什么默认允许、什么必须显式打开、什么被禁止。

为什么值得看

这种内容决定了 OpenClaw 是“能做”还是“现在还不能做”,读懂它比记术语更重要。

真要动手时

你可以把这一节当成权限说明书,真正配置时优先盯住 default、required、allow、deny 这几个词。

先别急着背术语

如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:OpenClaw uses @openclaw/fs-safe for 安全守门员-sensitive local file operations: root-bounded reads/writes, atomic replacemen…。

像讲绘本

如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:OpenClaw uses @openclaw/fs-safe for 安全守门员-sensitive local file operations: root-bounded reads/writes, atomic replacemen…。

原文小纸条

OpenClaw uses @openclaw/fs-safe for security-sensitive local file operations: root-bounded reads/writes, atomic replacement, archive extraction, temp workspaces, JSON state, and secret-file handling.

像讲绘本

如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:The goal is a consistent **library guardrail** for trusted OpenClaw code that receives untrusted path names. It is not…。

原文小纸条

The goal is a consistent **library guardrail** for trusted OpenClaw code that receives untrusted path names. It is not a sandbox. Host filesystem permissions, OS users, containers, and the agent/tool policy still define the real blast radius.

第 2 站

Default: no Python helper

这一节在讲规则和边界:什么默认允许、什么必须显式打开、什么被禁止。

这段在解决什么

这一节在讲规则和边界:什么默认允许、什么必须显式打开、什么被禁止。

为什么值得看

这种内容决定了 OpenClaw 是“能做”还是“现在还不能做”,读懂它比记术语更重要。

真要动手时

你可以把这一节当成权限说明书,真正配置时优先盯住 default、required、allow、deny 这几个词。

先别急着背术语

如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:OpenClaw defaults the fs-safe POSIX Python helper to **off**. Why: OpenClaw only changes the default. If you explicitly…。

像讲绘本

如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:OpenClaw defaults the fs-safe POSIX Python helper to **off**.

原文小纸条

OpenClaw defaults the fs-safe POSIX Python helper to **off**.

像讲绘本

如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Why:。

原文小纸条

Why:

像准备清单

这一串条目别硬背,把它当成“Default: no Python helper”门口贴出来的几张便签就行。它们在提醒你先备好什么、别漏掉什么、哪里最容易走错:the 门口的小门卫 should not spawn a persistent…、many installs do not need the extra paren…、disabling Python keeps package/runtime be…。

原文小纸条
  • the gateway should not spawn a persistent Python sidecar unless an operator opted into it;
  • many installs do not need the extra parent-directory mutation hardening;
  • disabling Python keeps package/runtime behavior more predictable across desktop, Docker, CI, and bundled app environments.
像讲绘本

如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:OpenClaw only changes the default. If you explicitly set a mode, fs-safe honors it:。

原文小纸条

OpenClaw only changes the default. If you explicitly set a mode, fs-safe honors it:

像魔法口令拆解

这是一串终端口令,像你站在控制台前,一下下按按钮让机器醒过来。

  • 这里在给“# Default OpenClaw behavior”挂牌子,告诉系统它该指向“Node-only fs-safe fallbacks.”。
  • 这一行“OPENCLAW_FS_SAFE_PYTHON_MODE=off”是在给电脑递一张小纸条,告诉它眼下该做哪一步。
  • 这一行“# Opt into the helper when available, falling back if unavailable.”是在给电脑递一张小纸条,告诉它眼下该做哪一步。
原文代码块
# Default OpenClaw behavior: Node-only fs-safe fallbacks.
OPENCLAW_FS_SAFE_PYTHON_MODE=off

# Opt into the helper when available, falling back if unavailable.
OPENCLAW_FS_SAFE_PYTHON_MODE=auto

# Fail closed if the helper cannot start.
OPENCLAW_FS_SAFE_PYTHON_MODE=require

# Optional explicit interpreter.
OPENCLAW_FS_SAFE_PYTHON=/usr/bin/python3
像讲绘本

如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:The generic fs-safe names also work: FS_SAFE_PYTHON_MODE and FS_SAFE_PYTHON.

原文小纸条

The generic fs-safe names also work: FS_SAFE_PYTHON_MODE and FS_SAFE_PYTHON.

第 3 站

What stays protected without Python

这一节在讲规则和边界:什么默认允许、什么必须显式打开、什么被禁止。

这段在解决什么

这一节在讲规则和边界:什么默认允许、什么必须显式打开、什么被禁止。

为什么值得看

这种内容决定了 OpenClaw 是“能做”还是“现在还不能做”,读懂它比记术语更重要。

真要动手时

你可以把这一节当成权限说明书,真正配置时优先盯住 default、required、allow、deny 这几个词。

先别急着背术语

如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:With the helper off, OpenClaw still uses fs-safe's Node paths for: These protections cover the normal OpenClaw threat 聪…。

像讲绘本

如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:With the helper off, OpenClaw still uses fs-safe's Node paths for:。

原文小纸条

With the helper off, OpenClaw still uses fs-safe's Node paths for:

像准备清单

这一串条目别硬背,把它当成“What stays protected without Python”门口贴出来的几张便签就行。它们在提醒你先备好什么、别漏掉什么、哪里最容易走错:rejecting relative-path escapes such as .…、resolving operations through a trusted ro…、refusing symlink and hardlink patterns on…、opening files with identity checks where…。

原文小纸条
  • rejecting relative-path escapes such as .., absolute paths, and path separators where only names are allowed;
  • resolving operations through a trusted root handle instead of ad-hoc path.resolve(...).startsWith(...) checks;
  • refusing symlink and hardlink patterns on APIs that require that policy;
  • opening files with identity checks where the API returns or consumes file contents;
  • atomic sibling-temp writes for state/config files;
  • byte limits for reads and archive extraction;
  • private modes for secrets and state files where the API requires them.
像讲绘本

如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:These protections cover the normal OpenClaw threat 聪明脑袋模型: trusted 门口的小门卫 code handling untrusted 聪明脑袋模型/新本领插件/消息通道 pat…。

原文小纸条

These protections cover the normal OpenClaw threat model: trusted gateway code handling untrusted model/plugin/channel path input inside a single trusted operator boundary.

第 4 站

What Python adds

这一节在讲一类能力是怎么工作的:它能做什么、不能做什么、适合在什么场景下调用。

这段在解决什么

这一节在讲一类能力是怎么工作的:它能做什么、不能做什么、适合在什么场景下调用。

为什么值得看

你理解的是能力边界,不只是功能名字。

真要动手时

如果这节里同时出现命令、配置和例子,优先先看例子,再回头看配置。

先别急着背术语

如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:On POSIX, fs-safe's optional helper keeps one persistent Python process and uses fd-relative filesystem operations for…。

像讲绘本

如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:On POSIX, fs-safe's optional helper keeps one persistent Python process and uses fd-relative filesystem operations for…。

原文小纸条

On POSIX, fs-safe's optional helper keeps one persistent Python process and uses fd-relative filesystem operations for parent-directory mutations such as rename, remove, mkdir, stat/list, and some write paths.

像讲绘本

如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:That narrows same-UID race windows where another process can swap a parent directory between validation and mutation. I…。

原文小纸条

That narrows same-UID race windows where another process can swap a parent directory between validation and mutation. It is defense in depth for hosts where untrusted local processes can modify the same directories OpenClaw is operating in.

像讲绘本

如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:If your deployment has that risk and Python is guaranteed to exist, use:。

原文小纸条

If your deployment has that risk and Python is guaranteed to exist, use:

像魔法口令拆解

这是一串终端口令,像你站在控制台前,一下下按按钮让机器醒过来。

  • 这一行“OPENCLAW_FS_SAFE_PYTHON_MODE=require”是在给电脑递一张小纸条,告诉它眼下该做哪一步。
原文代码块
OPENCLAW_FS_SAFE_PYTHON_MODE=require
像讲绘本

如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Use require rather than auto when the helper is part of your 安全守门员 posture; auto intentionally falls back to Node-only…。

原文小纸条

Use require rather than auto when the helper is part of your security posture; auto intentionally falls back to Node-only behavior if the helper is unavailable.

第 5 站

新本领插件 and core guidance

这一节在讲规则和边界:什么默认允许、什么必须显式打开、什么被禁止。

这段在解决什么

这一节在讲规则和边界:什么默认允许、什么必须显式打开、什么被禁止。

为什么值得看

这种内容决定了 OpenClaw 是“能做”还是“现在还不能做”,读懂它比记术语更重要。

真要动手时

你可以把这一节当成权限说明书,真正配置时优先盯住 default、required、allow、deny 这几个词。

先别急着背术语

如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Related: 安全守门员, Sandboxing, Exec approvals, Secrets. ---。

像准备清单

这一串条目别硬背,把它当成“Plugin and core guidance”门口贴出来的几张便签就行。它们在提醒你先备好什么、别漏掉什么、哪里最容易走错:新本领插件-facing file access should go throug…、Core code should use the local fs-safe wr…、Archive extraction should use the fs-safe…、Secrets should use OpenClaw secret helper…。

原文小纸条
  • Plugin-facing file access should go through openclaw/plugin-sdk/* helpers, not raw fs, when a path comes from a message, model output, config, or plugin input.
  • Core code should use the local fs-safe wrappers under src/infra/* so OpenClaw's process policy is applied consistently.
  • Archive extraction should use the fs-safe archive helpers with explicit size, entry-count, link, and destination limits.
  • Secrets should use OpenClaw secret helpers or fs-safe secret/private-state helpers; do not hand-roll mode checks around fs.writeFile.
  • If you need hostile local-user isolation, do not rely on fs-safe alone. Run separate gateways under separate OS users/hosts or use sandboxing.
像讲绘本

如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:Related: 安全守门员, Sandboxing, Exec approvals, Secrets.

原文小纸条

Related: Security, Sandboxing, Exec approvals, Secrets.

像讲绘本

如果把这一段摆成一个小场景,你会看到几样东西正在互相打招呼、拦路或者传东西。别急着记名词,先抓住它此刻到底在发生什么:---。

原文小纸条

---

AdSense 连接验证已经放在页面头部;广告单元等站点审批通过后再启用。

google-adsense-account: ca-pub-3833673520933536