Policy evaluation helpers for the ARP Standard.
Project description
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)
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 arp_policy-0.1.1.tar.gz.
File metadata
- Download URL: arp_policy-0.1.1.tar.gz
- Upload date:
- Size: 10.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
87a2f5a75b9b6fc9ea53558d0872744c55ece2369aac6bffe45e5cd6d0725c0d
|
|
| MD5 |
7bffef0f54c6111a66eca5d73a0e1670
|
|
| BLAKE2b-256 |
15edf4152af4b776ceea940f989d05c5ee7f5ed1c2c6b31c0702aa96574e8284
|
Provenance
The following attestation bundles were made for arp_policy-0.1.1.tar.gz:
Publisher:
release.yml on AgentRuntimeProtocol/ARP_Policy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
arp_policy-0.1.1.tar.gz -
Subject digest:
87a2f5a75b9b6fc9ea53558d0872744c55ece2369aac6bffe45e5cd6d0725c0d - Sigstore transparency entry: 778907038
- Sigstore integration time:
-
Permalink:
AgentRuntimeProtocol/ARP_Policy@42e121175d8cccd9ae540d599e4d20ddad7c39b4 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/AgentRuntimeProtocol
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@42e121175d8cccd9ae540d599e4d20ddad7c39b4 -
Trigger Event:
push
-
Statement type:
File details
Details for the file arp_policy-0.1.1-py3-none-any.whl.
File metadata
- Download URL: arp_policy-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.8 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 |
003f3a732418cd1f1fd8de8f1b6e2d4acb8e656abaebe49892eab7da4f4c777c
|
|
| MD5 |
bb71edd9471b6083142d4101ff5e4b67
|
|
| BLAKE2b-256 |
5db17cd8cd80a88a7d5ca437b83dd5d8cc4ee2e418eecff734df4c723caa015a
|
Provenance
The following attestation bundles were made for arp_policy-0.1.1-py3-none-any.whl:
Publisher:
release.yml on AgentRuntimeProtocol/ARP_Policy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
arp_policy-0.1.1-py3-none-any.whl -
Subject digest:
003f3a732418cd1f1fd8de8f1b6e2d4acb8e656abaebe49892eab7da4f4c777c - Sigstore transparency entry: 778907040
- Sigstore integration time:
-
Permalink:
AgentRuntimeProtocol/ARP_Policy@42e121175d8cccd9ae540d599e4d20ddad7c39b4 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/AgentRuntimeProtocol
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@42e121175d8cccd9ae540d599e4d20ddad7c39b4 -
Trigger Event:
push
-
Statement type: