drvoss/everything-copilot-cli/agent-governance
Claude Code and agent skill by drvoss/everything-copilot-cli
- community
Checking that the SKILL.md file is still in the repository.
Use when designing or reviewing an AI agent system that needs policy-based access controls, intent classification, tool-level rate limiting, trust scoring for multi-agent workflows, or append-only audit trails.
Install
npx vskill@latest install drvoss/everything-copilot-cli/agent-governanceSKILL.md
The same SKILL.md was published earlier as drvoss/everything-copilot-cli/agent-governance.
Agent Governance
Add explicit policy, trust, and audit controls around agent behavior before "helpful" automation becomes unbounded automation.
When to Use
- Designing an agent that can call tools, APIs, databases, or shell commands
- Reviewing a multi-agent workflow that needs trust boundaries between specialists
- Defining when an action should be allowed, denied, or escalated for approval
- Adding audit requirements, rate limits, or policy configuration to an existing system
When NOT to Use
| Instead of agent-governance | Use | |
|---|---|---|
| Broad repository security scoring | evaluate-repository | |
| OWASP ASI checklist review | agent-owasp-check | |
| Architecture-first threat modeling | threat-model-analyst |
Governance Model
Think in this order:
A useful governance layer usually needs five parts:
- policy definition
- intent classification
- tool-level enforcement
- trust scoring
- append-only audit trail
Workflow
1. Define policy as configuration
Start with a serializable policy instead of hardcoding checks across business logic.
Include:
allowed_toolsblocked_toolsblocked_patternsmax_calls_per_requestrequire_human_approvalprofiletool_policies
Example shape:
Use "most restrictive wins" when composing org-wide, team, and agent-specific policies. Policy timing is part of enforcement: apply a skill's tool restriction when that skill is activated, not merely when its declaration is discovered. When a system supports a ToolPolicy schema, keep rate-limit, approval, and justification guards in that policy layer instead of scattering them across prompts, docs, and handler code.
If the policy file is missing, unreadable, or fails validation, fail closed: apply the strict profile and stop instead of falling through to a more permissive default.
Close policy paths where "nothing was checked" can be mistaken for "policy passed":
- Treat a missing required value and an absent constraint as different states. Avoid truthy chains
that let an empty string bypass the check; use explicit presence tests.
- Reject a rule with an empty match set when emptiness would otherwise match everything and silence
an escalation backstop.
- Reject supervisor or delegate registration above the deterministic trust root. Delegated
authority cannot exceed its root.
1-A. Keep dynamic conditions in policy, not prompts
When your policy layer supports dynamic conditions, keep them declarative and reviewable instead of burying them in agent instructions.
- Time-based: apply stricter profiles outside business hours, during weekends, or in incident mode
- Cost-aware: tighten tool access or require review when token or API spend crosses a defined threshold
- Trust-gated registration: require signed registration or proof-of-outcome evidence before a new agent or delegate is treated as trusted
Evaluate these conditions at the same enforcement boundary as your normal allow/deny/review checks. If the condition inputs are missing, stale, or unverifiable, fail closed instead of silently falling back to a permissive tier.
2. Classify intent before tool execution
Do not wait until after a tool runs to discover the request was dangerous. Blocking a result prevents propagation; it does not undo an already executed side effect. Treat post-execution interception as observation, not rollback, and gate irreversible operations first. Reserve budget before evaluation, then charge actual usage after execution, so concurrency cannot cross a limit before accounting notices.
Look for signals such as:
- data exfiltration intent
- privilege escalation requests
- destructive system modification
- prompt-injection phrasing
Keep the classifier simple and auditable first:
- pattern rules for obvious cases
- confidence scoring
- explicit review threshold for risky content
3. Enforce governance at the tool boundary
Every tool call should answer:
- is this tool allowed?
- does it require human approval?
- has the request exceeded the call budget?
- do the arguments contain blocked content?
Apply the checks at the boundary where the tool is actually invoked, not only in a planner or prompt template.
3-A. Scan untrusted fetched content before use
Treat external fetch results as an input boundary, not as pre-trusted working context.
Before using fetched content to guide tool calls, memory updates, or code changes, check for:
- tool-poisoning instructions hidden in docs, READMEs, or generated artifacts
- data-exfiltration phrasing such as "print secrets", "dump config", or "send environment"
- attempts to override local policy, approval rules, or task scope
At minimum:
- classify whether the source is maintainer-controlled or untrusted
- inspect the fetched content for dangerous instructions before acting on it
- require review when the fetched content would trigger shell, persistence, or credential-adjacent work
In strict mode, do not execute downstream actions from untrusted fetched content until this scan is complete.
3-B. Review wildcard permission scope, not just intent
Be careful with wildcard or glob-style permission rules in tool-approval systems such as --allow-tool patterns. A rule that looks narrowly intended on paper can still auto-approve a broader real scope than the author meant — for example, write(dir/**) may match deeply nested writes well beyond the reviewer's mental boundary.
When reviewing permission rules:
- check the actual match scope of every wildcard pattern
- prefer exact paths when the writable surface is supposed to stay small
- treat "looks right" as insufficient until the concrete expansion is understood
Shell rules are a common case. In Copilot CLI, tools such as git, gh, and npm are matched by the command plus its first subcommand only (copilot help permissions, CLI 1.0.114): shell(gh pr) matches gh pr create --fill, while shell(gh pr create) matches nothing. A rule written for one narrow action therefore either does nothing or, once widened to the form that works, also approves its siblings — shell(gh pr) lets gh pr merge and gh pr close run without a prompt. Deny rules are named the same way, so they cannot carve one sub-subcommand back out. When only one such action is acceptable, leave it unapproved and answer the prompt each time, or run the step outside the agent.
3-C. A denied tool is not a denied capability
Denying one tool blocks that tool, not the outcome the tool produced. An agent that cannot use a file-writing tool may still reach the same result through a shell command, an MCP server, or a network fetch — and it may do so inconsistently, so a single passing test proves nothing.
Measured on GitHub Copilot CLI 1.0.87: with only --deny-tool=write, the same prompt created the target file on one run and reported itself blocked on two others. Adding --deny-tool=shell and --deny-tool=url alongside it blocked the file on every run.
When you deny a capability:
- enumerate every tool that can produce the outcome, not just the obviously named one
- deny the whole set together — shell and network access are the usual bypass routes
- verify by observing the outcome, never by the agent's own report that it was blocked
- repeat the check; a permission gate that passes only sometimes is not a gate
3-D. Judge the command behind the wrapper
A command rule that matches only the first word is bypassed by wrapping. Before a shell command policy decides, normalize it to the command that will actually run:
| Form | Check | |
|---|---|---|
sudo rm -rf …, doas … | the wrapped command (rm) — and treat the privilege escalation itself as high-risk | |
xargs rm, find … -exec rm {} + | the command xargs or -exec will run | |
FOO=1 rm …, env FOO=1 rm … | the command after the assignments | |
bash -c "…", pwsh -Command "…" | the inner script, parsed again with the same rules | |
| text with zero-width or other invisible Unicode characters | strip default-ignorable characters before matching |
If normalization fails or the command cannot be parsed, fail closed: deny or ask, never allow. microsoft/agent-governance-toolkit fixed each of these bypasses in October 2026 (wrappers and assignments 3b8bdfc, sudo/doas/xargs 86db460, invisible-character evasion e9ccebe), and Copilot CLI's Assisted permissions likewise look inside nested bash -c and PowerShell commands so the permission judge evaluates what will actually run (v1.0.100). Write preToolUse hooks to the same standard.
3-E. Separate the agent that reads from the step that writes
Policy at the tool boundary decides whether a write is allowed; it cannot tell a legitimate PR from one an injected issue comment asked for. When an agent handles untrusted input, remove the direct write path altogether: the agent emits its intended writes (PR, comment, label, release) as data, a separate step inspects them, and only that step holds the write permission. github/gh-aw builds this in by default — agent jobs run read-only, and writes run in validated safe-outputs jobs with scoped permissions. Workflow authors can still grant direct write permissions or add custom jobs, so audit those as separate trust boundaries. See `github-pr-workflow` → Staged Writes for the interactive version.
4. Add trust scoring for delegated agents
Multi-agent systems need memory of which delegates are reliable.
Track at least:
- current trust score
- successes
- failures
- last updated time
Use trust thresholds to choose between:
- autonomous execution
- execution with human oversight
- denial or explicit re-approval
Trust should decay over time so stale reputation does not behave like permanent trust.
4-A. Harden trust boundaries explicitly
If remote identities, signed delegates, or service-issued agent credentials affect authorization, define the trust boundary before enabling autonomy:
- which issuers are trusted
- where keys come from (for example, JWKS or another signed metadata source)
- how revocation or key rotation is handled
- which agent roles are allowed to cross each boundary
Do not let planner, worker, verifier, and synthesizer roles silently share one flat trust zone when their permissions differ.
5. Keep an append-only audit trail
For every governed action, log:
- timestamp
- agent ID
- tool name
- action taken (
allowed,denied,error,review) - policy name
- supporting details such as duration, matched rule, or error
Export to JSONL or another append-only form that works with later incident review.
6. Choose an explicit policy profile
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 93 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/security/agent-governance/SKILL.md
Popularity
- Repository stars
- 37
- Repository forks
- 10
- 7-day trend score
- 18
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/drvoss/everything-copilot-cli/agent-governance)