Deterministic policy evaluation engine for the ABI ecosystem
Project description
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/DecisionResponsemodels - 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:
- abi-control-core -- contracts and audit trail SDK
- abi-evals -- eval runner and golden management
- abi-observability -- OTLP-compliant telemetry
Versioning
Follows Semantic Versioning. Current version: 0.1.2. See CHANGELOG.md for release notes.
License
MIT License (see LICENSE file).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file abi_policy-0.1.2.tar.gz.
File metadata
- Download URL: abi_policy-0.1.2.tar.gz
- Upload date:
- Size: 90.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc7c194fbbb38df07776db3dd8c9b399b9f5efb463d9ce25f5c76a98e873e04f
|
|
| MD5 |
31a8cbe47fde5ed7f03300ff9aefa416
|
|
| BLAKE2b-256 |
fa0964983a573b4c9ddf2e1c6068a1f5269471cf153226e703ea22d2ec767e54
|
Provenance
The following attestation bundles were made for abi_policy-0.1.2.tar.gz:
Publisher:
publish.yml on AbilityBI/abi-policy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
abi_policy-0.1.2.tar.gz -
Subject digest:
bc7c194fbbb38df07776db3dd8c9b399b9f5efb463d9ce25f5c76a98e873e04f - Sigstore transparency entry: 1102554113
- Sigstore integration time:
-
Permalink:
AbilityBI/abi-policy@27fe627e76e0ad46c683ebabf96b7bcf9310743a -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/AbilityBI
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@27fe627e76e0ad46c683ebabf96b7bcf9310743a -
Trigger Event:
push
-
Statement type:
File details
Details for the file abi_policy-0.1.2-py3-none-any.whl.
File metadata
- Download URL: abi_policy-0.1.2-py3-none-any.whl
- Upload date:
- Size: 26.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2284ce93c135f8d1ad5368ef5cd0d8952ce4d0e2591ae6432df6e0a92dee7613
|
|
| MD5 |
c757c455793074733d75afaa4ceccfc1
|
|
| BLAKE2b-256 |
58fb0f79c915f801c3c6003f4ed18d5ac23a02315082f28e8c43a725c7ad1efa
|
Provenance
The following attestation bundles were made for abi_policy-0.1.2-py3-none-any.whl:
Publisher:
publish.yml on AbilityBI/abi-policy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
abi_policy-0.1.2-py3-none-any.whl -
Subject digest:
2284ce93c135f8d1ad5368ef5cd0d8952ce4d0e2591ae6432df6e0a92dee7613 - Sigstore transparency entry: 1102554117
- Sigstore integration time:
-
Permalink:
AbilityBI/abi-policy@27fe627e76e0ad46c683ebabf96b7bcf9310743a -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/AbilityBI
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@27fe627e76e0ad46c683ebabf96b7bcf9310743a -
Trigger Event:
push
-
Statement type: