arp-policy
A minimal policy evaluator for the ARP Tool Registry.
Policy format
Top-level keys:
Version: optional version string.Statement: list of statements.
Statement keys:
Sid: optional statement id for audit/debug.Effect:AlloworDeny.Action: string or list of strings.Resource: string or list of strings.Condition: optional map of operator to key/value map.
Supported condition operators:
StringEqualsStringLike(wildcards with*)
Usage
from arp_policy import Enforcer, Policy, emit_decision
policy = Policy.load("./config/policy/policy.dev.json")
enforcer = Enforcer(policy)
context = {
"principal": "user:alice",
"tenant": "acme",
"environment": "dev",
"request_id": "req-123",
}
decision = enforcer.authorize("tool:Invoke", "tool:finance/pay", context)
if not decision.allowed:
raise Exception("policy denied")
# Audit event
record = emit_decision(
decision,
context,
action="tool:Invoke",
resource="tool:finance/pay",
policy_hash=policy.policy_hash,
)
Auth and identity
arp-policy is auth-agnostic. It does not validate credentials or issue identities.
The host service (Tool Registry, Runtime, Daemon) must:
- authenticate the caller using your chosen scheme (JWT, mTLS, API key, etc.)
- map verified identity attributes into the
contextdict (e.g.,principal,tenant) - avoid passing raw credentials into policy context
Tool discovery filtering
tools = [{"tool_id": "finance.pay", "metadata": {"labels": {"tier": "gold"}}}]
allowed = enforcer.filter_tools(tools, context)
Context keys
Typical keys used in policy conditions:
principaltenantenvironmentrequest_idtool.idtool.tags(tool labels/annotations)
Metadata
Release files for arp-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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| arp_policy-0.1.2.tar.gz | 10.2 kB | With provenance | Details for arp_policy-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| arp_policy-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for arp_policy-0.1.2-py3-none-any.whl |
Total release size: 18.3 kB
Release files / arp_policy-0.1.2.tar.gz
| Download URL | arp_policy-0.1.2.tar.gz |
|---|---|
| Size | 10.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
09ca84cfc54be14b12ea0c49b3622b2d75e678ad92f0fc511a94cf3f5f700e68
|
|
BLAKE2b-256 checksum How to use checksums |
6dcbfeacc463cf1758424c09876fb1cecfb497869f17623b5812befc3aae62ea
|
| 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 Dec 31, 2025.
Transparency logRelease files / arp_policy-0.1.2-py3-none-any.whl
| Download URL | arp_policy-0.1.2-py3-none-any.whl |
|---|---|
| Size | 8.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
49a153edd06dcbf26ac20c520c4d9eb0f9fb3d04185ce3bc19c61fbcfab4bed4
|
|
BLAKE2b-256 checksum How to use checksums |
9fa686e807a21e49f39e3c5713486f64c099d94d08346e5df4b6405f5592a49b
|
| 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 Dec 31, 2025.
Transparency logSecurity for arp-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.
Attestation for arp_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 Dec 31, 2025.
Transparency logA 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.