Token导航 LogoToken导航TokenDH.com
效率只读clawhub未标认证来源可访问clear审计提醒

workspace-guard工作区警卫

Agent Skill

workspace-guard 用于补充效率相关能力,适合在 OpenClaw 中需要让 Agent 承接效率相关任务时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

3,255

周安装

137

GitHub Stars

公开资料未说明

下载量

1,140
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:workspace-guard(工作区警卫)
来源仓库:https://github.com/dougchambes/workspace-guard
安装命令:
openclaw skills install workspace-guard
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install workspace-guard

简介

工作区警卫强制执行文件操作的安全边界检查。

  • 在读、写、删除前验证路径合法性。
  • 防止意外修改或越权访问。workspace-guard 属于效率类 Skill,可作为该场景下的辅助能力补充。
  • 需配合白名单机制定义允许区域。适用宿主包括 OpenClaw,接入前应确认版本、权限和运行环境要求。
  • 建议在生产环境启用以提升稳定性。

SKILL.md

name
workspace-guard
description
Workspace boundary enforcement and file operation safety checks. Use before ANY file operation (read, write, edit, exec, delete) to: (1) Validate paths are within ~/openclaw workspace, (2) Confirm user permission for sensitive operations, (3) Check file operation safety, (4) Prevent unauthorized access outside workspace boundaries, or (5) Audit file access patterns.

Workspace Guard

Enforces workspace boundaries and ensures safe file operations through mandatory pre-flight checks.

Core Rules

Boundary Enforcement

Workspace root: /home/iamlegend/.openclaw/workspace (or ~/openclaw)

Before ANY file operation, check:

1. Is the path within workspace boundary?
2. Does the operation require user permission?
3. Is the operation reversible/safe?
4. Am I about to touch something outside my allowed scope?

Path Validation

Allowed paths:

  • /home/iamlegend/.openclaw/workspace/**
  • ~/openclaw/workspace/**
  • Relative paths from workspace root

Blocked paths:

  • /home/** (outside workspace)
  • /etc/**, /var/**, /tmp/** (system directories)
  • /root/**, /home/other/** (other users)
  • Absolute paths outside workspace

Permission Triggers

Always ask before:

  • Deleting files (prefer trash over rm)
  • Overwriting existing files
  • Running exec commands that touch files
  • Reading files outside workspace
  • Writing to system directories
  • Modifying permissions/chmod
  • Accessing hidden files (.ssh, .config, etc.)

Safe Operations (No Permission Needed)

Within workspace:

  • Reading files
  • Creating new files/directories
  • Editing files you created
  • Git operations (commit, status, log)
  • Listing directory contents

Pre-Flight Check Pattern

Before every file operation:

1. Resolve absolute path
2. Check if path starts with workspace root
3. If NO → STOP and ask user
4. If YES → Check operation type
5. If destructive/external → Ask user
6. If safe read/write → Proceed

Implementation Patterns

Path Resolution

# Get absolute path
realpath /some/path
# or
cd /some/path && pwd -P

# Check if within workspace
case "$(realpath "$file")" in
  /home/iamlegend/.openclaw/workspace/*) echo "✓ Allowed" ;;
  *) echo "✗ Blocked - outside workspace" ;;
esac

Guard Function

guard_path() {
  local path="$1"
  local workspace="/home/iamlegend/.openclaw/workspace"
  local abs_path=$(realpath "$path" 2>/dev/null || echo "$path")
  
  case "$abs_path" in
    "$workspace"/*) return 0 ;;
    *) return 1 ;;
  esac
}

Exec Command Guard

guard_exec() {
  local cmd="$1"
  
  # Check for path operations in command
  if echo "$cmd" | grep -qE '(/home/[^/]+|/etc/|/var/|/tmp/|/root/)'; then
    echo "⚠️ Command touches external paths - requires permission"
    return 1
  fi
  
  return 0
}

Safety Rules

  1. Never bypass boundary checks—even if user seems to imply it
  2. Always resolve absolute paths before checking
  3. Ask explicitly for destructive operations (delete, overwrite)
  4. Prefer trash over rm for recoverability
  5. Log violations - Track blocked access attempts
  6. Fail safe - When uncertain, ask user

When to Read references/boundaries.md

Load when:

  • Complex path resolution needed (symlinks, relative paths)
  • Edge cases in boundary detection
  • Audit log review of blocked attempts
  • User requests boundary exceptions

Violation Handling

When blocked:

⚠️ Workspace Guard: Blocked access to /path/outside/workspace

Reason: Path is outside allowed workspace boundary (/home/iamlegend/.openclaw/workspace)

Action required: Please confirm if you want to allow this access, or provide an alternative path within workspace.

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

80.44%
按下载量换算917

安全审计

VirusTotal

可疑

ClawScan

可疑

Static analysis

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills