Token导航 LogoToken导航TokenDH.com
研究检索操作浏览器github未标认证来源可访问clear审计通过

ac-security-sandbox交流安全沙箱

Agent Skill

用于辅助安全审计、权限检查、凭据风险、认证流程和常见漏洞排查。它适合让 Agent 梳理敏感配置、检查依赖风险、分析鉴权逻辑或生成安全复核清单。使用时不能把工具输出直接当最终结论,涉及密钥、令牌、用户数据或生产系统时,应先确认最小权限、脱敏方式和操作边界。

总安装

353

周安装

15

GitHub Stars

9

下载量

124
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

请帮我安装这个 Agent Skill:ac-security-sandbox(交流安全沙箱)
来源仓库:https://github.com/adaptationio/skrillz
仓库路径:skills/ac-security-sandbox
安装命令:
npx skills add https://github.com/adaptationio/skrillz --skill ac-security-sandbox
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/adaptationio/skrillz --skill ac-security-sandbox

简介

提供多层安全防护,用于隔离执行环境并限制危险命令。

  • 适用于安全审计、依赖风险检查和鉴权逻辑分析场景。
  • 通过 SecuritySandbox 实例验证命令是否在白名单内,支持配置允许执行的指令集。
  • 安装命令为 npx skills add https://github.com/adaptationio/skrillz --skill ac-security-sandbox。
  • 不能将输出作为最终结论,涉及密钥或生产数据时应先脱敏并确认最小权限。

SKILL.md

AC Security Sandbox

Defense-in-depth security for autonomous code execution.

Overview

Provides three layers of security:

  1. OS-Level Sandbox: Isolated execution environment
  2. Filesystem Permissions: Restricted path access
  3. Command Allowlist: Pre-approved commands only

Quick Start

Validate Command

from scripts.security_sandbox import SecuritySandbox

sandbox = SecuritySandbox(project_dir)

# Check if command is allowed
is_safe, reason = sandbox.validate_command("npm install")
if is_safe:
    # Execute command
    pass
else:
    print(f"Blocked: {reason}")

Configure Allowlist

sandbox.configure_allowlist([
    "ls", "cat", "head", "tail",
    "npm", "node", "python",
    "git", "grep"
])

Security Layers

Layer 1: OS-Level Sandbox

# Enable sandbox mode
sandbox_config = {
    "enabled": True,
    "isolation": "strict",
    "network": "restricted"
}

Layer 2: Filesystem Permissions

permissions = {
    "allow": [
        "Read(./**)",      # Read project files
        "Write(./**)",     # Write project files
        "Edit(./**)",      # Edit project files
    ],
    "deny": [
        "Read(/etc/**)",   # No system files
        "Write(/usr/**)",  # No system writes
        "Bash(rm -rf /)",  # No destructive commands
    ]
}

Layer 3: Command Allowlist

ALLOWED_COMMANDS = {
    # File inspection
    "ls", "cat", "head", "tail", "wc", "grep", "find",

    # File operations
    "cp", "mv", "mkdir", "chmod", "touch",

    # Node.js
    "npm", "node", "npx", "yarn", "pnpm",

    # Python
    "python", "python3", "pip", "pip3",

    # Version control
    "git",

    # Process management
    "ps", "lsof", "sleep", "pkill",

    # Build tools
    "make", "cmake", "cargo", "go",

    # Testing
    "jest", "pytest", "vitest", "playwright"
}

Command Validation

Pre-Tool-Use Hook

async def bash_security_hook(input_data, tool_use_id, context):
    command = input_data.get("tool_input", {}).get("command", "")

    # Extract all commands (handles pipes, &&, etc.)
    commands = extract_commands(command)

    for cmd in commands:
        if cmd not in ALLOWED_COMMANDS:
            return {
                "decision": "block",
                "reason": f"Command '{cmd}' not in allowlist"
            }

    return {}  # Allow execution

Command Extraction

def extract_commands(command: str) -> list[str]:
    """
    Extract base commands from complex command strings.

    Examples:
        "npm install && npm test" → ["npm", "npm"]
        "cat file.txt | grep error" → ["cat", "grep"]
        "git add . && git commit -m 'msg'" → ["git", "git"]
    """
    # Parse command string
    # Handle: pipes (|), chains (&&, ||), semicolons (;)
    # Return list of base command names

Blocked Command Patterns

Always Blocked

DANGEROUS_PATTERNS = [
    r"rm\s+-rf\s+/",       # Recursive delete root
    r"dd\s+if=",           # Direct disk writes
    r"mkfs",               # Format filesystems
    r":(){ :|:& };:",      # Fork bombs
    r"chmod\s+777",        # Overly permissive
    r"curl.*\|\s*bash",    # Pipe to shell
    r"wget.*\|\s*sh",      # Pipe to shell
]

Context-Dependent

# Allowed in project directory only
RESTRICTED_COMMANDS = {
    "rm": lambda path: path.startswith("./"),
    "mv": lambda src, dst: src.startswith("./") and dst.startswith("./"),
    "cp": lambda src, dst: dst.startswith("./"),
}

Configuration

.claude/security-config.json

{
  "sandbox": {
    "enabled": true,
    "isolation": "strict"
  },
  "permissions": {
    "filesystem": {
      "read": ["./**", "~/.config/claude/**"],
      "write": ["./**"],
      "deny": ["/etc/**", "/usr/**", "~/.ssh/**"]
    },
    "network": {
      "allow": ["localhost", "api.anthropic.com"],
      "deny": ["*"]
    }
  },
  "allowlist": {
    "commands": ["npm", "node", "git", "python"],
    "custom": []
  }
}

Operations

1. Initialize Sandbox

sandbox = SecuritySandbox(project_dir)
await sandbox.initialize()
# Loads config, sets up hooks

2. Validate Command

is_safe, reason = sandbox.validate_command(command)
# Returns (True, None) or (False, "reason")

3. Validate Path

is_allowed = sandbox.validate_path(path, operation="write")
# Checks against filesystem permissions

4. Register Hook

hook = sandbox.create_pre_tool_hook()
# Returns hook function for Claude SDK

5. Add Custom Command

sandbox.add_allowed_command("my-custom-tool")
# Adds to allowlist (persists to config)

6. Audit Log

# Get recent security events
events = sandbox.get_audit_log(limit=100)
for event in events:
    print(f"{event.timestamp}: {event.action} - {event.command}")

Audit Logging

All security decisions are logged:

// .claude/security-audit.jsonl
{"timestamp": "2025-01-15T10:00:00Z", "action": "ALLOW", "command": "npm install", "reason": null}
{"timestamp": "2025-01-15T10:01:00Z", "action": "BLOCK", "command": "rm -rf /", "reason": "Dangerous pattern"}
{"timestamp": "2025-01-15T10:02:00Z", "action": "ALLOW", "command": "git commit", "reason": null}

Best Practices

DO

  • Start with minimal allowlist
  • Add commands as needed
  • Review audit logs regularly
  • Use project-relative paths

DON'T

  • Allow sudo commands
  • Allow system path writes
  • Disable sandbox in production
  • Ignore blocked command logs

Integration Points

  • ac-session-manager: Provides security hooks
  • ac-build-runner: Validates build commands
  • ac-coder-agent: Restricts agent commands
  • ac-config-manager: Loads security config

References

  • references/ALLOWLIST.md - Complete command list
  • references/PATTERNS.md - Blocked patterns
  • references/AUDIT.md - Audit log format

Scripts

  • scripts/security_sandbox.py - Core SecuritySandbox
  • scripts/command_validator.py - Command validation
  • scripts/path_validator.py - Path validation
  • scripts/audit_logger.py - Security audit logging

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

能力 5

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

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

平台分布

github-copilot

28.89%
按下载量换算36

Claude Code

20.91%
按下载量换算26

mcpjam

16.23%
按下载量换算20

moltbot

12.55%
按下载量换算16

windsurf

6.88%
按下载量换算9

zencoder

3.29%
按下载量换算4

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills