Skip to main content

Auths Python SDK

Decentralized identity for developers and AI agents. Sign, verify, and manage cryptographic identities with Git-native storage.

Install

pip install auths

Quick start

from auths import Auths

auths = Auths()

# Verify an attestation
result = auths.verify(attestation_json=data, issuer_key=public_key_hex)
print(result.valid)  # True

# Sign bytes
signature = auths.sign(b"hello world", private_key=secret_key_hex)

Identity management

from auths import Auths

auths = Auths(repo_path="~/.auths")

# Create a cryptographic identity
identity = auths.identities.create(label="laptop")
print(identity.did)  # did:keri:EBfd...

# Provision an agent (for CI, MCP servers, etc.)
agent = auths.identities.provision_agent(
    identity.did,
    name="deploy-bot",
    capabilities=["sign"],
)

# Sign using the keychain-stored identity key
sig = auths.sign_as(b"hello world", identity=identity.did)

# Link and manage devices
device = auths.devices.link(identity_did=identity.did, capabilities=["sign"])
auths.devices.revoke(device.did, identity_did=identity.did, note="replaced")

Keyless service-to-service verify

Verify an agent's credential presentation offline against a pinned root — one call, a typed Status enum, no exception for a denial:

from auths import verify_presentation, PresentationStatus

report = verify_presentation(bundle_json)  # the Auths-Presentation request bundle
if report.status is not PresentationStatus.VALID:
    raise PermissionError(f"denied: {report.status}")  # WRONG_AUDIENCE, EXPIRED, …

print(report.subject, report.caps)  # granted holder + capabilities

verify_credential(bundle_json) returns a CredentialReport the same way — e.g. report.status is CredentialStatus.CREDENTIAL_REVOKED carries report.revoked_at. Malformed input returns a typed MALFORMED_REQUEST status; it never raises.

Git commit verification

from auths.git import verify_commit_range

result = verify_commit_range("HEAD~5..HEAD")
for commit in result.commits:
    print(f"{commit.commit_sha}: {'valid' if commit.is_valid else commit.error}")

Time-pinned verification

# Verify an attestation's authenticity at a historical point in time
result = auths.verify(attestation_json=data, issuer_key=key, at="2024-06-15T00:00:00Z")

Capability/role authority is no longer checked at verification time. A capability grant comes from a holder-verified ACDC credential, not the attestation.

Agent auth for MCP / AI frameworks

from auths.agent import AgentAuth

auth = AgentAuth(
    bridge_url="https://bridge.example.com",
    attestation_chain_path=".auths/agent-chain.json",
)
token = auth.get_token(capabilities=["read", "write"])

Error handling

from auths import Auths, VerificationError, NetworkError

auths = Auths()
try:
    result = auths.verify(attestation_json=data, issuer_key=key)
except VerificationError as e:
    print(e.code)     # "expired_attestation"
    print(e.message)  # "Attestation expired at 2024-01-15T..."
except NetworkError as e:
    if e.should_retry:
        pass  # safe to retry

All errors inherit from AuthsError and carry .code, .message, and .context.

Configuration

# Auto-discover (uses ~/.auths)
auths = Auths()

# Explicit repo path
auths = Auths(repo_path="/path/to/identity-repo")

# With passphrase (or set AUTHS_PASSPHRASE env var)
auths = Auths(passphrase="my-secret")

# Headless / CI mode
# Set AUTHS_KEYCHAIN_BACKEND=file for environments without a system keychain

API reference

Type stubs are bundled (py.typed + __init__.pyi). Your editor will show full signatures, docstrings, and return types for all methods.

License

Apache-2.0

Download files

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

Source Distribution

auths-0.1.13.tar.gz (1.9 MB view details)

Uploaded Source

Built Distributions

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

auths-0.1.13-cp38-abi3-win_amd64.whl (8.2 MB view details)

Uploaded CPython 3.8+Windows x86-64

auths-0.1.13-cp38-abi3-musllinux_1_2_x86_64.whl (8.4 MB view details)

Uploaded CPython 3.8+musllinux: musl 1.2+ x86-64

auths-0.1.13-cp38-abi3-musllinux_1_2_aarch64.whl (7.8 MB view details)

Uploaded CPython 3.8+musllinux: musl 1.2+ ARM64

auths-0.1.13-cp38-abi3-manylinux_2_28_x86_64.whl (8.4 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.28+ x86-64

auths-0.1.13-cp38-abi3-manylinux_2_28_aarch64.whl (7.8 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.28+ ARM64

auths-0.1.13-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (15.0 MB view details)

Uploaded CPython 3.8+macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

File details

Details for the file auths-0.1.13.tar.gz.

File metadata

  • Download URL: auths-0.1.13.tar.gz
  • Upload date:
  • Size: 1.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for auths-0.1.13.tar.gz
Algorithm Hash digest
SHA256 bacbd0951b1f652f63cb6d021a9d8e35a2c8e4ba589075ea5bc2204e76cbc753
MD5 511e3f13e7cb2a1a45fb7c2318fad760
BLAKE2b-256 83203665b407b99dfd101f8cb5bc0bb9c4ec14ca34e0db3a25c558ef1c4db541

See more details on using hashes here.

Provenance

The following attestation bundles were made for auths-0.1.13.tar.gz:

Publisher: publish-python.yml on auths-dev/auths

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

File details

Details for the file auths-0.1.13-cp38-abi3-win_amd64.whl.

File metadata

  • Download URL: auths-0.1.13-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 8.2 MB
  • Tags: CPython 3.8+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for auths-0.1.13-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 b1e53ea8b0b984c98dbfb51fa5253a063ea96f19f6c8c83af43ba8c2939072c6
MD5 218a6b29eea7f291526f4584d810c888
BLAKE2b-256 49feda730ed6e3dddd983fd4b9267e6ff2932211ce350827703d592542f38c3c

See more details on using hashes here.

Provenance

The following attestation bundles were made for auths-0.1.13-cp38-abi3-win_amd64.whl:

Publisher: publish-python.yml on auths-dev/auths

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

File details

Details for the file auths-0.1.13-cp38-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for auths-0.1.13-cp38-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 9f7db9ac9aabb5b47a909f97b45d1c10659f95a3e7d2863e88faf3a7e7a7358c
MD5 6621a76202331a4c883c2bed219e64aa
BLAKE2b-256 b12a0a091bda6cdbbb59ba298490c1304f07d1b2a90a404e065f6f9bdf63a692

See more details on using hashes here.

Provenance

The following attestation bundles were made for auths-0.1.13-cp38-abi3-musllinux_1_2_x86_64.whl:

Publisher: publish-python.yml on auths-dev/auths

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

File details

Details for the file auths-0.1.13-cp38-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for auths-0.1.13-cp38-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 60498ec878e40cfb55ab839fe221b67d5a51346514221043092fd84f6300c0f6
MD5 a0dfc348a0c500aa2d42c3e2dcc46230
BLAKE2b-256 39cf12d7c23bbf0fedf41b739f28f5024436d36e4d3b0497f4dff19993d3e95b

See more details on using hashes here.

Provenance

The following attestation bundles were made for auths-0.1.13-cp38-abi3-musllinux_1_2_aarch64.whl:

Publisher: publish-python.yml on auths-dev/auths

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

File details

Details for the file auths-0.1.13-cp38-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for auths-0.1.13-cp38-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e57282d4f6998c213ab2e3d2e8d41d7bcea1d5d4e6cc1879d44f883f39d3c02a
MD5 0f2644ea56fb382729ce2a7ef45ae81c
BLAKE2b-256 8bbbb31d5624b26fe4e6af67b8e165c7acbbc4c229cdbb7290991575f3ae1305

See more details on using hashes here.

Provenance

The following attestation bundles were made for auths-0.1.13-cp38-abi3-manylinux_2_28_x86_64.whl:

Publisher: publish-python.yml on auths-dev/auths

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

File details

Details for the file auths-0.1.13-cp38-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for auths-0.1.13-cp38-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 63af9d52d96975f4593bf1686bb8d2841be004f7d4a72ea7e93f4af723401a9f
MD5 db3c97b78df737bb3e43dee3839b3bd8
BLAKE2b-256 c17cf1b6eb9bf8feb53f7dba2725345daed3649d4f1999ed2c8c6a6f32a9c9c9

See more details on using hashes here.

Provenance

The following attestation bundles were made for auths-0.1.13-cp38-abi3-manylinux_2_28_aarch64.whl:

Publisher: publish-python.yml on auths-dev/auths

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

File details

Details for the file auths-0.1.13-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for auths-0.1.13-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 268479c9b1a33811e924b8ad26d89be4a010b42d1e66ad4ecacee7f5dba42ddc
MD5 580b965b530ed5212752cf5c05dcfe65
BLAKE2b-256 3c4d3c32d66e0ffe130ff4f492f4afeb6c92c177a3dd43bb765245e0019e997d

See more details on using hashes here.

Provenance

The following attestation bundles were made for auths-0.1.13-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl:

Publisher: publish-python.yml on auths-dev/auths

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

Release history Release notifications | RSS feed

0.1.16

7 files

This release

0.1.13 This release

7 files

0.1.12

7 files

0.1.11

7 files

0.1.10

7 files

0.1.9

7 files

0.1.8

7 files

0.1.7

7 files

0.1.6

7 files

0.1.5

7 files

0.1.3

7 files

0.1.2

7 files

0.1.1

7 files

0.1.0

5 files

Supported by

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