Skip to main content Switch to mobile version Pre-release This release is a pre-release and may not be stable for production use.
Semantic regression testing and CI gates for AI-agent tool permissions.
pip install permitdiff==0.1.0rc3 Copy PIP instructions
Detect when an AI-agent permission change can grant more power. Deterministic permission plans and CI gates for tool-calling agents.
A text diff shows that policy YAML changed. It does not tell a reviewer whether the proposed change can materially widen reviewed authority.
PermitDiff evaluates the same review corpus against baseline and candidate policies and performs bounded static authority analysis over the policy change. The result separates observed scenario evidence from conservative policy-level findings.
When bounded static analysis cannot prove a changed construct non-expanding, the result is unknown and the strict gate fails closed. PermitDiff does not convert uncertainty into safety.
pipx install git+https://github.com/TensorScholar/permitdiff.git@v0.1.0rc2 permitdiff init permissions && cd permissions permitdiff compare policies/baseline.yaml policies/candidate.yaml corpus.jsonl \ --gate permitdiff-gate.yaml Exit 0 = pass · 2 = valid comparison blocked by policy · 1 = invalid input or execution.
Git-resolved baseline
The post-v0.1.0rc2 development line can compare the current candidate against a policy stored at an already-fetched Git ref, so a PR workflow does not need to materialize a separate baseline file:
permitdiff compare \ permissions/policy.yaml \ permissions/policy.yaml \ permissions/corpus.jsonl \ --baseline-ref origin/main \ --baseline-evidence-output permitdiff-baseline-source.json \ --gate permissions/permitdiff-gate.yaml With --baseline-ref, the first policy path is resolved from the local Git object database. PermitDiff resolves the requested ref to an exact commit, resolves the policy to an exact blob, enforces the normal policy-size/schema bounds, and reads the blob without checking it out or executing repository code. The evidence file records requested ref, resolved commit, repository-relative policy path, Git object ID, and raw SHA-256. PermitDiff does not fetch remotes implicitly; the ref must already be available locally.
Ref syntax is deliberately conservative. Arbitrary Git revision expressions and traversal-style paths are rejected rather than interpreted. The normal semantic report still binds the validated policy through its canonical policy digest; Git-source evidence separately binds where the baseline bytes came from.
Native Claude Code preapproval projection
The post-v0.1.0rc2 development line adds a bounded native on-ramp for Claude Code project settings. It projects a documented subset of permissions.allow into the same semantic engine used by PermitDiff policies instead of reducing native rules to a text or rank diff.
permitdiff claude compare \ .claude/settings.baseline.json \ .claude/settings.local.json \ corpus.jsonl \ --strict \ --format markdown The initial adapter accepts only explicit permissions.defaultMode = "dontAsk" pairs whose deny and ask rules are unchanged. Bare-tool translation is deliberately limited to Bash, PowerShell, WebFetch, and WebSearch; other bare tools remain opaque because their approval semantics can differ. The adapter also translates exact WebFetch(domain:HOST) preapprovals, de-noises documented same-effect redundancies such as Bash(git mv *) when bare Bash is already granted, and fails closed when changed native semantics cannot be represented faithfully.
This is a preapproval projection, not a complete Claude effective-authority importer. Non-permissions root settings are not modeled; their values are compared through canonical digests while evidence exposes only their key names and identifies which ignored root keys changed. If such root settings differ, comparison stops unless the reviewer explicitly passes --allow-ignored-root-changes. That flag acknowledges only that the reviewer wants to analyze the bounded permission projection; it does not approve or waive the ignored changes.
Claude Code's current documentation states that domain-scoped WebFetch rules can also affect sandbox network-domain policy. PermitDiff models exact WebFetch(domain:HOST) rules here only as WebFetch preapprovals. If any exact WebFetch-domain declaration changes—even one that is preapproval-redundant beneath bare WebFetch—comparison stops unless the reviewer passes --acknowledge-webfetch-sandbox-gap. This acknowledgement allows analysis of the preapproval projection only; it is not evidence that sandbox/network consequences were reviewed or accepted.
WebFetch(domain:*) is intentionally not collapsed into bare WebFetch; a changed wildcard-domain rule is unsupported and fails closed because the two forms have different sandbox effects. The public regression pilot also changes enabledPlugins, so its two reported expansions are specifically the two modeled permissions.allow preapproval expansions—not a claim about the entire settings file.
The adapter also does not model managed/user overrides, hooks, plugin-provided capabilities, built-in exceptions, other permission modes, arbitrary file/path rules, or arbitrary Bash/PowerShell patterns. WebFetch domain scenarios use reserved _claude.permission_domain review metadata created for normalization; that field is not claimed to be raw Claude tool input.
Use --evidence-output
flowchart LR B[Baseline policy] --> C[Deterministic comparison] N[Candidate policy] --> C S[Scenario corpus] --> C C --> O[Observed transitions] C --> A[Bounded static authority findings] O --> P[Permission plan] A --> P P --> G{Release gate} G -->|pass| M[Merge] G -->|fail| R[Review / exact bounded waiver] No LLM in the decision path — deterministic, local, reproducible.
Semantics over text — rule effects, scopes, constraints, defaults, and precedence matter; descriptions do not grant authority.
Two evidence channels — observed scenario transitions remain distinct from bounded static authority findings.
Fail-closed — invalid inputs and unresolved static semantics do not become allow or pass.
Evidence-first — policy/corpus digests, action/finding fingerprints, JSON, Markdown, SARIF.
Bounded waivers — observed transitions and policy-level findings require exact, expiring review evidence; all waivers are bound to baseline/candidate digests.
The current v0.1.0rc2 release supports explicit baseline/candidate files:
- uses: actions/checkout@v6 - uses: actions/setup-python@v6 with: { python-version: "3.13" } - uses: TensorScholar/permitdiff@v0.1.0rc2 with: baseline: permissions/policies/baseline.yaml candidate: permissions/policies/candidate.yaml corpus: permissions/corpus.jsonl gate: permissions/permitdiff-gate.yaml The Action writes a Markdown step summary and a SARIF report for code scanning.
On the post-v0.1.0rc2 development line, the same Action also accepts baseline-ref. A PR integration should use a read-only checkout with full history, resolve the base branch as an already-fetched ref such as origin/${{ github.base_ref }}, and use the same repository-relative path for baseline and candidate when the policy is modified in place. The Action surfaces baseline_commit, baseline_object, and baseline_evidence outputs and places resolved provenance ahead of the semantic report in the step summary. Pin a release containing this capability before adopting it in another repository; do not replace a release pin with a moving main ref.
PermitDiff is a release-time semantic permission regression gate. It is not a runtime authorizer, credential broker, sandbox, identity provider, generic behavioral evaluator, or proof of exhaustive authorization safety.
Its observed corpus evidence is effective only for the supplied review scenarios. Its built-in static analyzer is a bounded static declared-authority over-approximation that fails closed on unsupported or ambiguous containment. Neither channel is an exhaustive effective-authority proof, and a clean report does not establish runtime authorization safety. Review the methodology, threat model, and limitations before sensitive use.
The release pipeline is configured for Python 3.11–3.14 tests, branch-aware coverage, strict typing, linting, dependency audit, CodeQL, OpenSSF Scorecard, clean-wheel smoke tests, CycloneDX SBOMs, Trusted Publishing, checksums, and GitHub build attestations. The v0.1.0rc2 release execution completed artifact build, external-repository validation, checksums, artifact attestation, SBOM attestation, and GitHub Release creation. PyPI publication is not yet claimed.
Commercial adoption: permission architecture reviews, scenario-corpus design, CI rollout, policy migration, and private adapters. Engagement model →
0.1.0rc2 is the latest GitHub release candidate using the versioned v1alpha1 schema. Mutable main advances under a separate development identity after releases; breaking changes remain possible before v1.
Docs · Security · Contributing · Roadmap · Citation
Released: Dec 3, 2026
Author: Mohammad Atashi
Both files in this release have provenance metadata.
View provenance details
Apache-2.0 View SPDX License List
ai-agents mcp security policy permissions regression-testing ci
Development Status 3 - Alpha
Intended Audience Developers
System Administrators
Programming Language Python :: 3
Software Development :: Testing
Release files for permitdiff 0.1.0rc3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
Built distribution (wheel)
Total release size: 328.1 kB
Release files / permitdiff-0.1.0rc3.tar.gz
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 3, 2026.
Release files / permitdiff-0.1.0rc3-py3-none-any.whl
Security for permitdiff 0.1.0rc3
Both files in this release have been uploaded with provenance metadata.
With provenance permitdiff-0.1.0rc3.tar.gz Dec 3, 2026
With provenance permitdiff-0.1.0rc3-py3-none-any.whl Dec 3, 2026
Attestation for permitdiff-0.1.0rc3.tar.gz
Attestation for permitdiff-0.1.0rc3-py3-none-any.whl
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.
Release history Release notifications | RSS feed
0.1.0rc3 This release
Dec 3, 2026 2 release files Full provenance
"PyPI", "Python Package Index", and the blocks logos are registered trademarks of the Python Software Foundation.
© 2026 Python Software Foundation
Deployed from 4d99e05











