scope-guard

A guardrail for limiting which files or directories an agent may change. It defines writable areas, assigns ownership, and adds approval points before risky work begins.

In plain words
What is it for?
Containing refactors, migrations, infrastructure, authentication, billing, and other high-risk tasks to explicitly approved paths.
Why use it?
It reduces accidental changes outside the requested area and limits the damage from destructive commands or mistakes. It is useful when several agents work in parallel.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/drvoss/everything-copilot-cli/scope-guard
Any agent
npx skills add drvoss/everything-copilot-cli --skill scope-guard
Clone the repo
git clone --depth 1 https://github.com/drvoss/everything-copilot-cli

Made for: Claude Code, Codex.

Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,408 The whole file, excluding the scripts and references it only reads on demand.
Security scan D 2 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00040 $0.01408
Opus 5 $0.00020 $0.00704
Sonnet 5 $0.00008 $0.00282
Haiku 4.5 $0.00004 $0.00141

Measured 2d ago against content hash c4542359d556, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade D, and why

scope-guard scanned grade D with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

`sudo ...`, `watch ...`, `ionice ...`, and `setsid ...` do not make a risky action safe.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

`sudo rm -rf`, `env NODE_ENV=prod npm run migrate`, and `find . -delete` should all follow the
skills/copilot-exclusive/scope-guard/SKILL.md · 156 lines

How it starts

The opening of the file, as written. The whole thing — 156 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Scope Guard

Scope Guard is a Copilot-native way to reduce blast radius. It combines explicit file ownership, prompt-level boundaries, and approval checkpoints so the agent treats one area as writable and everything else as read-only unless you reopen the scope.

Why This is Copilot-Exclusive

Copilot CLI now has native preToolUse/postToolUse hooks that can allow/deny tool calls (see guides/hooks-to-github-actions.md), but scope-guard is still the right pattern when you want a boundary enforced through the planning/approval flow itself rather than a separate hook script. It combines several useful primitives:

  • Plan Mode approval before execution starts
  • Task delegation where each agent gets its own brief
  • Prompt-scoped ownership for exact paths, files, and stop conditions

This skill packages those primitives into a repeatable guardrail pattern for risky or tightly scoped work.

When to Use

  • Production code, infrastructure, migrations, auth, billing, or other high-risk surfaces
  • Refactors that should stay inside one directory or file set
  • Parallel agent work where each agent must own a separate writable area
  • Tasks that may involve destructive commands and need a pause before execution

When NOT to Use

Instead of scope-guard Use
You need full branch- or filesystem-level isolation workflow/using-git-worktrees
You want broad autonomous execution after the plan is approved copilot-exclusive/autopilot-patterns
The task is read-only research with no file edits Do a normal explore pass or use context-prime to load the relevant files first

Prerequisites

  • Know the exact writable path or file list
  • Decide what counts as a risky command for this task
  • Have a rollback path if the work matters enough to isolate further

Modes

Mode Intent Behavior
Careful Risk warning The agent must stop and ask before running destructive or high-impact commands
Freeze Path lock The agent may read broadly, but may only edit inside the named path or file list
Guard Careful + Freeze The agent stays inside the approved writable surface and pauses before risky commands

Read the full file on GitHub · 156 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 156 lines · 40 tokens per session scan D c4542359d556

Subscribe to this mod's changes

scope-guard is a skill published in the GitHub repository drvoss/everything-copilot-cli (45 stars, last pushed 5d ago), licensed MIT. It adds 40 tokens to every session and 1,408 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it D with 2 findings (asks for root, recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

winui-design

Use when designing, reviewing, or fixing WinUI 3: sample and control discovery with winapp find-ui, layout planning, control choice, Fluent Design alignment, Light/Dark/High Contrast theming, typography, spacing, brushes, accessibility, and XAML data-binding design. Load before authoring new XAML, reviewing UI PRs…

microsoft/win-dev-skills · 119 tokens

winui-dev-workflow

Build and run workflow for WinUI 3 apps with WinApp CLI 0.6+ — project creation with winapp new, project-mode winapp run, BuildAndRun.ps1 analyzer integration, crash diagnosis, and prerequisites. Use when creating, building, running, or fixing build errors in a WinUI 3 project.

microsoft/win-dev-skills · 73 tokens

winui-packaging

MSIX packaging, code signing, and distribution for WinUI 3 apps — build for release, certificate generation (winapp cert generate), certificate trust, code signing (winapp sign), self-contained deployment, CI/CD with GitHub Actions, and Microsoft Store submission. Use when preparing for release, creating MSIX…

microsoft/win-dev-skills · 86 tokens

winui-session-report

Analyze the current or a recent agent session (GitHub Copilot CLI or Claude Code) and generate a diagnostic report. Use only when the user explicitly asks for session feedback, agent debugging, or a review of what happened during a build session. Do not inspect session data automatically.

microsoft/win-dev-skills · 61 tokens

microsoft-build

Your companion for Microsoft Build 2026. Helps you find sessions relevant to your project, discover what's new for your tech stack, scaffold projects from sessions, and plan your event schedule. Activate when users mention sessions, schedule, what's new, Build, Ignite, AI Tour, Microsoft event, conference, or…

microsoft/Build-CLI · 109 tokens

journey-template

Create new agentic journeys from app ideas. Generates README.md (learner walkthrough), PLAN.md (AI-readable spec), and app-specific skills for OSS deployments. Supports any stack (Node.js, Python, .NET, Java, Swift, Kotlin) and Azure service (Container Apps, AKS, Functions, App Service). USE FOR: new journey, scaffold…

DanWahlin/github-azure-agentic-journeys · 153 tokens