TypeScript implementation of the Agent Identity Protocol (AIP) for verifiable, delegable AI agent identity.
Full spec implementation including features not yet available in the Python SDK: DNS-based identity resolution, completion blocks for provenance, HTTP binding, and A2A binding.
| Package | Description |
|---|---|
@aip-sdk/core |
Ed25519 identity, key management, identity documents, DNS resolution, completion blocks |
@aip-sdk/token |
Compact (JWT+EdDSA) and chained (Biscuit+Datalog) tokens |
@aip-sdk/mcp |
MCP proxy middleware, audit, token verification, HTTP binding |
@aip-sdk/agents |
Framework adapters (LangChain.js, Vercel AI SDK), A2A binding |
npm install @aip-sdk/core @aip-sdk/tokenimport { KeyPair } from "@aip-sdk/core";
import { CompactToken } from "@aip-sdk/token";
// Generate identity
const keypair = await KeyPair.generate();
const aipId = `aip:key:ed25519:${keypair.publicKeyMultibase()}`;
// Issue token
const token = await CompactToken.create(
{
iss: aipId,
sub: "aip:key:ed25519:zAgent1",
scope: ["tool:search"],
max_depth: 0,
iat: Math.floor(Date.now() / 1000),
exp: Math.floor(Date.now() / 1000) + 3600,
},
keypair
);
// Verify token
const verified = await CompactToken.verify(token, keypair.publicKeyBytes());
console.log("Verified:", verified.claims.scope);Protect MCP servers with token verification:
import { AipProxy, ProxyConfig } from "@aip-sdk/mcp";
const config = new ProxyConfig({
upstream: "http://localhost:3000",
port: 8080,
trustKeys: ["z6MkhaXgBZDvotDkL5LQ..."],
});
const proxy = new AipProxy(config);
proxy.serveForever();import { AIPLangChainPlugin } from "@aip-sdk/agents";
const plugin = new AIPLangChainPlugin();
await plugin.register(agentExecutor, "search-agent");
const headers = await plugin.getToolCallHeaders("search-agent");
// { "X-AIP-Token": "eyJ..." }import { AIPVercelAIPlugin } from "@aip-sdk/agents";
const plugin = new AIPVercelAIPlugin();
await plugin.register("assistant", ["search", "calculate"]);
const headers = await plugin.getToolCallHeaders("assistant");- Paper: arXiv:2603.24775
- IETF: draft-prakash-aip-00
- Spec: sunilprakash.com/aip/
- Python SDK: agent-identity-protocol on PyPI
Apache 2.0