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.2.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.2.0
File Size Uploaded
agent_safe_spl-0.2.0.tar.gz 10.8 kB Details

Built distribution (wheel)

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

Total release size: 21.8 kB

Release files / agent_safe_spl-0.2.0.tar.gz

Download URL agent_safe_spl-0.2.0.tar.gz
Size 10.8 kB
Tags Source
SHA-256 checksum
How to use checksums
6fd4d2661c5980794510e6bca0964109708c1baf5d84b80f2d4c8204d5937c8c
BLAKE2b-256 checksum
How to use checksums
a061b9c7a5713ec067abf77fc5eb617e549a88fb3d73618b2183a1886da9d35a
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 Feb 27, 2026.

Transparency log

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

Download URL agent_safe_spl-0.2.0-py3-none-any.whl
Size 10.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ca05aee2209829e8d8ebb36d70ecb4c1d5d381b416c6ec13fff604ce19ac8539
BLAKE2b-256 checksum
How to use checksums
8f2101c25c32afd61134fa93d53d81062385de3f06965e24aaad10310ef3adab
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 Feb 27, 2026.

Transparency log

Release history Release notifications | RSS feed

0.3.0

2 release files

0.2.1

2 release files

This release

0.2.0 This release

2 release files

0.1.0

2 release files

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