Skip to main content

abi-policy

Deterministic policy evaluation engine for AI agent governance. Evaluate routing rules, tool allowlists, and budget thresholds against structured decision requests.

Zero required dependencies.

Install (after PyPI publication)

pip install abi-policy

Status: Not yet published to PyPI. Install from source: pip install -e . from the repo root.

Quick start

Policy evaluation

from abi_policy.engine import PolicyEngine
from abi_policy.models import DecisionRequest

# Load a policy bundle with tool allow/deny lists and escalation rules
bundle = {
    "bundle_id": "default",
    "rules": {
        "tools": {"allow": ["web_search", "file_read"], "deny": ["rm_rf"]},
        "escalation": {"risky_actions": {"override:*": "require_approval"}},
    },
}

engine = PolicyEngine(bundle)

# Evaluate a decision
request = DecisionRequest(action="tool_call", resource="web_search", run_id="run-42")
response = engine.evaluate(request)

print(response.decision)    # "allow" | "deny" | "require_approval"
print(response.reason_code) # e.g., "TOOL_ALLOWED"
print(response.explanation) # human-readable explanation

Capability matrix

from abi_policy.capability_matrix import CapabilityMatrix, AgentProfile

# Define agent capabilities with per-task confidence scores
profile = AgentProfile(
    agent_id="claude_code",
    agent_version="claude-sonnet-4",
    confidence_by_task={"code_write": 0.9, "test_run": 0.85},
    failure_patterns=["timeout on large repos"],
)

matrix = CapabilityMatrix()
matrix.add_profile(profile)
best = matrix.get_best_agent("code_write")  # "claude_code"

What's included

  • PolicyEngine -- deterministic rule evaluation against structured DecisionRequest/DecisionResponse models
  • Capability matrix -- agent profile management with capability boundaries
  • Boundary registry -- track and enforce cross-component access boundaries
  • Escalation rules -- pattern-matching for risky actions that require approval
  • Tool allowlists -- declarative control over which tools an agent can invoke

Use it standalone

abi-policy works on its own for any AI agent governance scenario. Define policy bundles, load them into the engine, and evaluate decision requests. No ABI ecosystem integration needed.

Within the ABI ecosystem, it integrates with the orchestrator for pre-flight agent decisions.

ABI ecosystem

Related packages:

Versioning

Follows Semantic Versioning. Current version: 0.1.2. See CHANGELOG.md for release notes.

License

MIT License (see LICENSE file).

Metadata

Release files for abi-policy 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for abi-policy 0.1.2
File Size Uploaded Provenance
abi_policy-0.1.2.tar.gz 90.0 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for abi-policy 0.1.2
File Interpreter ABI Platform
abi_policy-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 116.3 kB

Release files / abi_policy-0.1.2.tar.gz

Download URL abi_policy-0.1.2.tar.gz
Size 90.0 kB
Tags Source
SHA-256 checksum
How to use checksums
bc7c194fbbb38df07776db3dd8c9b399b9f5efb463d9ce25f5c76a98e873e04f
BLAKE2b-256 checksum
How to use checksums
fa0964983a573b4c9ddf2e1c6068a1f5269471cf153226e703ea22d2ec767e54
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

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 Mar 14, 2026.

Transparency log

Release files / abi_policy-0.1.2-py3-none-any.whl

Download URL abi_policy-0.1.2-py3-none-any.whl
Size 26.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2284ce93c135f8d1ad5368ef5cd0d8952ce4d0e2591ae6432df6e0a92dee7613
BLAKE2b-256 checksum
How to use checksums
58fb0f79c915f801c3c6003f4ed18d5ac23a02315082f28e8c43a725c7ad1efa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

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 Mar 14, 2026.

Transparency log

Security for abi-policy 0.1.2

Provenance

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for abi_policy-0.1.2.tar.gz

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 Mar 14, 2026.

Transparency log

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

This release

0.1.2 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page