Node SDK — feature guide
Node.js SDK for the AITP reference implementation
This page is a feature-by-feature pointer into bindings/aitp-node.
Each section names the RFC, the Cargo feature flag (if any), and a short
example. The auto-generated
index.d.ts has the full TypeScript
signatures.
The Python SDK covers the same operations; see sdk-python.md
and its Python vs Node differences
table.
The JavaScript blocks on this page run as one connected flow. Names defined
in an earlier block (alice, bob, tctJws, …) are reused later. CI runs
every block as written, through
bindings/aitp-node/tests/test_docs_samples.mjs.
That test fails if a block here changes without the test changing too. The
test imports from ../index.js instead of the package name.
Install
npm install @agentidentitytrustprotocol/aitpPrebuilt native binaries are published for macOS (x64, arm64) and Linux GNU
(x64, arm64). For the current version, see the
releases or
bindings/aitp-node/package.json.
Build
npm install
npm run build:debug # default surface, as published
npm run build:experimental # adds the experimental features (see below)
npm run build:minimal:debug # without SPKI pinning (--no-default-features)
# Release variants:
npm run build
npm run build:minimalDefault surface
Mutual handshake (RFC-AITP-0004)
import { AitpAgent } from '@agentidentitytrustprotocol/aitp';
const alice = AitpAgent.generate();
const bob = AitpAgent.generate();
const bobManifest = bob.buildManifest({
displayName: 'bob',
handshakeEndpoint: 'https://bob.example/aitp/handshake/',
offeredCaps: ['demo.echo'],
});
alice.buildManifest({
displayName: 'alice',
handshakeEndpoint: 'https://alice.example/aitp/handshake/',
offeredCaps: ['demo.write'],
});
// Each side lists the peer AIDs it trusts as pinned keys (RFC-AITP-0002 §3.2).
const s = alice.newSession(null, { pinnedKeys: [bob.aid] });
const r = bob.newResponder(null, { pinnedKeys: [alice.aid] });
// 4 messages — each call's output is the next peer's input.
const hello = s.buildHello(bobManifest, ['demo.echo']);
const { ackJson, sessionId } = r.processHello(hello);
const commit = s.processHelloAck(ackJson, sessionId);
const { ackJson: cack, completed: bobSide } = r.processCommit(commit, []); // bobSide: what alice issued to bob
const held = s.complete(cack, []);
const tctJws = held.tct; // compact JWS issued by bob — store / present this
const claims = held.claims; // decoded { iss, sub, aud, grants, iat, exp, jti }
const voucherJws = held.grantVoucher; // compact JWS, or undefined if bob disallowed delegationcomplete() and processCommit().completed return a JsCompletedHandshake
object. Its claims field is a subset of the TCT claim set: it omits ver
and cnf. The full claim set is defined in
RFC-AITP-0005 §2.
The session classes are exported as JsInitiatorSession and
JsResponderSession.
newSession(jwks?, opts?) and newResponder(jwks?, opts?) accept
opts.trustAnchors and opts.pinnedKeys. trustAnchors overrides the agent
manifest's accepted_trust_anchors for that one session. The
OIDC section shows when you need it.
opts.pinnedKeys is the session's local pinned-key trust store
(RFC-AITP-0002 §3.2):
an array of peer AID strings, Ed25519 or P-256. A peer that presents a
pinned_key identity is accepted only if its AID is in the array, and the
check runs before the proof is verified. Omitting pinnedKeys (or passing
[]) trusts no pinned key, so every pinned_key peer is rejected: the
handshake call throws an Error whose message reports IDENTITY_FAILED.
An entry that is not a valid AID throws when the session is created.
Possessing the private key is not enough; the verifier must already know the
key.
Upgrading to 0.14. Before 0.14 a session accepted any
pinned_keypeer that proved possession of its key. That mode is gone. Pass the peer's AID (itsaidgetter, ormanifest.aidfrom the manifest you fetched and chose to trust) asopts.pinnedKeyson bothnewSessionandnewResponder, or every pinned-key handshake fails.
TCT verification (RFC-AITP-0005 §7.2)
A TCT is an opaque compact JWS string. verifyTct runs the verification order
in
RFC-AITP-0005 §7.2.
It returns { peerAid, grants, expiresAt, jti }, where peerAid is the
issuer. The spec integration guide,
Step 2: Verify locally,
explains what a verifier checks and why.
// Holder-receipt model — the verifier's AID is the agent's own AID (default).
const ident = alice.verifyTct(tctJws, 'demo.echo', undefined, []);
console.log(ident.peerAid === bob.aid, ident.grants); // true [ 'demo.echo' ]
// Presented-TCT model — a resource server checking a TCT a peer presented
// (e.g. in `X-AITP-TCT`). It challenges the presenter for proof of possession
// (RFC-AITP-0005 §6); verifyTct then checks the TCT and the PoP response
// together and pins the audience to the proven holder AID (the TCT's `sub`).
const challenge = bob.newPopChallenge(tctJws); // send to the presenter
const response = alice.signPopResponse(challenge); // the presenter's reply
const presented = bob.verifyTct(tctJws, 'demo.echo', null, [], undefined, { challenge, response });
// Revocation is fail_closed: pass the issuer's revoked TCT `jti`s (`[]` when
// nothing is revoked). A revoked jti and a missing list both throw with
// `code === 'TCT_REVOKED'`.
try {
alice.verifyTct(tctJws, 'demo.echo', null, [ident.jti]);
} catch (err) {
console.log(err.code, err.message); // TCT_REVOKED TCT verification failed: TCT jti is revoked
}
try {
alice.verifyTct(tctJws, 'demo.echo'); // no list: status unavailable
} catch (err) {
console.log(err.code); // TCT_REVOKED
}
// Explicit opt-out, for a deployment with no revocation source at all.
alice.verifyTct(tctJws, 'demo.echo', null, undefined, 'fail_open');Revocation is fail_closed (RFC-AITP-0008 §3.1): without revokedJtis
every TCT is rejected, because an unknown revocation status counts as
revoked. Pass 'fail_open' as the revocation argument only when the
deployment has no revocation source; any other value throws.
The issuer side of the same rule: every agent that issues TCTs MUST advertise
its ListRevoked URL in its signed Manifest (RFC-AITP-0005 §11,
RFC-AITP-0008 §1.4). Pass revocationListUri to buildManifest,
conventionally your origin plus REVOCATION_LIST_PATH
(/.well-known/aitp-revocation-list). Without it, a fail_closed verifier
that discovers lists through the Manifest rejects your TCTs as TCT_REVOKED.
// not executed: fragment
agent.buildManifest({
displayName: 'alice',
handshakeEndpoint: 'https://alice.example/aitp/handshake/',
offeredCaps: ['demo.echo'],
revocationListUri: `https://alice.example${REVOCATION_LIST_PATH}`,
});A revocation failure (a listed jti, or no list under fail_closed) throws
an Error whose code is 'TCT_REVOKED'. A PoP failure throws one whose
code is 'POP_CHALLENGE_INVALID' (a malformed or stale challenge) or
'POP_RESPONSE_INVALID' (any other RFC-AITP-0005 §6.2 step). Every other failed verification
throws an Error whose code is napi's generic GenericFailure; the Rust
core's other TCT codes appear only in the message text, so do not branch on
that text.
Downstream proof of possession
Verify a TCT a peer presents with pop: { challenge, response }, as in the
presented-TCT example above. That is the only way the SDK checks that the
presenter holds the key the TCT is bound to
(RFC-AITP-0005 §6).
pop and expectedAudience are mutually exclusive. If you pass
expectedAudience instead, the presenter's AID must come from an
authenticated source, such as a verified PoP response or an equivalent
channel binding (mTLS with a bound client certificate). Never take it from
the token's own aud: that makes the audience check vacuous.
AitpAgent.newPopChallenge(tctToken, ttlSecs?)is the consumer side (ttlSecsdefaults to 60). It returns apop_challengepayload (tct_jti, a 128-bit CSPRNGnonce,expires_at).AitpAgent.signPopResponse(challengeJson)is the holder side. It signssha256of the decoded nonce bytes and returns thepop_responsepayload.verifyPopResponse(challengeJson, responseJson, tctToken)runs only the §6.2 checks and returns the proven holder AID. It does not verify the TCT itself.
The JSON values are envelope payloads: wrap them with signEnvelope for the
wire. Replay protection stays with the caller (RFC-AITP-0001 §5.5): the SDK
keeps no record of issued challenges. Accept a response to each challenge at
most once.
Cached verification (TctStore)
verifyTctCached is an AitpAgent method. Use it when a verifier sees the
same TCT on many requests:
import { TctStore } from '@agentidentitytrustprotocol/aitp';
const store = new TctStore(1024);
alice.verifyTctCached(tctJws, 'demo.echo', store, undefined, []);
alice.verifyTctCached(tctJws, 'demo.echo', store, undefined, []); // signature check skipped
console.log(store.len()); // 1The cache key is the SHA-256 of the exact token bytes, so only a
byte-identical token can hit. Expiry, audience, required grant and
revokedJtis are re-checked on every call, including cache hits.
Verifying without this SDK
A TCT verifies under any stock JOSE library (node
jose) given only the issuer's public key.
See architecture.md § Debugging a TCT. For
an independent implementation of the full check, see
aitp_verifier/tct.py
and
aitp_verifier/jws.py
in aitp-verifier-py.
Delegation (RFC-AITP-0006)
buildDelegation takes the grant voucher the delegator received in the
handshake (held.grantVoucher above). The delegatee's key binding comes from
its AID, so you pass no public key. The voucher model is described in
RFC-AITP-0006
and
RFC-AITP-0005 §8.
import { verifyDelegation } from '@agentidentitytrustprotocol/aitp';
const carol = AitpAgent.generate();
// alice's Manifest: bob checks her signature under the key it designates.
const aliceManifest = alice.buildManifest({
displayName: 'alice',
handshakeEndpoint: 'https://alice.example/aitp/handshake/',
offeredCaps: ['demo.write'],
});
// alice delegates part of what bob granted her to carol.
const delegationJws = alice.buildDelegation(voucherJws, carol.aid, ['demo.echo']);
// bob (the original grantor) verifies and mints carol a TCT of her own.
const revoked = []; // bob's deny list, e.g. jtis from verified revocation snapshots
const verified = verifyDelegation(delegationJws, bob.aid, [aliceManifest], revoked);
const { tct: carolTct, grantVoucher: carolVoucher } = bob.issueTctForDelegatee(verified);
console.log(carol.verifyTct(carolTct, 'demo.echo', undefined, []).peerAid === bob.aid); // trueThe signature is buildDelegation(voucherToken, delegateeAid, scope, ttlSecs?).
verifyDelegation(token, verifierAid, issuerManifests, revokedJtis?) is strict
single-hop: it rejects any token that carries a multi-hop chain.
issuerManifests holds the delegator's Manifest as {"manifest": ...} JSON
strings. The token is verified under the key that Manifest designates
(RFC-AITP-0006 §4 step 1); without a valid one it fails with
KEY_RESOLUTION_FAILED. Pass revokedJtis. If
you omit it, a delegation whose source TCT has been revoked is still
redeemed. The result's cnfJkt is the delegatee's cnf.jkt (Python:
cnf_jkt). For multi-hop chains, see
Multi-hop delegation.
Manifest verification
import { verifyManifestJson } from '@agentidentitytrustprotocol/aitp';
verifyManifestJson(bobManifest); // returns undefined on success
try {
verifyManifestJson(bobManifest, 4_102_444_800); // year 2100
} catch (err) {
console.log(err.code); // expired
}- Verification failures throw an
Errorwhosecodeis one ofsignature_invalid,pop_failed,aid_mismatch,expired,version_unknown,identity_hint_malformed,incompatible_identity_type,unknown_fieldormalformed. Branch onerror.code, not onerror.message. - Unparseable JSON, and JSON with a duplicate key anywhere
(RFC-AITP-0001 §5.4.5), gives
malformed. - Unknown members (the
UNKNOWN_FIELDcase, RFC-AITP-0001 §7) giveunknown_field. The binding runs the same hardened wire parser as the HTTP transport (#152). - The optional second argument
nowUnixSecsoverrides the verification clock. A non-finite value throws; every clock argument in the SDK refuses one. buildHelloverifies the peer's Manifest first (RFC-AITP-0003 §5), including that it accepts this agent's identity type. A Manifest that fails throws with its registry code in.code, and nothing is built or sent.handshakeEndpointmust behttps://(RFC-AITP-0003 §5 step 2). For local development, the optional third argumentinsecureLocalhostDangerousalso accepts plainhttp://localhostandhttp://127.0.0.1, and nothing else.newSessionandnewRespondertake it in their options, andverifyDelegationas its last argument. It is off by default.
Revocation lists (RFC-AITP-0008)
import { randomUUID } from 'node:crypto';
import { verifyRevocationList, revocationSigningBytes } from '@agentidentitytrustprotocol/aitp';
const snapshot = bob.signRevocationList(
[{ jti: randomUUID(), reason: 'compromised' }], // jti must be a lowercase UUID v4
600,
);
verifyRevocationList(snapshot, bob.aid); // pin the expected issuer
try {
verifyRevocationList(snapshot, alice.aid);
} catch (err) {
console.log(err.code); // issuer_mismatch
}
revoked.push(...JSON.parse(snapshot).revocation_list.entries.map((e) => e.jti));
const signedBytes = revocationSigningBytes(snapshot); // Buffer: JCS of the inner bodysignRevocationList entries take jti (a lowercase hyphenated UUID v4,
as randomUUID() returns; any other form throws), plus optional
revokedAt (unix seconds, defaulting to now) and reason.
verifyRevocationList(envelopeJson, expectedIssuerAid, nowUnixSecs?) returns
on success. On failure it throws an Error whose code is one of
signature_invalid, issuer_mismatch, version_unknown, expired,
unknown_field (a member outside the schema) or malformed (including a
duplicate JSON key). An invalid expectedIssuerAid throws with napi's generic GenericFailure
code instead.
These are the binding's own lowercase cause codes, not the spec's registered
codes. version_unknown (a version other than aitp/0.3, checked before
the signature) and malformed are separate codes here, but
both are the spec's REVOCATION_SNAPSHOT_INVALID (spec VERSIONING.md).
The function checks only that the snapshot is authentic and has not expired. It does not decide whether the snapshot is fresh enough. That policy belongs to you; see RFC-AITP-0008 §3 and the spec's operational guidance.
Envelope signatures (RFC-AITP-0001 §5.4)
import { verifyEnvelope } from '@agentidentitytrustprotocol/aitp';
const envelope = bob.signEnvelope('mutual_hello', JSON.stringify({ hello: true }), {
extensionsJson: JSON.stringify({ 'com.example.trace': { id: 't-1' } }), // optional
});
verifyEnvelope(envelope, bob.aid); // pin the expected sender
const tampered = { ...JSON.parse(envelope), message_type: 'mutual_hello_ack' };
try {
verifyEnvelope(JSON.stringify(tampered), bob.aid);
} catch (err) {
console.log(err.code); // INVALID_SIGNATURE
}signEnvelope(messageType, payloadJson, opts?) signs an aitp/0.3 envelope
over signing input v2. The signature covers every member except signature,
including extensions. opts takes extensionsJson, messageId (a
lowercase hyphenated UUID v4, defaulting to a fresh one; any other form
throws) and timestamp (unix seconds, defaulting to now).
verifyEnvelope(envelopeJson, expectedSenderAid) returns on success. On
failure it throws an Error whose code is the registered spec code of the
first failing step of the RFC-AITP-0001 §5.4 check order:
UNKNOWN_VERSION:versionis absent or is notaitp/0.3.aitp/0.2is rejected exactly likeaitp/9.9.UNKNOWN_FIELD: a member outside the schema and outsideextensions.INVALID_ENVELOPE: any other structural defect, such as a duplicate JSON key (RFC-AITP-0001 §5.4.5), a missing member, an unregisteredmessage_typeor a non-v4message_id.INVALID_SIGNATURE: the signature does not verify under the expected sender's key, orsender.agent_idis notexpectedSenderAid.
The key comes from expectedSenderAid, since every AID encodes its public
key. An invalid expectedSenderAid throws with napi's generic
GenericFailure code instead.
The function checks only that the envelope is well formed and authentic. It
does not check the timestamp window or deduplicate message_id
(RFC-AITP-0001 §5.5). A receiving endpoint runs those checks itself, in the
order RFC-AITP-0009 §3.1 sets out.
OIDC identity (RFC-AITP-0002)
import { JwksProvider, computeAidJkt } from '@agentidentitytrustprotocol/aitp';
// You fetch the IdP's JWKS yourself; the SDK does no HTTP.
const jwks = new JwksProvider({ 'https://idp.example/': [idpJwk] });
const dave = AitpAgent.generate();
dave.buildManifest({
displayName: 'dave',
handshakeEndpoint: 'https://dave.example/aitp/handshake/',
offeredCaps: ['demo.write'],
identityType: 'oidc',
oidcIssuer: 'https://idp.example/',
oidcSubject: 'dave',
acceptedIdentityTypes: ['oidc', 'pinned_key'], // bob presents a pinned key
});
// Synchronous callback: return a fresh JWT bound to this handshake and dave's key.
const mint = (popNonce) =>
myIdp.mintJwtSync({ sub: 'dave', aud: bob.aid, nonce: popNonce, cnfJkt: computeAidJkt(dave.aid) });
// Each side must list the other's identity type (RFC-AITP-0004 §5.1 step 8),
// so bob re-publishes a manifest that accepts OIDC peers too.
const bobOidcManifest = bob.buildManifest({
displayName: 'bob',
handshakeEndpoint: 'https://bob.example/aitp/handshake/',
offeredCaps: ['demo.echo'],
acceptedIdentityTypes: ['pinned_key', 'oidc'],
});
const sess = dave.newSession(jwks, { pinnedKeys: [bob.aid] }); // bob answers with a pinned key
const oidcHello = sess.buildHello(bobOidcManifest, ['demo.echo'], mint);
// bob's manifest accepts no OIDC issuer by default, so his responder must
// trust the IdP explicitly.
const responder = bob.newResponder(jwks, { trustAnchors: ['https://idp.example/'] });
const oidcAck = responder.processHello(oidcHello);The oidcMintJwt callback is synchronous. It runs on the main thread
inside the buildHello / processHello call, so do not pass an async
function. It receives the handshake's pop_nonce and returns a compact JWT.
The claims that JWT must carry are defined in
RFC-AITP-0002 §2.2.
computeAidJkt(aid) computes the cnf.jkt value for an Ed25519 or P-256 AID.
P-256 signing suite (RFC-AITP-0001 §5.4.3)
const erin = AitpAgent.generate({ suite: 'p256' }); // aid:pubkey:p256:…
const erinAgain = AitpAgent.fromSeed(Buffer.alloc(32, 7), { suite: 'p256' }); // deterministic
const erinManifest = erin.buildManifest({
displayName: 'erin',
handshakeEndpoint: 'https://erin.example/aitp/handshake/',
offeredCaps: ['demo.echo'],
}); // pinned_key is the default; public_key is the 33-byte compressed point
verifyManifestJson(erinManifest);
// A P-256 peer is pinned by its AID, exactly like an Ed25519 one.
const pSess = bob.newSession(null, { pinnedKeys: [erin.aid] });
const pResp = erin.newResponder(null, { pinnedKeys: [bob.aid] });
const pAck = pResp.processHello(pSess.buildHello(erinManifest, ['demo.echo']));The P-256-specific factory methods that existed before v0.2 were removed in
favour of the suite option. Every other method works the same with a P-256 agent. Signature formats
are defined in
RFC-AITP-0001 §5.4.3
for the JCS profile and in
§5.4.5
for compact JWS.
Since 0.14, buildManifest emits a pinned_key identity hint for a P-256
key too. Its public_key is the 33-byte SEC1 compressed point (44 base64url
characters), the same bytes as the AID's identifier. Earlier versions threw
here.
SPKI cert pinning (HPKP-style, feature spki-pinning)
import { computeSpkiHash, SpkiPinVerifier } from '@agentidentitytrustprotocol/aitp';
const pin = computeSpkiHash(certDerBuffer); // 32-byte Buffer
const verifier = new SpkiPinVerifier([pin]);
console.log(verifier.isPinned(certDerBuffer), verifier.isPinned(otherCertDer)); // true falseWire verifier.isPinned() into your HTTP client's checkServerIdentity hook
(e.g. an undici.Agent connect option). The SDK does no HTTP itself.
Experimental (build from source)
The published @agentidentitytrustprotocol/aitp package does not include
these. They carry no stability promise. Build from source with every
experimental feature:
npm run build:experimentalIt builds the addon with --features experimental and writes
experimental.js and experimental.d.ts, which export the experimental
API next to the stable one; index.js and index.d.ts stay the default
build's. experimental.js is not in the published package; load it from
the build directory:
const { verifySessionBundle } = require('./bindings/aitp-node/experimental.js');TCT renewal (RFC-AITP-0013, feature experimental-renewal)
const req = alice.buildRenewalRequest(tctJws); // the held TCT compact JWS
const { tct: freshTct, grantVoucher: freshVoucher } = bob.processRenewalRequest(
req, Math.floor(Date.now() / 1000) + 86_400, 3600,
);- Return value:
processRenewalRequestreturns{ tct, grantVoucher }: the fresh TCT plus a grant voucher re-minted for it (grantVoucheris absent when issuance policy declined to mint one).issueTctForDelegateereturns the same shape. Before 0.15 both returned a bare compact-JWS string and dropped the voucher. - Status: RFC-AITP-0013 is Draft.
- Policy re-evaluation (since 0.15). The issuer must have called
buildManifest(); grants its Manifest no longer offers are dropped (none left throws). Pass the issuer's revoked TCTjtis as the optional fourth argumentrevokedJtisto refuse a revoked TCT. A replayed request (samepop_nonce) throws. See tct-renewal.md.
Multi-hop delegation (RFC-AITP-0011, feature experimental-multihop-delegation)
import { verifyDelegationMultihop } from '@agentidentitytrustprotocol/aitp';
// Every hop verifies under the key its issuer's Manifest designates
// (RFC-AITP-0011 §3 step 1), so pass each hop issuer's Manifest
// (`aliceManifest` from the delegation example above).
const verifiedMultihop = verifyDelegationMultihop(
delegationJws, bob.aid, [aliceManifest], 3, revoked,
);For a loopback issuer in local development, its last argument is the same
insecureLocalhostDangerous as verifyDelegation. It is off by default.
This is an opt-in verifier that accepts RFC-AITP-0011 chains up to
maxDelegationHops total hops, with a default of 3. Each hop is verified
under the key resolved from its issuer's verified Manifest
(RFC-AITP-0011 §3 step 1), so issuerManifests must hold the
{"manifest": …} envelope JSON of every hop issuer; a hop whose issuer has
none fails with KEY_RESOLUTION_FAILED. A single-hop token also
verifies, and 0 reverts to strict single-hop. See
multihop-delegation.md.
A2A Agent Card binding (RFC-AITP-0014, feature experimental-a2a-agent-card)
// not executed: the committed vector has expired; tests/test_a2a.mjs runs these calls at a pinned time
const { a2aCardManifestUrl, verifyA2aAgentCardBinding } = require('./bindings/aitp-node/experimental.js');
const pointer = a2aCardManifestUrl(cardJson); // { aid, manifestUrl }, unverified
// Fetch pointer.manifestUrl yourself, as any untrusted URL. Pass null if the
// fetch failed.
const bound = verifyA2aAgentCardBinding(cardJson, interfaceUrl, manifestBody);
bound.handshakeEndpoint; // the Manifest's values, not the Card'sThe SDK does no I/O. interfaceUrl is the url of the AgentInterface you
intend to call, matched byte for byte. A binding failure throws with the
registered code on error.code. Steps 6 and 7 stay with you. See
a2a-agent-card.md.
Session Trust Bundle (RFC-AITP-0010, feature experimental-session-bundle)
import { SessionBundleBuilder, verifySessionBundle } from '@agentidentitytrustprotocol/aitp';
const bundle = new SessionBundleBuilder(bob) // bob coordinates
.sessionId(randomUUID()) // optional; defaults to a fresh UUID
.issuedAt(Math.floor(Date.now() / 1000)) // optional; defaults to now
.participant(alice.aid, tctJws) // TCTs bob issued to each member
.participant(carol.aid, carolTct)
.build();
// The coordinator's current Manifest is required: it designates the key
// the bundle verifies under (RFC-AITP-0010 §5 step 5), and its expires_at
// must outlive every participant TCT (RFC-AITP-0005 §10.4).
const bobManifest = bob.buildManifest({
displayName: 'bob',
handshakeEndpoint: 'https://bob.example/aitp/handshake/',
offeredCaps: ['demo.echo'],
ttlSecs: 24 * 3600,
});
const outcome = verifySessionBundle(bundle, alice.aid, bobManifest);
console.log(outcome.kind); // clear (fields: kind, activeAids, droppedAids)
const checked = verifySessionBundle(bundle, alice.aid, bobManifest, null, (jti) => revoked.includes(jti));verifySessionBundle(bundleEnvelopeJson, verifierAid, coordinatorManifestJson, nowUnixSecs?, revocationCheck?, insecureLocalhostDangerous?)
returns { kind: 'clear' | 'degraded', activeAids, droppedAids }.
coordinatorManifestJson is required: the coordinator's {"manifest": …}
envelope is verified, must designate the bundle's coordinator, and supplies
the coordinator key (RFC-AITP-0010 §5 step 5). There is no AID-only fallback;
a Manifest for another AID throws.
revocationCheck is called with each participant TCT's jti and returns
true if that TCT is revoked. See session-bundle.md.
Tests + interop
npm install
npm run build:debug
npm test # node --test over bindings/aitp-node/tests
cd ../interop && pytest -v # cross-language interop (see bindings/interop/README.md)See bindings/interop/README.md for what the
interop suite covers.