Catalog PyPI
Back to packageRELEASE DETAILS

0.1.0

PyPI

ai-govern

CLI-first AI Governance platform that audits AI-enabled repositories for AI engineering best practices

agentsaiauditbest-practicescligovernancellm
Published3 Aug 2026
Direct dependencies20
Transitive dependenciesNot calculated

README

Version 0.1.0 documentation

AI Govern

"AI Govern verifies that your AI system is engineered correctly — not that your application code is written correctly."

PyPI version Python 3.12+ License: MIT

AI Govern is a CLI-first AI Governance platform that audits AI-enabled repositories for AI engineering best practices. Think of it as ESLint + Lighthouse + SonarQube — but exclusively for AI systems.


What It Does

AI Govern scans only the AI layer of your repository:

✅ Analyzes — CLAUDE.md, AGENTS.md, GEMINI.md, Cursor rules, Copilot instructions, prompt templates, skill definitions, agent workflows, MCP servers, tool definitions, LLM configurations, RAG configs, memory strategies

❌ Ignores — CRUD endpoints, React components, CSS, database schemas, authentication, general business logic


Installation

pip install ai-govern

Quick Start

# Scan current directory and open dashboard
ai-govern run

# Scan a specific repository
ai-govern run /path/to/your/ai-repo

# Generate standalone HTML report
ai-govern report

# Auto-fix issues interactively
ai-govern fix

# CI mode (returns exit code 1 if score below threshold)
ai-govern run --ci --output json

# Initialize configuration
ai-govern init

# List all governance rules
ai-govern plugins

Dashboard

Running ai-govern run launches a local dashboard at http://localhost:5172:

  • Overview — Governance score, issue summary, category breakdown
  • Issue Explorer — Searchable, filterable issue list with full details
  • Context Analysis — Quality analysis of CLAUDE.md, AGENTS.md, etc.
  • Automation Opportunities — Where AI is over-engineered (use deterministic code instead)
  • Security — Hardcoded secrets, prompt injection risks
  • Cost Optimization — Caching gaps, token limit issues, model selection
  • Observability — Missing telemetry, token logging, latency tracking
  • Agents — Agent definition quality, circular workflows
  • Auto-Fix Panel — Preview diffs, approve/reject, rollback

Governance Categories

CategoryWeightExample Rules
Security20%Hardcoded API keys, prompt injection
Context15%Missing CLAUDE.md, poor context quality
Prompt Engineering15%Missing system prompt, duplicate prompts
Cost Optimization10%No caching, no token limits
Agents10%Missing descriptions, circular workflows
Observability8%No telemetry, no token tracking
Documentation7%Missing skill docs, no README AI section
RAG5%No chunking strategy, no embedding model spec
Memory4%No memory strategy, unbounded history
Tools/MCP3%Missing tool descriptions, insecure transport
Model Governance3%Unpinned model versions
Automation1%LLM used for UUID/JSON/date formatting

Configuration

Create ai-govern.yaml in your repository root:

# Governance Policy
min_governance_score: 70.0
fail_on_critical: true

# Disable specific rules
disabled_rules:
  - PE001  # Hardcoded prompts (if you prefer inline prompts)

# LLM Analysis (optional)
llm:
  enabled: false
  provider: openai
  model: gpt-4o-mini
  api_key_env: OPENAI_API_KEY

# Dashboard
dashboard_port: 5172
auto_open_browser: true

Run ai-govern init to generate this file automatically.


CI/CD Integration

# .github/workflows/ai-governance.yml
- name: AI Governance Check
  run: |
    pip install ai-govern
    ai-govern run --ci --output sarif
  
- name: Upload SARIF
  uses: github/codeql-action/upload-sarif@v3
  with:
    sarif_file: ai-govern-report.sarif

Plugin SDK

Write custom governance rules:

from ai_govern.plugins.sdk import GovernanceRule, RuleCategory, Severity, ScanContext, GovernanceIssue

class MyCustomRule(GovernanceRule):
    rule_id = "CUSTOM001"
    name = "My Custom Rule"
    category = RuleCategory.AGENTS
    severity = Severity.MEDIUM
    
    def evaluate(self, context: ScanContext) -> list[GovernanceIssue]:
        # Your rule logic here
        return []

Register in pyproject.toml:

[project.entry-points."ai_govern.rules"]
my_rule = "my_plugin.rules:MyCustomRule"

Architecture

ai-govern run
     │
     ├── FileScanner (AI-only file discovery)
     │       └── AI relevance filtering (50+ patterns)
     │
     ├── RuleEngine
     │       ├── RuleRegistry (built-in + plugins via entry_points)
     │       ├── RuleExecutor (concurrent, thread-pool)
     │       └── Scorer (weighted category scoring)
     │
     ├── AutoFixEngine (propose → preview → approve → apply → rollback)
     │
     └── FastAPI Server
             ├── API v1 (scan, issues, fixes, plugins, config)
             └── React Dashboard (pre-built, served as static files)

License

MIT License — see LICENSE for details.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 21

Native requirements
20 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
aiofiles
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.12",
  "evaluation": "NOT_EVALUATED"
}
aiofiles>=23.2.0runtime
anyio
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.12",
  "evaluation": "NOT_EVALUATED"
}
anyio>=4.4.0runtime
fastapi
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.12",
  "evaluation": "NOT_EVALUATED"
}
fastapi>=0.115.0runtime
gitpython
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.12",
  "evaluation": "NOT_EVALUATED"
}
gitpython>=3.1.0runtime
httpx
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.12",
  "evaluation": "NOT_EVALUATED"
}
httpx>=0.27.0runtime
jinja2
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.12",
  "evaluation": "NOT_EVALUATED"
}
jinja2>=3.1.0runtime
pathspec
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.12",
  "evaluation": "NOT_EVALUATED"
}
pathspec>=0.12.0runtime
pydantic-settings
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.12",
  "evaluation": "NOT_EVALUATED"
}
pydantic-settings>=2.3.0runtime
pydantic
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.12",
  "evaluation": "NOT_EVALUATED"
}
pydantic>=2.7.0runtime
pyyaml
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.12",
  "evaluation": "NOT_EVALUATED"
}
pyyaml>=6.0.0runtime
rich
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.12",
  "evaluation": "NOT_EVALUATED"
}
rich>=13.7.0runtime
typer
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.12",
  "evaluation": "NOT_EVALUATED"
}
typer>=0.12.0runtime
uvicorn
Environment
{
  "extras": "standard",
  "marker": null,
  "requires_python": ">=3.12",
  "evaluation": "NOT_EVALUATED"
}
uvicorn[standard]>=0.30.0runtime
black
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.12",
  "evaluation": "NOT_EVALUATED"
}
black>=24.4.0; extra == "dev"runtime
httpx
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.12",
  "evaluation": "NOT_EVALUATED"
}
httpx>=0.27.0; extra == "dev"runtime
mypy
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.12",
  "evaluation": "NOT_EVALUATED"
}
mypy>=1.10.0; extra == "dev"runtime
pre-commit
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.12",
  "evaluation": "NOT_EVALUATED"
}
pre-commit>=3.7.0; extra == "dev"runtime
pytest-asyncio
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.12",
  "evaluation": "NOT_EVALUATED"
}
pytest-asyncio>=0.23.0; extra == "dev"runtime
pytest-cov
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.12",
  "evaluation": "NOT_EVALUATED"
}
pytest-cov>=5.0.0; extra == "dev"runtime
pytest
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.12",
  "evaluation": "NOT_EVALUATED"
}
pytest>=8.2.0; extra == "dev"runtime
ruff
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.12",
  "evaluation": "NOT_EVALUATED"
}
ruff>=0.5.0; extra == "dev"runtime

Distribution files

2 collected
ai_govern-0.1.0-py3-none-any.whl

bdist_wheel · 284.33 KB · Python py3

Source file
ai_govern-0.1.0.tar.gz

sdist · 307.48 KB · Python source

Source file

Metadata history

Meaningful changes
Current collected state Current

Observed since 21 Oct, 10:49 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:3cb83edbc07600dd30cf5aff1e260a2173c44ade7b6e63e54c700f5174cec846

Other collected versions

View all collected versions →