ai-governance

ai-governance is a command for Claude Code from nitinjain999/platform-skills. It costs 83 tokens per session (3,903 once invoked), scanned D, original, Apache-2.0.

A policy system for AI coding agents such as Copilot and Claude Code. It checks agent actions in real time and adds a merge-time check for changes that bypass those checks.

In plain words
What is it for?
Use it to generate or explain repository policies, test a file path, command, or code change, and audit repositories for missing or outdated AI policies.
Why use it?
It helps prevent agents from editing protected files or running dangerous commands, while giving the repository a second safety check before changes are merged.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: reads .claude/ paths; mentions Claude Code; mentions Codex.

Part of the platform-skills plugin — 1 skill, 43 commands shipped together

Good fit Use it to generate or explain repository policies, test a file path, command, or code change, and audit repositories for missing or outdated AI policies.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/nitinjain999/platform-skills/ai-governance
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/nitinjain999/platform-skills

Made for: Claude Code.

Or install platform-skills, the plugin that ships this one along with the rest of its 1 skill, 43 commands.

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 ai-governance

README.md
[![agentmods](https://agentmods.dev/badge/commands/nitinjain999/platform-skills/ai-governance/github.svg)](https://agentmods.dev/commands/nitinjain999/platform-skills/ai-governance)
Your own site
<a href="https://agentmods.dev/commands/nitinjain999/platform-skills/ai-governance"><img src="https://agentmods.dev/badge/commands/nitinjain999/platform-skills/ai-governance/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ai-governance

Your own site · 80×15
<a href="https://agentmods.dev/commands/nitinjain999/platform-skills/ai-governance"><img src="https://agentmods.dev/badge/commands/nitinjain999/platform-skills/ai-governance.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 83 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,903 The whole file, excluding the scripts and references it only reads on demand.
Security scan D 3 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.00083 $0.03903
Opus 5 $0.00042 $0.01951
Sonnet 5 $0.00017 $0.00781
Haiku 4.5 $0.00008 $0.00390

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

Security

Grade D, and why

ai-governance scanned grade D with 3 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 11d 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 install -m 0755 /tmp/yq /usr/local/bin/yq

Recursive force deletehighDestructive command

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

- "rm -rf"

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -fsSL -o /tmp/yq \
commands/ai-governance.md · 255 lines

How it starts

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

Generate and enforce a policy gate for AI coding agents operating on this repo: real-time session hooks for Copilot and Claude Code, plus a merge-time GitHub Actions check that catches anything the hooks miss.

Read references/ai-governance.md before responding.


Interactive Wizard (fires when no arguments are provided)

When invoked with no arguments, ask before proceeding:

Q1 — Mode?

What do you need?
  1. generate — scaffold policy, evaluator, hooks, and merge-time check
  2. check    — dry-run the evaluator against a path, command, or diff
  3. audit    — scan repos in an org for policy presence, tier, and drift
  4. explain  — plain-English translation of an existing .ai-governance.yaml

Enter 1-4 or mode name:

Q2 — Context (after mode selected, one at a time):

  • generate: Which default policy pack? (terraform / kubernetes / generic / blank)
  • check: Give me a file path, a command string, or a diff range (e.g. main...HEAD) to test:
  • audit: Which org or repo list should I scan?
  • explain: Path to the .ai-governance.yaml to explain (default: ./.ai-governance.yaml):

Then proceed into the relevant mode below.


Mode: generate

Scaffold the policy file, evaluator, session hooks, and merge-time check for this repo.

Steps:

  1. Detect which AI tools are configured (.github/copilot/, .claude/, .cursor/, .codex/ if present) and which CI system is in use — reuse the scan approach setup-agents.md already implements; do not reimplement it.

  2. Write .ai-governance.yaml with the chosen default pack. All packs share this shape; only protected_paths differs:

    generic:

    version: 1
    source: local
    enforcement: audit
    protected_paths:
      - ".github/workflows/**"
      - ".github/hooks/**"
      - ".claude/settings.json"
      - ".ai-governance.yaml"
      - ".ai-governance/**"
      - "**/secrets/**"
    denied_commands:
      - "rm -rf"
      - "git push --force"
    max_diff_files: 25
    require_disclosure: true
    

Read the full file on GitHub · 255 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. 11d ago First seen · 255 lines · 83 tokens per session scan D dad6acc13e02

Subscribe to this mod's changes

ai-governance is a command published in the GitHub repository nitinjain999/platform-skills (41 stars, last pushed today), licensed Apache-2.0. It adds 83 tokens to every session and 3,903 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it D with 3 findings (asks for root, recursive force delete, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.