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.1

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.1
File Size Uploaded
agent_safe_spl-0.2.1.tar.gz 10.9 kB Details

Built distribution (wheel)

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

Total release size: 21.8 kB

Release files / agent_safe_spl-0.2.1.tar.gz

Download URL agent_safe_spl-0.2.1.tar.gz
Size 10.9 kB
Tags Source
SHA-256 checksum
How to use checksums
5b345439e5f35a00ce6bc21daebdec04ba6a342e598eda7a221d775fc1b38d83
BLAKE2b-256 checksum
How to use checksums
354c98af3ccc240d727e994ec7895bdaa5a5d4c449743daed2d1007060f71508
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 Mar 16, 2026.

Transparency log

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

Download URL agent_safe_spl-0.2.1-py3-none-any.whl
Size 10.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
069fbc6582064de94ac1dd28efa490ef218c31a530cb6b34a544fd002298c87d
BLAKE2b-256 checksum
How to use checksums
9ebf29025781bc580f9297e78463274e1b415aab5ff815bf67f11c7ecd82d9d8
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 Mar 16, 2026.

Transparency log

Release history Release notifications | RSS feed

0.3.0

2 release files

This release

0.2.1 This release

2 release files

0.2.0

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