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.5.tar.gz (1.7 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.5-cp38-abi3-win_amd64.whl (7.6 MB view details)

Uploaded CPython 3.8+Windows x86-64

auths-0.1.5-cp38-abi3-musllinux_1_2_x86_64.whl (7.8 MB view details)

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

auths-0.1.5-cp38-abi3-musllinux_1_2_aarch64.whl (7.3 MB view details)

Uploaded CPython 3.8+musllinux: musl 1.2+ ARM64

auths-0.1.5-cp38-abi3-manylinux_2_28_x86_64.whl (7.8 MB view details)

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

auths-0.1.5-cp38-abi3-manylinux_2_28_aarch64.whl (7.2 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.28+ ARM64

auths-0.1.5-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (13.9 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.5.tar.gz.

File metadata

  • Download URL: auths-0.1.5.tar.gz
  • Upload date:
  • Size: 1.7 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.5.tar.gz
Algorithm Hash digest
SHA256 3e9fa41d0b86a3962d8c339534e05cdab83379603b7c7c314f41cebded2a17b8
MD5 e441d980ddcdd98ec411ba13fba616c9
BLAKE2b-256 6c210e75c218ec93e7e2c75c77f62d8351042b778a28a6c863ee445453f76afa

See more details on using hashes here.

Provenance

The following attestation bundles were made for auths-0.1.5.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.5-cp38-abi3-win_amd64.whl.

File metadata

  • Download URL: auths-0.1.5-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 7.6 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.5-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 287fb81207b693b5f50f7907430d5cc786eb2517115cf1441b1a5e35abe315a4
MD5 7248078994fe21baffc910342bf6f70d
BLAKE2b-256 070851425e2d22a4edb853032029fd5e6027b8baa03d9d52717fabcc478ca4d4

See more details on using hashes here.

Provenance

The following attestation bundles were made for auths-0.1.5-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.5-cp38-abi3-musllinux_1_2_x86_64.whl.

File metadata

  • Download URL: auths-0.1.5-cp38-abi3-musllinux_1_2_x86_64.whl
  • Upload date:
  • Size: 7.8 MB
  • Tags: CPython 3.8+, musllinux: musl 1.2+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for auths-0.1.5-cp38-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 15d301d59d226518cfa9a8dd4f459742516e1beafc0f20b139fa53e507cf2677
MD5 389754943b514ae086c9419c0066affb
BLAKE2b-256 52f2537b7b16fdabe51fdf935a06b52dc138b7b528c43d8399f1d0b12ce536ae

See more details on using hashes here.

Provenance

The following attestation bundles were made for auths-0.1.5-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.5-cp38-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for auths-0.1.5-cp38-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 32a3e37e97dfbf8bf490c0d2dc72cf6a39267ef6bff9773af0b8d29e635e6e99
MD5 1889f7382322a24b05014055cb7c359c
BLAKE2b-256 65c78f3bf6ba2535084aa3482ccc3dad8b83e377e0011bdb4f4782ae8660b111

See more details on using hashes here.

Provenance

The following attestation bundles were made for auths-0.1.5-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.5-cp38-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for auths-0.1.5-cp38-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6676ee547464643d4f7cf9cedaa8392a61b2d8ea61a9f07103905ba54ccea9e6
MD5 39177b4f5c72b7eaea1d10ce4d726c52
BLAKE2b-256 ae48f2c21dee164bc314d841f3d4f97ac55f897f3593171c18a91a18cc3a1ca9

See more details on using hashes here.

Provenance

The following attestation bundles were made for auths-0.1.5-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.5-cp38-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for auths-0.1.5-cp38-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 b818d7f044c5b4c3f4ea6226114bb3dbb8388dc7164305d7aed418158cd547cb
MD5 50022efde2169a253c10361e186b1e95
BLAKE2b-256 de1ea8c66a7a6f24f8172c96bf36beb2de08baa215c12b8bfb26251e762f0c8a

See more details on using hashes here.

Provenance

The following attestation bundles were made for auths-0.1.5-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.5-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.5-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 edf1c30ca3d84f3e42bf99fb1068fba769a24e8b058ca1a160743d60dc2fabe7
MD5 0cf6885dc0dd6b2af4692ac3602a9a1b
BLAKE2b-256 ee3491798266c13a414ac99faab502e7f03b5196870181bf9034bebc91155da1

See more details on using hashes here.

Provenance

The following attestation bundles were made for auths-0.1.5-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

0.1.13

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

This release

0.1.5 This release

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