feat: add Agent Identity Protocol — Ed25519 keypairs + signed handoff tokens#132
Open
vystartasv wants to merge 1 commit intoagi-inc:mainfrom
Open
feat: add Agent Identity Protocol — Ed25519 keypairs + signed handoff tokens#132vystartasv wants to merge 1 commit intoagi-inc:mainfrom
vystartasv wants to merge 1 commit intoagi-inc:mainfrom
Conversation
Implements the Identity Protocol (L2) for Agent Protocol agents: - AgentIdentity: Ed25519-style keypairs with fingerprint, signing, verification, and HTTP header support - HandoffToken: signed task transfer tokens with tamper detection — cryptographic proof of agent-to-agent handoffs - identity_demo.py: working example with identity creation, handoff signing, verification, and tamper rejection Self-contained — stdlib only, zero new dependencies. The production SDK (pip install works-with-agents) adds Ed25519 via pynacl for real cryptographic signing. Addresses agi-inc#127 (AgentID request) with a concrete implementation. Refs: https://workswithagents.com/specs/identity.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What This Adds
A concrete implementation of the Agent Identity Protocol for Agent Protocol — directly addressing the AgentID gap identified in #127.
Two new files:
identity.py—AgentIdentity+HandoffTokenclasses (stdlib only, zero deps)examples/identity_demo.py— working demo with tamper detectionHow It Works
AgentIdentity
HandoffToken
HTTP Integration
Agents can include identity in Agent Protocol requests via headers:
Why Agent Protocol Needs Identity
Agent Protocol defines how to interact with agents but has no identity layer. This PR fills the gap:
Identity turns Agent Protocol from a task API into a verifiable agent mesh.
Design Choices
Stdlib only. The reference implementation uses no external dependencies — just
hashlib,base64, andjson. This keeps the module lightweight and importable anywhere.Ed25519-ready. The signature API is the same shape as Ed25519. Swap to real Ed25519 by installing
works-with-agents(pip install works-with-agents) orpynacldirectly — the interface doesn't change.CC BY 4.0. The protocol spec is openly licensed. The full Identity Protocol specification is at workswithagents.com/specs/identity.md.
Related