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.9.tar.gz (1.8 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.9-cp38-abi3-win_amd64.whl (8.0 MB view details)

Uploaded CPython 3.8+Windows x86-64

auths-0.1.9-cp38-abi3-musllinux_1_2_x86_64.whl (8.2 MB view details)

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

auths-0.1.9-cp38-abi3-musllinux_1_2_aarch64.whl (7.6 MB view details)

Uploaded CPython 3.8+musllinux: musl 1.2+ ARM64

auths-0.1.9-cp38-abi3-manylinux_2_28_x86_64.whl (8.2 MB view details)

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

auths-0.1.9-cp38-abi3-manylinux_2_28_aarch64.whl (7.6 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.28+ ARM64

auths-0.1.9-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (14.7 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.9.tar.gz.

File metadata

  • Download URL: auths-0.1.9.tar.gz
  • Upload date:
  • Size: 1.8 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.9.tar.gz
Algorithm Hash digest
SHA256 04de9223195c6ce02f5cecfda4429d647174cc76a4b0364419e283fc951c7730
MD5 b6ef7a49c6366b775ab1346fbd1354de
BLAKE2b-256 83e5936df2cf1ab3bfa62ddd11ef22d072fd0b46c5c290f1125f0f2cd4217354

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: auths-0.1.9-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 8.0 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.9-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 41cae89c531a2e5867d36165774b4b73de5bb5f56caded03332c368c061b587d
MD5 42664ff8dee65910cfed8a3afc1af190
BLAKE2b-256 8232c1a39fe85f8b2879406f3a3072dede17f2a444461cf30dd1db4034cf71cb

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: auths-0.1.9-cp38-abi3-musllinux_1_2_x86_64.whl
  • Upload date:
  • Size: 8.2 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.9-cp38-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 ba018c53aab4ed8547aefbbf1399282ef0330314e4956c99a446f2f90fa119f1
MD5 c43827947c9fea9bb120d47331ef69e1
BLAKE2b-256 18f2f614695aab589d03b1e22b2e41f26714d58942ff09e077f95cfd0329be95

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for auths-0.1.9-cp38-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 071c8c1fbb547e19335514309ad8d51d513e046647e983fc5b12d9348370aded
MD5 6b28c0d22c8f1d816424872425a81836
BLAKE2b-256 f54b664b4ed570a9dde00fa3642ee0c34deb32dfde94059b3955fa6b3f3687b5

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for auths-0.1.9-cp38-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4f4d4bc59a4cadffc2e3bcdde567a5ba6880f9e7a5ee375a07c616dd549fae04
MD5 e2a3b8b3427686a9e552218a2f8e972a
BLAKE2b-256 bf974c8f80fa3cb3f8be58727f9206f9153bd6941412c9be98040752fbf4998a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for auths-0.1.9-cp38-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 2eade456b324d6fc6fa841cbf7d0acbe27cd139000dddfa3db9ecf68bf27c065
MD5 32a7b7b40c6d428058f3a818406fbd4f
BLAKE2b-256 ad78911f830a5d8ba4ee184a084279f2852662a0626e3a682f32efe51b56f543

See more details on using hashes here.

Provenance

The following attestation bundles were made for auths-0.1.9-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.9-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.9-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 232257de8396d00e3ec86fbcfa9f3d486615a6db4954399dda69be31d1f61dff
MD5 695a20875e62d2abcdec7e2d4aea188f
BLAKE2b-256 00d5277ec76fa936f44880cdd80150784c0bf41456d7c9b2734886170044e4c2

See more details on using hashes here.

Provenance

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

This release

0.1.9 This release

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