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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0184fcefcb66a4533176610b0a85b7ff1829b94bda207160d6579f68309d8948
|
|
| MD5 |
a42f3e4d899f12a69fc69e2b5e528e91
|
|
| BLAKE2b-256 |
474c72596687f294889232ee73e63f0bcb3b8ee8a0eb42ced437d4db611a54b4
|
Provenance
The following attestation bundles were made for auths-0.1.0.tar.gz:
Publisher:
publish-python.yml on auths-dev/auths
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
auths-0.1.0.tar.gz -
Subject digest:
0184fcefcb66a4533176610b0a85b7ff1829b94bda207160d6579f68309d8948 - Sigstore transparency entry: 1224051662
- Sigstore integration time:
-
Permalink:
auths-dev/auths@c2bc8a9abb1b782acf8948f94b8019148a0e49b5 -
Branch / Tag:
refs/tags/v0.0.1-rc.11 - Owner: https://github.com/auths-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@c2bc8a9abb1b782acf8948f94b8019148a0e49b5 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3144c079d6c73a8bf23b80733aaf90c3f6af17b9e5ea0c518f793d382e00fb27
|
|
| MD5 |
47c46a8f1669e3c23099c610a41f5d86
|
|
| BLAKE2b-256 |
e5a33bf6244264868fb0a320399fd95cec18e968a2cd54761d11e0e8a1ea7328
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
auths-0.1.0-cp38-abi3-win_amd64.whl -
Subject digest:
3144c079d6c73a8bf23b80733aaf90c3f6af17b9e5ea0c518f793d382e00fb27 - Sigstore transparency entry: 1224051785
- Sigstore integration time:
-
Permalink:
auths-dev/auths@c2bc8a9abb1b782acf8948f94b8019148a0e49b5 -
Branch / Tag:
refs/tags/v0.0.1-rc.11 - Owner: https://github.com/auths-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@c2bc8a9abb1b782acf8948f94b8019148a0e49b5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file auths-0.1.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: auths-0.1.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 6.1 MB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c8cbde59aad6507ee7fcb513951f20fcd149e8a08cb5aacf7644e1c746ca19d
|
|
| MD5 |
53fee5878da9cdeb6ce19012a038293a
|
|
| BLAKE2b-256 |
41c4d748969e50f36e13fd411c58b46fad45a4ddcdaef110ab0ca8165930010c
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
auths-0.1.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
9c8cbde59aad6507ee7fcb513951f20fcd149e8a08cb5aacf7644e1c746ca19d - Sigstore transparency entry: 1224051717
- Sigstore integration time:
-
Permalink:
auths-dev/auths@c2bc8a9abb1b782acf8948f94b8019148a0e49b5 -
Branch / Tag:
refs/tags/v0.0.1-rc.11 - Owner: https://github.com/auths-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@c2bc8a9abb1b782acf8948f94b8019148a0e49b5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file auths-0.1.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: auths-0.1.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 5.7 MB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9165d52cbd728ba742ae8be0672e52bd0da6e3080fbae8373b97c2514257bc10
|
|
| MD5 |
b1837a3c362362ec57211fa830a04b51
|
|
| BLAKE2b-256 |
843984b6b7519986d49bc02ea991bd81e971710652d882d2a6a50b5447854caa
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
auths-0.1.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
9165d52cbd728ba742ae8be0672e52bd0da6e3080fbae8373b97c2514257bc10 - Sigstore transparency entry: 1224051926
- Sigstore integration time:
-
Permalink:
auths-dev/auths@c2bc8a9abb1b782acf8948f94b8019148a0e49b5 -
Branch / Tag:
refs/tags/v0.0.1-rc.11 - Owner: https://github.com/auths-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@c2bc8a9abb1b782acf8948f94b8019148a0e49b5 -
Trigger Event:
push
-
Statement type:
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
- Download URL: auths-0.1.0-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
- Upload date:
- Size: 10.9 MB
- Tags: CPython 3.8+, macOS 10.12+ universal2 (ARM64, x86-64), macOS 10.12+ x86-64, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
64bd140af0148541ff686ea07419f08c3bdfdd1628aae22a0518caad679bd019
|
|
| MD5 |
d81a1889381917648d1c8b77ea8af865
|
|
| BLAKE2b-256 |
c4b0d9438982a4bc297eef5972da79d35a007134fc0890fdfe7dbb97ee74556f
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
auths-0.1.0-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl -
Subject digest:
64bd140af0148541ff686ea07419f08c3bdfdd1628aae22a0518caad679bd019 - Sigstore transparency entry: 1224051874
- Sigstore integration time:
-
Permalink:
auths-dev/auths@c2bc8a9abb1b782acf8948f94b8019148a0e49b5 -
Branch / Tag:
refs/tags/v0.0.1-rc.11 - Owner: https://github.com/auths-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@c2bc8a9abb1b782acf8948f94b8019148a0e49b5 -
Trigger Event:
push
-
Statement type: