Getting Started¶
Install¶
The distribution on PyPI is aipr-py. From source:
Requires Python 3.10+.
As a GitHub CLI extension:
After install, gh aipr OWNER/REPO works identically and exit codes are
preserved for CI conditionals.
Verify:
Authentication¶
Policy fetches go through the GitHub API. Anonymous calls rate-limit fast, so set a token if you are scanning more than a couple of repositories:
GITHUB_TOKEN is accepted as a fallback. Without a token the tool still works,
it just makes more unauthenticated requests.
First Scan¶
Output:
aipr: asciimoo/hister
[BLOCKED] human-only policy
sources: CONTRIBUTING.md, README.md
confidence: 1.0 score: 19.0
autonomous contribution: NOT SAFE - require human co-authorship
A repository with no discoverable policy:
and exits 2.
Reading the Output¶
sources- the files the verdict was drawn from.confidence/score- how strongly the matched phrases agree.- The verdict line (
human_only,restrictive,disclose_ok,permissive,unknown) is the classification itself.
Explain the Verdict¶
When you disagree with the classification, ask for the evidence:
autonomous contribution: NOT SAFE - require human co-authorship
[+5.0] ...Issues and PR descriptions must be fully human-written...
[+5.0] ...AI should never be the main author of the PR...
Each line is a phrase that matched, with the weight it contributed.
Classify a Local File¶
To check a policy file before you commit it, or one you already have on disk:
--text reads the file directly and makes no network calls.
Gate a Contribution¶
Because the verdict is in the exit code, a pre-submission check is one line:
- exit 0 - autonomous-safe
- exit 1 - restricted or human-only, do not send a bot
- exit 2 - unknown, read the policy yourself
See Usage for batch mode, SARIF output and CI integration.