Skip to main content

IAM + Context Control Plane for AI Agents — cryptographic policy enforcement with Ed25519 signed envelopes

Project description

Authority Runtime

Cryptographic IAM for AI agents -- scoped, signed, time-limited permissions with a tamper-evident audit trail.

License: BSL 1.1 Python 3.9+ Tests


The Problem

AI agents operate with all-or-nothing permissions. If an agent has an API key, it can do anything with that credential. Traditional auth (OAuth, RBAC, JWT) assumes a human clicked a button -- agents don't click buttons.

Authority Runtime creates cryptographically signed permission envelopes that scope exactly what an agent can do, enforced at runtime, with a complete audit trail.

Parent Envelope                    Child Envelope
|- scopes: [read, write, delete]   |- scopes: [read]        <- narrowed
|- context: [user, email, history] |- context: [email]      <- narrowed
|- ttl: 10 minutes                 |- ttl: 5 minutes        <- narrowed
'- signature: Ed25519(...)         '- signature: Ed25519(...)

The child cannot exceed the parent. Cryptographically enforced.


Install

pip install authority-runtime

Quick Start

from authority_runtime import generate_key_pair, create_simple_envelope, check_envelope

# Generate Ed25519 identity
private_key, public_key = generate_key_pair()

# Create a scoped, signed, time-limited envelope
envelope = create_simple_envelope(
    agent_id="my-agent",
    scopes=["read:users", "write:users"],
    private_key=private_key,
)

# Verify access -- passes
check_envelope(envelope, public_key, required_scope="read:users")

# Verify access -- raises PermissionDenied
check_envelope(envelope, public_key, required_scope="delete:users")

See docs/QUICKSTART.md for more examples including EnforcedTool runtime blocking and HTML compliance reports.


What It Does

  1. Scope -- Define exactly which tools and data an agent can access
  2. Sign -- Ed25519 signatures make permissions tamper-proof
  3. Expire -- TTLs ensure permissions don't persist forever
  4. Enforce -- EnforcedTool blocks unauthorized actions at runtime
  5. Audit -- Every action logged with cryptographic proof
  6. Verify -- SHA-256 hash chain on audit trail detects tampering and deletions

Key Features

  • YAML policy engine -- define agent permissions in declarative YAML
  • Constraint enforcement -- require_purpose, denied_resources, max_records, require_approval
  • Wildcard scope matching -- vault:*:read matches vault:finance:read
  • HTML compliance reports -- negative attestation ("agent never accessed X")
  • Tamper-evident audit trail -- SHA-256 hash chain, carryall audit --verify
  • Schema migrations -- versioned, with automatic backup
  • MCP server -- HTTP and stdio transports with Bearer auth + rate limiting
  • LangGraph integration -- graph-based agents with automatic permission narrowing

CLI

carryall init                          # Initialize ~/.carryall/
carryall keys generate --agent-id bot  # Generate Ed25519 keypair
carryall mcp serve --transport http    # Start MCP server
carryall audit query                   # Query audit trail
carryall audit --verify                # Verify hash chain integrity
carryall compliance report             # Generate HTML compliance report
carryall policy validate policy.yaml   # Validate YAML policy
carryall db status                     # Check database + migrations

Edtech FERPA Demo

A complete multi-agent demo showing FERPA compliance:

git clone https://github.com/tronmongoose/carryall-edtech-pilot.git
cd carryall-edtech-pilot
pip install authority-runtime
python -m demo.run

Demonstrates: agent identity, least privilege, access denial, negative attestation, compliance export. No API keys needed.


Architecture

Agent Request
    |
    v
Root Envelope (Ed25519 signed, scoped, time-bounded)
    |
    v
Policy Engine (YAML policies, constraints, scope matching)
    |
    v
EnforcedTool (validates signature, checks TTL, verifies scope)
    |
    v
Audit Trail (SQLite, hash chain, compliance export)

Design Constraints

  1. Envelopes are immutable -- create new ones, don't modify existing
  2. Children subset Parents -- authority only narrows, never expands
  3. TTLs only decrease -- child can't outlive parent (60s-24h range)
  4. Signatures are mandatory -- no unsigned envelopes
  5. Enforcement is cryptographic -- can't bypass without private key

Documentation

Doc Description
Getting Started 5-minute tutorial with 3 progressive examples
Deployment Local, Docker Compose, and Kubernetes
Configuration Environment variables, YAML policies, logging
Changelog Release history
Security Vulnerability reporting + architecture
Contributing Development setup + PR process

Test Suite

182 tests across 15 test files covering envelope operations, scope matching, constraint enforcement, policy engine, compliance reports, hash chain integrity, schema migrations, MCP auth, and structured logging.

pytest            # Run all tests
pytest -v -x      # Verbose, stop on first failure

License

Business Source License 1.1 - See LICENSE. Converts to Apache 2.0 after 4 years.

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

authority_runtime-0.3.0.tar.gz (132.5 kB view details)

Uploaded Source

Built Distribution

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

authority_runtime-0.3.0-py3-none-any.whl (102.5 kB view details)

Uploaded Python 3

File details

Details for the file authority_runtime-0.3.0.tar.gz.

File metadata

  • Download URL: authority_runtime-0.3.0.tar.gz
  • Upload date:
  • Size: 132.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for authority_runtime-0.3.0.tar.gz
Algorithm Hash digest
SHA256 99d772939011acc97cb74ea0af911f53fc97e24445fde1fbaac49c4e85424522
MD5 8398d1b3b642484ff17e9ed39e257118
BLAKE2b-256 6254be44dab5556a8f37b5bf36731f3f2d20735497406a1fbebbc90be8158b5d

See more details on using hashes here.

Provenance

The following attestation bundles were made for authority_runtime-0.3.0.tar.gz:

Publisher: publish.yml on tronmongoose/agent.carryall

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file authority_runtime-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for authority_runtime-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 73eddfab9465637837444ca646eede6bc8015a0f47c1c9de0b5ee1c9bf2218de
MD5 c47039a30f84a3bf2e4a03d0577e2385
BLAKE2b-256 e7bd020594087bda8d22be0ff76f816d2c1df9bade5315757d096d045fcc10e6

See more details on using hashes here.

Provenance

The following attestation bundles were made for authority_runtime-0.3.0-py3-none-any.whl:

Publisher: publish.yml on tronmongoose/agent.carryall

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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