Skip to main content

Agent-Safe SPL — Python SDK

Python implementation of the SPL (Safe Policy Lisp) evaluator for Agent-Safe capability tokens.

Install

pip install -e .               # core (zero runtime deps)
pip install -e ".[crypto]"     # with Ed25519/Merkle/hash-chain support
pip install -e ".[dev]"        # with test dependencies

Usage

As a library

from spl import parse, verify

policy = parse('(and (= (get req "action") "read") (<= (get req "amount") 100))')
request = {"action": "read", "amount": 50}
env = {
    "vars": {},
    "per_day_count": lambda action, day: 0,
    "crypto": {
        "dpop_ok": lambda: True,
        "merkle_ok": lambda t: True,
        "vrf_ok": lambda d, a: True,
        "thresh_ok": lambda: True,
    },
}

result = verify(policy, request, env)
print("ALLOW" if result["allow"] else "DENY")

As a CLI

python -m spl examples/policies/family_gifts.spl examples/requests/gift_50_niece.json
# → ALLOW

Tests

pip install -e ".[dev]"
pytest tests/ -v

Requirements

  • Python 3.10+
  • Zero runtime dependencies for core evaluator
  • cryptography package optional for real Ed25519 verification

Metadata

Release files for agent-safe-spl 0.3.0

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

Source distribution (sdist)

Source distribution for agent-safe-spl 0.3.0
File Size Uploaded Provenance
agent_safe_spl-0.3.0.tar.gz 10.9 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for agent-safe-spl 0.3.0
File Interpreter ABI Platform
agent_safe_spl-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 21.8 kB

Release files / agent_safe_spl-0.3.0.tar.gz

Download URL agent_safe_spl-0.3.0.tar.gz
Size 10.9 kB
Tags Source
SHA-256 checksum
How to use checksums
50dedd7c1f15d2cda080063a4590dc572258aa4a54435fd41f015e60279afa50
BLAKE2b-256 checksum
How to use checksums
c994fc3a2651b97df115d617ed59a7f83fbafa65b6fecf105b64456a3795ac97
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 May 5, 2026.

Transparency log

Release files / agent_safe_spl-0.3.0-py3-none-any.whl

Download URL agent_safe_spl-0.3.0-py3-none-any.whl
Size 10.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a0d6d29f7de6c492e978330e5c68f74786ea42761aaf771e4f9ba8e95c51bb10
BLAKE2b-256 checksum
How to use checksums
8d617a841ac2cb944acddc7ec06e750c03654777e7b5caa26e4605f69d1ea121
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 May 5, 2026.

Transparency log

Security for agent-safe-spl 0.3.0

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 agent_safe_spl-0.3.0.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 May 5, 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.

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