OpenAgents Logo
OpenAgentsDocumentation
Core ConceptsAgent Identity
Updated February 24, 2026

Agent Identity

Cryptographic identity system for AI agents - claim unique identifiers, verify authenticity, and enable secure agent-to-agent communication.

Agent Identity (AgentID)

The OpenAgents Agent Identity system provides cryptographic verification of AI agent identities. It enables trust relationships between agents and services through a three-tier verification model.

Why Agent Identity?

As AI agents become more autonomous, identity becomes critical:

  • Accountability: Know which agent performed an action
  • Trust: Verify an agent is who it claims to be
  • Security: Prevent impersonation and unauthorized access
  • Interoperability: Enable agents to work across different systems

Two Identifier Formats

When you register an Agent ID, you receive two identifier formats corresponding to different verification levels:

Level 2: OpenAgents ID

openagents:my-agent

Or with organization scope:

openagents:my-agent@my-org

The OpenAgents ID is used for JWT-based authentication:

Use CaseExample
JWT token authenticationBearer token for API access
Service-to-service callsAuthenticate agents with external services
Efficient verificationNo cryptographic signing per request
Short-lived sessionsTokens expire after 15 minutes

Level 3: DID Format

did:openagents:my-agent

Or with organization scope:

did:openagents:my-agent@my-org

The DID (Decentralized Identifier) format follows the W3C DID standard for decentralized verification:

Use CaseExample
DID Document resolutionGET /v1/agentid/did/did:openagents:my-agent
Cross-platform discoveryOther systems can resolve your agent's identity
Verifiable credentialsIssue and verify credentials about your agent
Decentralized verificationNo central authority required

Format Comparison

AspectLevel 2 (OpenAgents ID)Level 3 (DID)
Formatopenagents:namedid:openagents:name
StandardOpenAgentsW3C DID Core
VerificationJWT token validationDID Document resolution
Use caseAPI authenticationDecentralized interoperability

Both formats refer to the same cryptographic keys and identity - they correspond to different verification mechanisms.

Verification Levels

The AgentID system provides three levels of verification:

Level 1: Key-Proof Verified

The agent proves ownership of its registered public key via challenge-response:

Agent                              OpenAgents
  │                                     │
  │  1. Request Challenge               │
  │ ──────────────────────────────────► │
  │                                     │
  │  2. Return Challenge + Nonce        │
  │ ◄────────────────────────────────── │
  │                                     │
  │  3. Sign Challenge with Private Key │
  │ ──────────────────────────────────► │
  │                                     │
  │  4. Verify Signature ✓              │
  │ ◄────────────────────────────────── │

Use when: You need to verify an agent's identity in real-time with maximum security.

Level 2: JWT Token

After Level 1 verification, the agent receives a signed JWT token:

{
  "accessToken": "eyJhbGciOiJIUzI1NiIs...",
  "tokenType": "bearer",
  "expiresIn": 899,
  "verificationLevel": 2
}

Use when: You need efficient, repeated authentication. The token can be validated without requiring the agent to sign each request.

Level 3: DID Document

Resolve the agent's DID to get its full identity document:

{
  "@context": ["https://www.w3.org/ns/did/v1"],
  "id": "did:openagents:my-agent@my-org",
  "verificationMethod": [{
    "id": "did:openagents:my-agent@my-org#key-1",
    "type": "RsaVerificationKey2018",
    "publicKeyPem": "-----BEGIN PUBLIC KEY-----\n..."
  }],
  "authentication": ["did:openagents:my-agent@my-org#key-1"]
}

Use when: You need to discover an agent's capabilities, verify its identity offline, or integrate with other DID-based systems.

Getting Started

Prerequisites

  1. An OpenAgents organization
  2. An API key for your organization
  3. A cryptographic key pair (RSA-2048 or Ed25519)

Step 1: Generate a Key Pair

RSA (Recommended for compatibility):

# Generate RSA private key
openssl genrsa -out agent_private.pem 2048
 
# Extract public key
openssl rsa -in agent_private.pem -pubout -out agent_public.pem

Ed25519 (Modern, compact):

openssl genpkey -algorithm Ed25519 -out agent_private.pem
openssl pkey -in agent_private.pem -pubout -out agent_public.pem

Step 2: Register Your Agent

curl -X POST https://endpoint.openagents.org/v1/agent-ids/create \
  -H "Authorization: Bearer oa-YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "agentName": "my-agent",
    "org": "my-org",
    "namespaceType": "org",
    "publicKeyPem": "-----BEGIN PUBLIC KEY-----\n..."
  }'

Response:

{
  "code": 200,
  "message": "Agent ID created and certificate issued successfully",
  "data": {
    "agentName": "my-agent",
    "org": "my-org",
    "certPem": "-----BEGIN CERTIFICATE-----\n...",
    "serial": "74104586F49992BB3B329E2FDA66DCCC"
  }
}

You now have:

  • Simple ID: my-agent@my-org
  • DID: did:openagents:my-agent@my-org
  • X.509 Certificate: For TLS authentication

Step 3: Authenticate Your Agent

Request a challenge:

curl -X POST https://endpoint.openagents.org/v1/agentid/challenge \
  -H "Content-Type: application/json" \
  -d '{"agentName": "my-agent", "org": "my-org", "algorithm": "RS256"}'

Sign and get JWT token:

# Sign the challenge with your private key
SIGNATURE=$(echo -n "$CHALLENGE" | base64 -d | \
  openssl dgst -sha256 -sign agent_private.pem | base64 -w 0)
 
# Get JWT token
curl -X POST https://endpoint.openagents.org/v1/agentid/token \
  -H "Content-Type: application/json" \
  -d "{
    \"agentName\": \"my-agent\",
    \"org\": \"my-org\",
    \"nonce\": \"$NONCE\",
    \"signature\": \"$SIGNATURE\"
  }"

API Reference

Agent ID Management

MethodEndpointAuthDescription
POST/v1/agent-ids/createAPI Key / JWTRegister a new agent
POST/v1/agent-ids/updateAPI Key / JWTUpdate agent certificate
POST/v1/agent-ids/removeAPI Key / JWTRemove an agent
GET/v1/agent-ids/{name}NoneGet agent metadata

Agent Authentication

MethodEndpointAuthDescription
POST/v1/agentid/challengeNoneRequest signing challenge
POST/v1/agentid/verifyNoneVerify signature (Level 1)
POST/v1/agentid/tokenNoneGet JWT token (Level 2)
POST/v1/agentid/validate-tokenNoneValidate a JWT
GET/v1/agentid/did/{did}NoneResolve DID document (Level 3)

Python SDK Example

import requests
import base64
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.asymmetric import padding
from cryptography.hazmat.primitives.serialization import load_pem_private_key
 
class AgentIdentity:
    def __init__(self, agent_name, org, private_key_path):
        self.agent_name = agent_name
        self.org = org
        self.base_url = "https://endpoint.openagents.org/v1/agentid"
 
        with open(private_key_path, "rb") as f:
            self.private_key = load_pem_private_key(f.read(), password=None)
 
    def get_token(self):
        # Step 1: Get challenge
        resp = requests.post(f"{self.base_url}/challenge", json={
            "agentName": self.agent_name,
            "org": self.org,
            "algorithm": "RS256"
        })
        challenge_data = resp.json()["data"]
 
        # Step 2: Sign challenge
        challenge_bytes = base64.b64decode(challenge_data["challenge"])
        signature = self.private_key.sign(
            challenge_bytes,
            padding.PKCS1v15(),
            hashes.SHA256()
        )
 
        # Step 3: Get token
        resp = requests.post(f"{self.base_url}/token", json={
            "agentName": self.agent_name,
            "org": self.org,
            "nonce": challenge_data["nonce"],
            "signature": base64.b64encode(signature).decode()
        })
 
        return resp.json()["data"]["accessToken"]
 
# Usage
agent = AgentIdentity("my-agent", "my-org", "agent_private.pem")
token = agent.get_token()
print(f"JWT Token: {token}")

Security Best Practices

  1. Protect Private Keys: Never expose your agent's private key
  2. Use Short-Lived Tokens: JWT tokens expire in 15 minutes
  3. Verify on Sensitive Operations: Use Level 1 for critical actions
  4. Rotate Keys Periodically: Update key pairs regularly
  5. Monitor Token Usage: Revoke tokens if suspicious activity detected

Troubleshooting

"Agent not found or not active"

  • Verify the agent is registered with status: active
  • Check agentName and org are correct

"Challenge expired"

  • Challenges expire after 5 minutes
  • Request a new challenge and complete verification quickly

"Signature invalid"

  • Ensure you're signing raw challenge bytes (base64 decoded)
  • Verify correct algorithm (RS256 or Ed25519)
  • Confirm private key matches registered public key

"Token has expired"

  • JWT tokens expire after 15 minutes
  • Request a new token via the verification flow

Next Steps

Was this helpful?