Skip to main content

Auths Python SDK - decentralized identity for developers and AI agents

Project description

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")

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}")

Capability-aware verification

# Verify an attestation grants a specific capability
result = auths.verify(attestation_json=data, issuer_key=key, required_capability="sign_commit")

# Verify an entire chain grants a capability
report = auths.verify_chain(chain, root_key, required_capability="deploy")

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

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

auths-0.1.0.tar.gz (874.7 kB 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.0-cp38-abi3-win_amd64.whl (6.0 MB view details)

Uploaded CPython 3.8+Windows x86-64

auths-0.1.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.1 MB view details)

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

auths-0.1.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (5.7 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ARM64

auths-0.1.0-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (10.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.0.tar.gz.

File metadata

  • Download URL: auths-0.1.0.tar.gz
  • Upload date:
  • Size: 874.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for auths-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0184fcefcb66a4533176610b0a85b7ff1829b94bda207160d6579f68309d8948
MD5 a42f3e4d899f12a69fc69e2b5e528e91
BLAKE2b-256 474c72596687f294889232ee73e63f0bcb3b8ee8a0eb42ced437d4db611a54b4

See more details on using hashes here.

Provenance

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

File metadata

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

File hashes

Hashes for auths-0.1.0-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 3144c079d6c73a8bf23b80733aaf90c3f6af17b9e5ea0c518f793d382e00fb27
MD5 47c46a8f1669e3c23099c610a41f5d86
BLAKE2b-256 e5a33bf6244264868fb0a320399fd95cec18e968a2cd54761d11e0e8a1ea7328

See more details on using hashes here.

Provenance

The following attestation bundles were made for auths-0.1.0-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.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for auths-0.1.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9c8cbde59aad6507ee7fcb513951f20fcd149e8a08cb5aacf7644e1c746ca19d
MD5 53fee5878da9cdeb6ce19012a038293a
BLAKE2b-256 41c4d748969e50f36e13fd411c58b46fad45a4ddcdaef110ab0ca8165930010c

See more details on using hashes here.

Provenance

The following attestation bundles were made for auths-0.1.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_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.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for auths-0.1.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 9165d52cbd728ba742ae8be0672e52bd0da6e3080fbae8373b97c2514257bc10
MD5 b1837a3c362362ec57211fa830a04b51
BLAKE2b-256 843984b6b7519986d49bc02ea991bd81e971710652d882d2a6a50b5447854caa

See more details on using hashes here.

Provenance

The following attestation bundles were made for auths-0.1.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_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.0-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.0-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 64bd140af0148541ff686ea07419f08c3bdfdd1628aae22a0518caad679bd019
MD5 d81a1889381917648d1c8b77ea8af865
BLAKE2b-256 c4b0d9438982a4bc297eef5972da79d35a007134fc0890fdfe7dbb97ee74556f

See more details on using hashes here.

Provenance

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

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