Skip to main content

Portable, signed, resolvable agent identity plus the cross-walk onto DID, FIDO, AP2, and EUDI. v0.

Project description

IdentityKit

Portable, signed, resolvable agent identity, plus the cross-walk onto the standards that will carry it. Deterministic, fail-closed, off-the-shelf crypto. v0.

As AI agents start to spend money and call APIs on someone's behalf, every counterparty asks the same question networks have always asked of parties: who is this, who stands behind it, and what is its track record? Today each platform answers that for itself, so a "verified" agent is a stranger everywhere else. IdentityKit is a portable answer.

It is the "who" beneath the rest of the Major Labs agent-safety family:

IdentityKit says who the agent is. MandateKit says what it may do. BudgetGuard caps what it spends. WitnessKit proves what it did.

MandateKit and WitnessKit already pin to raw public keys; IdentityKit makes those keys resolvable, attributable, and reputation-bearing.


What it does

  • Sign a portable identity document — an AgentIdentity: identifier, operator, public keys (with purposes), declared capabilities, and bindings to external credentials. Signed with a detached Ed25519 proof over RFC 8785 canonical JSON.
  • Resolve and verify — two identifier methods, with the trust model spelled out:
    • did:key — the identifier is the public key. Self-certifying, offline, trust nothing but the key.
    • did:web — the identifier is a domain. The document is fetched over HTTPS from that domain's well-known location and verified. Trust is anchored in DNS/TLS.
  • Cross-walk — map an identity onto a W3C DID Document, an AP2 issuer view (ties straight into MandateKit), and FIDO / EUDI / Verifiable Credential bindings.
  • Reputation as verifiable claims — store and verify signed, evidence-linked attestations (a mandate honored, an action witnessed). No score, no ranking — see below.

Install

pip install identitykit          # Python 3.8+ (install 'cryptography' for constant-time Ed25519)
npm install identitykit          # Node 22.6+

The Python core runs with zero third-party deps via a pure-Python Ed25519 fallback; install cryptography for production. The TS core uses Node's built-in Ed25519 and one small dependency (canonicalize) for RFC 8785.


Quickstart (Python)

from identitykit import generate_keypair, did_key_from_public, build_identity, sign_identity, verify_identity, crosswalk

seed, pub = generate_keypair()
did = did_key_from_public(pub)

identity = build_identity(
    id=did,
    operator={"name": "Acme Robotics", "type": "org"},
    keys=[{"id": f"{did}#0", "purpose": ["controller", "mandate-issuer"], "public_key": __import__("identitykit").signing.b64(pub)}],
    bindings=[{"standard": "ap2", "ref": "ap2:issuer:acme"}],
)
signed = sign_identity(identity, seed)
assert verify_identity(signed)               # True; tamper anywhere -> False

did_document = crosswalk.to_did_document(signed)   # W3C DID Document
ap2 = crosswalk.ap2_issuer(signed)                 # issuer view for MandateKit

Quickstart (TypeScript)

import { generateKeypair, didKeyFromPublic, buildIdentity, signIdentity, verifyIdentity, b64 } from "identitykit";

const { seed, publicKey } = generateKeypair();
const did = didKeyFromPublic(publicKey);
const signed = signIdentity(
  buildIdentity(did, { name: "Acme Robotics", type: "org" }, [
    { id: `${did}#0`, purpose: ["controller", "mandate-issuer"], public_key: b64(publicKey) },
  ]),
  seed,
);
verifyIdentity(signed); // true

Run the demo: python3 demo.py or npm run demo.


Reputation, deliberately thin

Reputation is where identity systems die: sybil attacks, gaming, "who attests the attesters." v0 does not score. It stores and verifies signed attestations that are evidence-linked (an evidence_ref should point at a WitnessKit trail or a settled mandate), and lets the reader decide. "Reputation" here means here are the verifiable claims about this agent and who made them, with proof. A scored model is out of scope until the data and the abuse model are understood.


Honest limitations (v0)

  • did:web trust is where you fetched it. verify_identity on a did:web document proves internal consistency (the proof matches a listed controller key). It does not prove the document is authentic on its own — that comes from resolving it from the actual domain over TLS. Use resolve() for that.
  • SSRF on did:web. The default resolver blocks loopback, private, and link-local hosts (including the cloud metadata IP), but does not resolve DNS, so a hostname pointing at an internal address is still the caller's risk. Use an allow-list for untrusted input.
  • No revocation or rotation yet. A v0 identity is a point-in-time document. Key rotation and revocation lists are planned.
  • Two methods only. did:key and did:web. No ledger-backed methods, by choice (no blockchain).

License

MIT. Built by Major Labs · github.com/major-matters

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

identitykit-0.0.2.tar.gz (21.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

identitykit-0.0.2-py3-none-any.whl (19.6 kB view details)

Uploaded Python 3

File details

Details for the file identitykit-0.0.2.tar.gz.

File metadata

  • Download URL: identitykit-0.0.2.tar.gz
  • Upload date:
  • Size: 21.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for identitykit-0.0.2.tar.gz
Algorithm Hash digest
SHA256 9370bd470414978b236b750514c9d44da6088d8481b53707a017dc3136ed9e86
MD5 bb53b41f974cc27a12867547bf8f3b48
BLAKE2b-256 5e84d34f645d4245a7ffaf0bd2a16a99fafddc22c2499737e6c9689adac2b8f9

See more details on using hashes here.

File details

Details for the file identitykit-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: identitykit-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 19.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for identitykit-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a2b907e864239e3b68d5da6c886c1f3ba57db565da2731efe3eff269ee1ac9e5
MD5 491ed331d44aebafebe1339aa07a4243
BLAKE2b-256 ee89973ffc5439db389cd228eac087caaa2d5c3a3ff1de83f0823214481eb938

See more details on using hashes here.

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