Skip to main content

oneid-sdk

Python SDK for 1id.com -- hardware-anchored identity for AI agents.

Implements the AIRS (Agent Identity Registry System) drafts:

  • draft-drake-email-hardware-attestation-03 -- email attestation via hardware keys
  • draft-drake-agent-identity-registry-05 -- agent identity registry protocol

Quick start

import oneid

# Enroll at declared tier (no HSM needed, always works)
identity = oneid.enroll(request_tier="declared", display_name="Sparky")
print(f"Enrolled: {identity.handle}")
# URN: urn:aid:global:id-XXXXX-XXXXX-XXXXX-XXXXX
print(f"URN: {identity.agent_identity_urn}")

# Call an API that accepts 1ID tokens. Tokens are sender-constrained (cnf.jwk):
# each request is signed with your enrolled key (RFC 9421), so a copied token
# alone is refused. This does the signing for you:
response = oneid.send_http_request_with_sender_constrained_token(
  "GET", "https://1id.com/api/v1/identity/devices")
# From the shell: oneid request GET https://1id.com/api/v1/identity/devices

# Check identity
me = oneid.whoami()
print(f"I am {me.handle}, trust tier: {me.trust_tier.value}")

Hardware-backed enrollment

# TPM enrollment (sovereign tier) - requires Windows/Linux with TPM 2.0
identity = oneid.enroll(request_tier="sovereign")

# YubiKey enrollment (portable tier) - requires YubiKey 5 inserted
identity = oneid.enroll(request_tier="portable")

# Virtual TPM (VMware/Hyper-V/QEMU)
identity = oneid.enroll(request_tier="virtual")

Trust tiers

Tier Hardware Sybil Resistant Trust Level
sovereign TPM (Intel, AMD, Infineon) with valid cert Yes Highest
portable YubiKey with PIV attestation (other PIV vendors are not yet accepted) Yes High
virtual VMware / Hyper-V / QEMU vTPM No Verified Hardware
declared None (software keys) No Software

request_tier is a requirement, not a preference. You get exactly what you ask for, or an exception. No silent fallbacks.

Key algorithms

Like SSH, agents can choose their preferred key algorithm for declared-tier enrollment. Only ECDSA P-256 (the default) and RSA keys can also sign email Hardware-Attestation (Mode 1) proofs; Ed25519 and P-384 keys work for authentication only:

identity = oneid.enroll(request_tier="declared", key_algorithm="ecdsa-p256")  # default (ES256; signs email)
identity = oneid.enroll(request_tier="declared", key_algorithm="ed25519")     # authentication only
identity = oneid.enroll(request_tier="declared", key_algorithm="rsa-4096")    # RSA (RS256; signs email)

Verifying another agent (peer verification)

import os, oneid

nonce = os.urandom(32)                          # verifier: a fresh challenge
bundle = oneid.sign_challenge(nonce)            # prover: enrolled key + Registrar binding
peer = oneid.verify_peer_identity(nonce, bundle.to_dict())   # verifier
print(peer.agent_identity_urn, peer.trust_tier, peer.hardware_locked)

The verifier resolves the peer's identity at the AIRS Registry (it must be operational), takes the current issuer from there, checks the Registrar binding against that issuer's published keys, then checks the nonce signature with the bound key. Trust tier and identity facts never come from the bundle. This is online by design (a decommissioned identity fails); the Node SDK (verifyPeerIdentity) is equivalent and bundles are interchangeable.

Installation

pip install oneid

Requires Python 3.10+.

License

Apache-2.0

Metadata

Release files for oneid 4.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for oneid 4.0.0
File Size Uploaded Provenance Actions
oneid-4.0.0.tar.gz 190.3 kB Without provenance Details for oneid-4.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for oneid 4.0.0
File Interpreter ABI Platform Actions
oneid-4.0.0-py3-none-any.whl Python 3 none any Details for oneid-4.0.0-py3-none-any.whl

Total release size: 323.6 kB

Release files / oneid-4.0.0.tar.gz

Download URL oneid-4.0.0.tar.gz
Size 190.3 kB
Tags Source
SHA-256 checksum
How to use checksums
75e0c7020f53e7e6f815a3da042834003db3f8b3e3837ea48e6c66b06f30ef2a
BLAKE2b-256 checksum
How to use checksums
2caf576627eb15054606f68dcebbac2b86efc1787054aeac22b6f16fc51dc0c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.14

Release files / oneid-4.0.0-py3-none-any.whl

Download URL oneid-4.0.0-py3-none-any.whl
Size 133.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
927bad0260b195de0ed5027e912c84f6b3803b847517b7cb1967bb2c01e7ab3e
BLAKE2b-256 checksum
How to use checksums
2232bb650ba3df66905edeebedb06b81257635f782a4a97d3591225e7edefbe0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.14

Security for oneid 4.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

4.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page