scope_safety

Enforces filesystem and shell scope boundaries on every file and shell operation.

Updated Feb 26, 2026
One-click install
npx skills add https://github.com/Vimurai/ai-os --skill scope-safety-vimurai
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: scope_safety
Source: https://github.com/Vimurai/ai-os/tree/main/.claude/skills/scope_safety
Command: npx skills add https://github.com/Vimurai/ai-os --skill scope-safety-vimurai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? AI agents performing file and shell operations can accidentally or maliciously read, write, or execute outside the intended project scope, causing data leaks or system damage. This Skill applies mandatory guardrails to every operation so unauthorized paths and commands are blocked before they run. ## Core Features & Use Cases - Path Traversal Blocking: Rejects any path containing ../ and logs it as a P0 security issue in .ai/LOG.md. - Capability-Based Shell Control: Allows only shell commands explicitly listed in CAPABILITIES.md under shell.exec, with default-deny behavior for anything unlisted. - MCP Layer Alignment: Coordinates with the .mcp.json filesystem server so restrictions are enforced at the MCP layer, and respects PreToolUse secret-scan hook blocks. - Use Case: When an agent attempts to write a file outside the repository root or run an unapproved shell command, the operation is stopped and a Capability Gate decision is proposed instead. ## Quick Start Ask the agent to verify that the current file operation stays within the repository root and complies with CAPABILITIES.md before executing it.

Frequently Asked Questions about scope_safety

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I restrict an AI agent's filesystem access to the repo root?▼

Define allowed paths in CAPABILITIES.md and apply default-deny rules that reject any path outside the repository root. Paths containing ../ are blocked automatically and logged as P0 security issues in .ai/LOG.md.

How do I control which shell commands an AI agent can run?▼

List permitted commands in CAPABILITIES.md under the shell.exec section. Any command not explicitly listed is denied by default, and the agent must stop and propose a Capability Gate decision instead of executing.

Does this work with MCP filesystem servers?▼

Yes, the rules are designed to align with the .mcp.json filesystem server, which enforces the same scope restrictions at the MCP layer. This provides defense in depth beyond prompt-level instructions.

What happens when a write is blocked by the secret scan hook?▼

The PreToolUse secret scan hook block must not be bypassed. The correct response is to fix the file content so it no longer contains the detected secret, then retry the write operation.

What are the limitations of prompt-based scope enforcement?▼

Prompt-level rules depend on the agent following instructions and can be weakened by adversarial input. For stronger guarantees, pair them with MCP-layer enforcement and hooks, as this Skill does with the filesystem server and secret scan.