@openagentid/sdk/verification
API contract shipped by @openagentid/sdk 0.7.2. Exact exports, signatures, dependencies and availability.
All packages · Runnable examples · Start an agent
| Contract | Value |
|---|---|
| Package | @openagentid/sdk@0.7.2 |
| Entry point | @openagentid/sdk/verification |
| Availability | Current integration path |
| Reference source | Published TypeScript declarations |
| Package engines | node >=20 |
Before integrating
The published VERSION constant is still the literal "0.6.0" in the 0.7.2 archive. Use package metadata or your lockfile to identify the installed release; do not use VERSION as a release check.
When using @openagentid/crypto-wasm 0.1.1 for ACT verification, call the SDK verifier builder .atTime(Math.floor(Date.now() / 1000)) on every verification. The default WASM system-clock path traps in Node. Supply trusted receiver current epoch seconds; never token-supplied time or a timestamp captured once at startup. The complete ACT example covers this requirement.
In SDK 0.7.2, withAct and requireActExpress do not expose a verification-clock option. The raw crypto-wasm 0.1.1 binding alone therefore traps for these wrappers; use the tested fluent .atTime(...) example, or qualify a binding adapter that supplies fresh trusted receiver time on every verification.
This reference is generated from the integrity-verified npm archive for this exact version. Signatures describe the public contract; they are not standalone programs. Complete examples are checked separately.
Import conditions
Use the public entry point above. The package resolves it to these shipped files; do not import its internal files directly.
| Condition | Published file |
|---|---|
| types | ./dist/verification.d.ts |
| import | ./dist/verification.js |
| require | ./dist/verification.cjs |
Exports
assertAncestorassertScopesAuthContext— typeextractBearerTokenLineageAuthorityContext— typePrivilegedAuthorityVerificationClientPrivilegedAuthorityVerifier— typetoVerificationClientVerificationClient— typeVerifyRequestOptions— type
assertAncestor
Assert that ctx.lineage contains ancestor.
declare function assertAncestor(ctx: AuthContext, ancestor: Did): void;Source: @openagentid/sdk@0.7.2, dist/verification.d.ts:110.
assertScopes
Assert that ctx holds every scope in required.
declare function assertScopes(ctx: AuthContext, required: readonly string[]): void;Source: @openagentid/sdk@0.7.2, dist/verification.d.ts:108.
AuthContext
A resolved, authenticated caller identity.
Type-only declaration; it is not a runtime value.
interface AuthContext {
readonly did: Did;
readonly root: Did;
readonly lineage: readonly Did[];
readonly lineageAuthority?: LineageAuthorityContext;
readonly scopes: readonly string[];
readonly expiresAt: number;
readonly presentedToken?: string;
readonly claims?: Readonly<Record<string, unknown>>;
}Source: @openagentid/sdk@0.7.2, dist/verification.d.ts:44.
extractBearerToken
Extract the bearer token from a Request without trusting it.
Checks, in order: Authorization: OpenAgent ...,
Authorization: Bearer ..., X-OpenAgent-Token, and an oa_token
query parameter. Returns null if absent.
declare function extractBearerToken(req: Request): string | null;Source: @openagentid/sdk@0.7.2, dist/verification.d.ts:106.
LineageAuthorityContext
Sigil-backed lineage authority attached by an OAS verifier.
Type-only declaration; it is not a runtime value.
interface LineageAuthorityContext {
readonly subject: Did;
readonly source: string;
readonly root: Did;
readonly path: readonly Did[];
readonly finalizedBlock: number;
readonly pathKind: string;
readonly scopes: readonly string[];
readonly generation: number;
readonly rootKind?: string;
readonly orgRootCommitment?: string;
readonly expiresAt?: string;
}Source: @openagentid/sdk@0.7.2, dist/verification.d.ts:19.
PrivilegedAuthorityVerificationClient
Wraps any verifier and requires OAS/Sigil authority for privileged requests.
declare class PrivilegedAuthorityVerificationClient implements VerificationClient {
constructor(inner: VerificationClient, authorityVerifier: PrivilegedAuthorityVerifier);
verifyRequest(req: Request, options?: VerifyRequestOptions): Promise<AuthContext>;
issueChallenge(): Promise<{
challenge: Uint8Array;
challengeId: string;
}>;
verifyChallengeResponse(params: {
challengeId: string;
agentDid: Did;
signatureBase64: string;
}): Promise<AuthContext>;
}Source: @openagentid/sdk@0.7.2, dist/verification.d.ts:117.
PrivilegedAuthorityVerifier
Runtime hook that turns an authenticated context into OAS/Sigil authority.
Type-only declaration; it is not a runtime value.
interface PrivilegedAuthorityVerifier {
verify(ctx: AuthContext, options: VerifyRequestOptions): Promise<LineageAuthorityContext>;
}Source: @openagentid/sdk@0.7.2, dist/verification.d.ts:96.
toVerificationClient
Narrow any unknown value into a {@link VerificationClient}, or throw.
Duck-typed for forward compatibility with @openagentid/aegis-sdk.
declare function toVerificationClient(client: unknown): VerificationClient;Source: @openagentid/sdk@0.7.2, dist/verification.d.ts:115.
VerificationClient
AEGIS verifier facade. Concrete implementation lives in @openagentid/aegis-sdk.
The OpenAgent SDK never decodes assertions itself — it delegates to AEGIS for all verification, lineage walking, and policy evaluation.
Type-only declaration; it is not a runtime value.
interface VerificationClient {
verifyRequest(req: Request, options?: VerifyRequestOptions): Promise<AuthContext>;
issueChallenge(): Promise<{
challenge: Uint8Array;
challengeId: string;
}>;
verifyChallengeResponse(params: {
challengeId: string;
agentDid: Did;
signatureBase64: string;
}): Promise<AuthContext>;
}Source: @openagentid/sdk@0.7.2, dist/verification.d.ts:81.
VerifyRequestOptions
Options for {@link VerificationClient.verifyRequest}.
Type-only declaration; it is not a runtime value.
interface VerifyRequestOptions {
requiredScopes?: readonly string[];
requiredAncestor?: Did;
requirePrivilegedAuthority?: boolean;
requiredAuthorityPath?: string;
clockSkewSeconds?: number;
}Source: @openagentid/sdk@0.7.2, dist/verification.d.ts:63.
Supporting declarations
These package-owned declarations are referenced by the exports above. Their presence here does not make them importable from this entry point. Import only the names in Exports.
Did
Fully qualified did:oas identifier.
Type-only declaration; it is not a runtime value.
type Did = string;Source: @openagentid/sdk@0.7.2, dist/identity.d.ts:7.
Package requirements
Dependencies
| Package | Published range |
|---|---|
| zod | ^3.23.8 |
| jose | ^5.10.0 |
| @noble/hashes | ^1.8.0 |
| @scure/base | ^1.2.6 |
Peer dependencies
| Package | Published range | Optional |
|---|---|---|
| @openagentid/aegis-sdk | ^0.1.0 | Yes |
| @openagentid/arsenal-sdk | ^0.1.0 | Yes |
| @openagentid/crypto-wasm | ^0.1.0 | Yes |
| @openagentid/oas-sdk | ^1.0.2 | Yes |
Archive verification
Pinned integrity:
sha512-9YlDb02di8sGffhuMOwNAQa/M3oBrhaqPc7t+qBltdoQRCqlxDmYB/nTRSB4eZgwE4lvM4TKzI72nJtJSVm/ww==