Back to Sentry Javascript

Permission Analysis

.agents/skills/skill-scanner/references/permission-analysis.md

10.51.05.7 KB
Original Source

Permission Analysis

Framework for evaluating tool permissions granted to agent skills.

Tool Risk Tiers

TierToolsRisk LevelNotes
Tier 1 — Read-OnlyRead, Grep, GlobLowCannot modify anything; safe for analysis skills
Tier 2 — ExecutionBashMediumCan run arbitrary commands; should have clear justification
Tier 3 — ModificationWrite, Edit, NotebookEditHighCan modify files; verify the skill needs to create/edit files
Tier 4 — NetworkWebFetch, WebSearchHighCan access external URLs; verify domains are necessary
Tier 5 — DelegationTaskHighCan spawn subagents; increases attack surface
Tier 6 — Unrestricted* (wildcard)CriticalFull access to all tools; almost never justified

Least Privilege Assessment

For each tool in allowed-tools, verify:

  1. Is it referenced? Does the SKILL.md body mention operations requiring this tool?
  2. Is it necessary? Could the skill achieve its purpose without this tool?
  3. Is the scope minimal? Could a more restrictive tool achieve the same result?

Assessment Checklist

ToolJustified WhenUnjustified When
ReadSkill reads files for analysis— (almost always justified)
GrepSkill searches file contents— (almost always justified)
GlobSkill finds files by pattern— (almost always justified)
BashRunning bundled scripts (uv run), git/gh CLI, build toolsNo scripts or CLI commands in instructions
WriteSkill creates new files (reports, configs)Skill only reads and analyzes
EditSkill modifies existing filesSkill only reads and analyzes
WebFetchSkill fetches external documentation or APIsNo URLs referenced in instructions
WebSearchSkill needs to search the webNo search-dependent logic
TaskSkill delegates to subagents for parallel workCould run sequentially without delegation

Common Permission Profiles

Expected tool sets by skill type:

Analysis / Review Skills

  • Expected: Read, Grep, Glob or Read, Grep, Glob, Bash
  • Bash justification: Running linters, type checkers, or bundled scripts
  • Examples: code-review, security-review, find-bugs

Workflow Automation Skills

  • Expected: Read, Grep, Glob, Bash
  • Bash justification: Git operations, CI commands, gh CLI
  • Examples: commit, pr-writer, iterate-pr

Content Generation Skills

  • Expected: Read, Grep, Glob, Write or Read, Grep, Glob, Bash, Write, Edit
  • Write/Edit justification: Creating or modifying documentation, configs
  • Examples: agents-md, doc-coauthoring

External-Facing Skills

  • Expected: Read, Grep, Glob, Bash, WebFetch
  • WebFetch justification: Fetching documentation, API specs
  • Flag if: WebFetch is present but no URLs appear in skill instructions

Full-Access Skills

  • Expected: Almost never
  • If seen: Requires strong justification — the skill should be doing something that genuinely needs broad access
  • Flag: * wildcard, or more than 5 distinct tools

Red Flags

Combinations and patterns that warrant scrutiny:

PatternConcern
Bash + no scripts in skill directoryWhy does it need shell access?
Write or Edit + skill described as "analysis" or "review"Analysis skills shouldn't modify files
WebFetch + no URLs in instructionsWhat is it fetching?
Task + Bash + WriteCan spawn subagents with write access — high risk
* (unrestricted)Maximum attack surface; almost never appropriate
Tools granted but never referenced in instructionsOverly permissive; violates least privilege

Scoring

Rate the overall permission profile:

RatingCriteria
AppropriateAll tools justified and minimal for the skill's purpose
Slightly Overpermissioned1-2 tools not clearly needed; low risk
OverpermissionedMultiple unnecessary tools; medium risk
Dangerously OverpermissionedUnrestricted access or many high-tier tools without justification