permissions

permissions is a command for Claude Code from thapaliyabikendra/ai-artifacts. It costs 0 tokens per session (1,080 once invoked), scanned A, original, Apache-2.0.

A codebase audit for permissions in an ABP Framework application, a software framework for building business applications. It compares permission definitions with the places where those permissions are checked.

In plain words
What is it for?
Use it to scan C# permission definitions, find authorization checks, identify gaps, and produce an audit report.
Why use it?
It reveals permissions that are unused, missing, or inconsistently applied, which can cause access-control gaps.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit Use it to scan C# permission definitions, find authorization checks, identify gaps, and produce an audit report.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/thapaliyabikendra/ai-artifacts/permissions
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.

Clone the repo
git clone --depth 1 https://github.com/thapaliyabikendra/ai-artifacts

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for permissions

README.md
[![agentmods](https://agentmods.dev/badge/commands/thapaliyabikendra/ai-artifacts/permissions.svg)](https://agentmods.dev/commands/thapaliyabikendra/ai-artifacts/permissions)
Your own site
<a href="https://agentmods.dev/commands/thapaliyabikendra/ai-artifacts/permissions"><img src="https://agentmods.dev/badge/commands/thapaliyabikendra/ai-artifacts/permissions.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,080 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00000 $0.01080
Opus 5 $0.00000 $0.00540
Sonnet 5 $0.00000 $0.00216
Haiku 4.5 $0.00000 $0.00108

Measured 8d ago against content hash 74808cf97ff5, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

permissions scanned grade A with 0 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 8d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/review/permissions.md · 163 lines

How it starts

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

Review Permissions Command

Audit permission definitions and their usage in ABP Framework application.

Arguments: $ARGUMENTS

Pre-flight

Project: !basename $(pwd) Permissions File: !find api/src -name "*Permissions.cs" -path "*/Permissions/*" 2>/dev/null | head -1

Workflow

┌──────────────┐   ┌──────────────┐   ┌──────────────┐   ┌──────────────┐
│ 1. Scan      │ → │ 2. Check     │ → │ 3. Find      │ → │ 4. Generate  │
│ Definitions  │   │   Usage      │   │   Gaps       │   │   Report     │
└──────────────┘   └──────────────┘   └──────────────┘   └──────────────┘

Execution

Step 1: Scan Permission Definitions

Search for permission constants:

Pattern: public const string .* = .*Permission
Files: api/src/**/Permissions/*.cs

Extract all defined permissions into a list.

Step 2: Check Permission Usage

For each permission, search for usage:

In AppServices (Authorize attribute):

Pattern: \[Authorize\(.*{PermissionName}.*\)\]
Files: api/src/**/*AppService.cs

In code (AuthorizationService):

Pattern: AuthorizationService\.(Check|IsGranted).*{PermissionName}
Files: api/src/**/*.cs

In PermissionDefinitionProvider:

Pattern: AddPermission\(.*{PermissionName}
Files: api/src/**/*PermissionDefinitionProvider.cs

Step 3: Find Gaps

Unused Permissions:

  • Defined in Permissions.cs but never used in code

Unprotected Endpoints:

  • AppService methods without [Authorize] attribute
  • Mutations (Create, Update, Delete) without permission checks

Unregistered Permissions:

  • Used in code but not registered in PermissionDefinitionProvider

Step 4: Generate Report

Output Format

## Permission Audit Report

**Project**: {ProjectName}
**Date**: {Date}
**Total Permissions**: {Count}

### Permission Matrix

| Permission | AppService | Method | Status |
|------------|------------|--------|--------|
| {Group}.{Feature}.Create | {Feature}AppService | CreateAsync | ✓ Protected |
| {Group}.{Feature}.Edit | {Feature}AppService | UpdateAsync | ✓ Protected |
| {Group}.{Feature}.Delete | - | - | ⚠️ Unused |

### Unused Permissions (--unused)

| Permission | Defined In | Recommendation |
|------------|------------|----------------|
| {Group}.{Feature}.Export | {Project}Permissions.cs | Remove or implement |

### Unprotected Endpoints (--unprotected)

| AppService | Method | Risk | Recommendation |
|------------|--------|------|----------------|
| ReportAppService | GenerateAsync | HIGH | Add [Authorize] |
| PublicAppService | GetInfoAsync | LOW | Verify intentional |

### Role-Permission Matrix (--matrix)

| Permission | Admin | Role2 | Role3 |
|------------|-------|-------|-------|
| {Feature}.Create | ✓ | - | ✓ |
| {Feature}.Edit | ✓ | - | - |
| {Feature}.Delete | ✓ | - | - |

### Recommendations

1. **Remove unused permissions**: {List}
2. **Add protection to endpoints**: {List}
3. **Register missing permissions**: {List}

### Next Steps

- [ ] Review unused permissions with product owner
- [ ] Add [Authorize] to unprotected mutations
- [ ] Update role assignments if needed

Read the full file on GitHub · 163 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. 8d ago First seen · 163 lines · 0 tokens per session scan A 74808cf97ff5

Subscribe to this mod's changes

permissions is a command published in the GitHub repository thapaliyabikendra/ai-artifacts (24 stars, last pushed 5mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 1,080 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.