Catalog PyPI
Back to packageRELEASE DETAILS

0.3.8

PyPI

ai-lint

Check AI coding session compliance against user-defined policies

aiclaudecompliancelintpolicy
Published17 Feb 2026
Direct dependencies2
Transitive dependenciesNot calculated

README

Version 0.3.8 documentation

ai-lint

A linter for your AI coding sessions.

Gemini_Generated_Image_voazlcvoazlcvoaz (1) (1)

ai-lint checks how you use AI — not the code it writes. Define your rules, and ai-lint reads your Claude Code sessions, evaluates them, and tells you what passed and what didn't.

No API keys. No dashboards. Runs locally.


It catches this

Screenshot 2026-02-17 at 19 23 43

ai-lint flagged a session where an API key was exposed in the conversation.


And gives you this

Screenshot 2026-02-17 at 19 24 33

Every session gets a clear verdict — what passed, what failed, and why.


Why

You lint your code. You lint your commits. But nobody lints how they work with AI.

  • Are you leaking credentials in prompts?
  • Are you blindly accepting AI output without reviewing?
  • Are you stuck in error → paste → fix loops?
  • Are your team members following the AI usage guidelines you wrote?

ai-lint answers these questions automatically.


Install

pip install ai-lint

Requires: Python 3.10+ and Claude Code CLI installed.


30-Second Setup

ai-lint init

This asks you one question — pick a persona:

  • self — 10 rules for individual developers
  • team — 11 rules for teams with AI usage policies

Creates your policy at ~/.ai-lint/policy.md.

If you don't like the default policies... you can edit them anytime.


Usage

Check your last session:

ai-lint check --last

Output:

[+] PASS  No credential exposure
[+] PASS  No sensitive data in prompts
[x] FAIL  Review before acceptance — Developer accepted output without review
[-] SKIP  Testing discussed or performed

8/10 passed

Check interactively (pick a session):

ai-lint check

Batch report (last 5 sessions → markdown):

ai-lint report -n 5

Auto-check after every session:

ai-lint hook install

Edit your policy:

ai-lint policy

What It Checks

Security

RuleWhat it catches
No credential exposureAPI keys, private keys, connection strings in prompts
No sensitive dataReal customer PII, production DB contents, internal IPs
No destructive commandsrm -rf, DROP TABLE, git push --force to main without safeguards

Developer Engagement

RuleWhat it catches
Understanding before delegation"fix login" with zero context
No fix-it loops3+ error-paste-fix cycles without root cause analysis
Review before acceptanceAccepting AI output without reading or questioning it
Clarifying questionsNever asking "why X over Y?" or "what are the tradeoffs?"

Process Discipline

RuleWhat it catches
Incremental changesOne massive "build everything" request with no checkpoints
Testing discussedNo mention of tests, edge cases, or verification
Clear objectiveUndirected drift with no stated goal
Stays on scopeAI usage outside assigned work (team only)

Who It's For

Individual developers — Check your own AI habits. Get better at working with AI. Catch credential leaks before they become incidents.

Engineering managers — You wrote an AI usage policy. Now what? Give your team ai-lint. Each developer installs it, runs it locally, and self-checks against your policy. No surveillance dashboards, no monitoring infrastructure — just a shared policy.md that everyone checks against. Drop your AI usage guidelines into the policy file and your team has a compliance tool in 30 seconds.

Anyone with a policy — Edit ~/.ai-lint/policy.md with any rules you want, in plain English. ai-lint evaluates against whatever you write.


Custom Policies

The templates are starting points. Write your own rules:

ai-lint policy
# My AI Policy

1. Never use AI for authentication or payment code without explicit approval
2. Always run the test suite before ending a session
3. Reference a JIRA ticket in every session
4. Don't generate client-facing emails without human review
5. Keep sessions under 30 minutes

ai-lint sends your rules + the session transcript to Claude and gets back verdicts. Plain English rules just work.


How It Works

~/.claude/projects/*.jsonl    →    ai-lint    →    verdicts
   (session transcripts)        + policy.md      (PASS/FAIL/SKIP)
  1. Reads Claude Code session transcripts (JSONL files stored locally)
  2. Pairs them with your policy (~/.ai-lint/policy.md)
  3. Sends both to claude -p (Claude Code CLI) — no API keys, runs locally
  4. Returns structured verdicts with reasoning

Commands

CommandWhat it does
ai-lint initSetup wizard — pick persona, create policy
ai-lint checkCheck a session against your policy
ai-lint check --lastCheck most recent session
ai-lint report -n 5Batch-check last 5 sessions → markdown report
ai-lint policyOpen your policy in your editor
ai-lint hook installAuto-check after every Claude Code session
ai-lint hook uninstallRemove the auto-check hook

Uninstall

ai-lint hook uninstall
rm -rf ~/.ai-lint
pip uninstall ai-lint

Contributing

There's a wide range of ways to contribute — from small additions to major features:

  • New flags — --format json, --since date filter, --severity threshold, custom --policy path
  • Report formats — PDF export, HTML reports, SARIF for IDE integration, JUnit XML for CI/CD
  • New session sources — Cursor, GitHub Copilot, OpenAI Codex, Gemini CLI, Windsurf, OpenCode, Entire CLI
  • LLM providers — OpenAI, Gemini, Ollama (fully offline), any OpenAI-compatible endpoint
  • Policy templates — industry-specific rules, new personas, community-contributed policies
  • Bug fixes, docs, better output formatting

Every new session source just needs a parser that returns the same Session format — the checker doesn't care where the transcript came from.

License

MIT

Downloads & popularity

Awaiting observations

No metric observations yet

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

Declared dependencies 2

Native requirements
2 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
click
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
click>=8.0runtime
pytest
Environment
{
  "extras": "",
  "marker": "extra == \"test\"",
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
pytest>=8.0; extra == "test"runtime

Distribution files

2 collected
ai_lint-0.3.8-py3-none-any.whl

bdist_wheel · 23.03 KB · Python py3

Source file
ai_lint-0.3.8.tar.gz

sdist · 28.72 KB · Python source

Source file

Repository

PENDING
aryanshukla/ai-lint

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 21 Oct, 11:09 UTC

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

Record identity

package_version:da576e6c141d3d5fd3f6dbaee66083c5724ba58b5cbf3b37b6cd18cc754a7c93

Other collected versions

View all collected versions →