Skip to main content

ARSIA Protocol SDK — EdDSA signing, message types, compliance profiles for autonomous AI agent infrastructure

Project description

arsia-protocol — Python SDK

PyPI Python License Typed

The trust layer for AI agents. Make any agent enterprise-ready — compliant, secure, and auditable out of the box.

Python SDK for the ARSIA Protocol: the compliance-enforced communication layer for AI agents. Build, sign, verify, and validate ARSIA message envelopes over any transport — HTTP, WebSocket, gRPC, MCP, A2A, or your own.

Fully typed — works with mypy, pyright, and IDE autocompletion out of the box.

Install

pip install arsia-protocol                # core SDK
pip install "arsia-protocol[cli]"         # plus the `arsia` CLI
pip install "arsia-protocol[dev]"         # development (tests, mypy, ruff)

Quickstart

from arsia_protocol import (
    create_request, generate_ed25519_keypair, sign_message, verify_message,
)

# 1. Generate an Ed25519 keypair (developer convenience — use an HSM / KMS
#    in production).
priv, pub = generate_ed25519_keypair()
kid = "agent:acme.bot#k1"

# 2. Build a signed request envelope.
envelope = create_request(
    from_agent="agent:acme.bot",
    to_agent="agent:other.svc",
    payload_type="com.arsiaprotocol.echo",
    capabilities=["com.arsiaprotocol.echo"],
    args={"msg": "hello"},
)
signed = sign_message(envelope, priv, kid)

# 3. On the recipient side — verify the signature.
assert verify_message(signed, pub) is True

Validate against schema + semantics

from arsia_protocol import validate_schema, validate_semantic

l1_errors = validate_schema(signed)       # L1: JSON Schema (Draft 2020-12)
l2_errors = validate_semantic(signed)     # L2: timestamps, kid match, etc.
assert l1_errors == [] and l2_errors == []

Apply a compliance profile

from arsia_protocol import apply_profile

# The envelope must declare compliance.profile — apply_profile reads it
# from there and inherits the profile's defaults (retention, jurisdiction, …).
envelope["compliance"] = {"profile": "GDPR-STANDARD"}
enriched = apply_profile(envelope)         # strict=False by default

Key Concepts

verify vs. validate

Function What it checks Question it answers
verify_message(envelope, pub_key) Ed25519/ES256 signature "Was this signed by the claimed sender?"
validate_schema(envelope) JSON Schema (Draft 2020-12) "Does this match the ARSIA envelope structure?"
validate_semantic(envelope) Cross-field rules (timestamps, kid prefix, capabilities) "Is this envelope internally consistent?"
validate_envelope(envelope) Both schema + semantic (convenience) "Is this well-formed and consistent?"

A typical receiver calls both: verify_message() to trust the sender, then validate_envelope() to trust the content.

build_* vs. create_* naming

  • create_* (7 functions) — envelope-level factories that produce a complete, signable ARSIA envelope: create_request, create_response, create_error, create_event, create_pending_approval, create_approval_decision, create_rollback_request.

  • build_* (49 functions) — sub-component builders that produce parts of envelopes: audit records, error details, JWKs, state operation arguments, discovery documents, etc.

Rule of thumb: if it returns a complete envelope ready to sign, it's create_*. If it returns a component or record, it's build_*.

arsia CLI

pip install "arsia-protocol[cli]"

arsia keygen --kid agent:acme.bot#k1        # generate Ed25519 key material
arsia verify envelope.json --jwk sender.jwk # verify a signed envelope
arsia canonicalize doc.json                 # emit RFC 8785 canonical bytes
arsia inspect envelope.json                 # pretty-print with diagnostics
arsia schemas                               # list bundled JSON Schemas
arsia vectors                               # list bundled test vectors
arsia profiles GDPR-STANDARD                # print a compliance profile

What the SDK does NOT do

  • Transport (HTTP, WebSocket, MCP, A2A) — that's arsiactl, not the SDK.
  • Agent execution, planning, tool use — that's the agent framework.
  • Audit trail storage — the SDK builds audit records; it does not persist them.
  • OAuth2 issuance — the SDK validates tokens, does not issue them.
  • Payload interpretation — the SDK signs and verifies envelopes; it never inspects payload content beyond routing-relevant fields.

Documentation

Resource Description
Learning Path Step-by-step guide from install to production
Concepts Mental model: envelopes, lifecycle, naming, profiles
Cookbook 22 copy-pasteable recipes for common tasks
Examples 14 runnable scripts (10 basic + 4 regulated use cases)
API Reference Full API documentation (run mkdocs serve)
Demos Production-realistic multi-agent scenarios — run any of them in under a minute

Development

cd python
pip install -e ".[dev]"
pytest tests/ -v
mypy src/arsia_protocol/
ruff check src/
ruff format src/

Links


ARSIA Protocol (arsiaprotocol.org) · by Arsia Labs · BSL 1.1

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

arsia_protocol-1.0.0.post2.tar.gz (547.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

arsia_protocol-1.0.0.post2-py3-none-any.whl (413.3 kB view details)

Uploaded Python 3

File details

Details for the file arsia_protocol-1.0.0.post2.tar.gz.

File metadata

  • Download URL: arsia_protocol-1.0.0.post2.tar.gz
  • Upload date:
  • Size: 547.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for arsia_protocol-1.0.0.post2.tar.gz
Algorithm Hash digest
SHA256 b27def27dab84a4b64ec168b6fe643d002666a1c5e8b61d723279dc8625b558c
MD5 3992a6869003c93bafae40da6ce1864f
BLAKE2b-256 2b1e13a8067cb1ef37426bc2d211929c3e29af495aa9ce5d9f37056ca0a35d92

See more details on using hashes here.

File details

Details for the file arsia_protocol-1.0.0.post2-py3-none-any.whl.

File metadata

File hashes

Hashes for arsia_protocol-1.0.0.post2-py3-none-any.whl
Algorithm Hash digest
SHA256 c993326fa049c7add88c60457eceece620d05acae637229ba7242e2ec5c728cc
MD5 cbae553b9f8bcadf62414a966111f8b3
BLAKE2b-256 e1d242670b672b2623df851fbc523c16ae3dd5612d6cb95ad6d8c3492b22b4df

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page