Agent client
envelopeFor, evaluate, consume, submitReceipt. The four calls that drive the runtime loop.
Every 2AYE SDK drives the same runtime loop against the same frozen envelope, so the language you choose changes the syntax and nothing about the security model.
npm install @verid/agent-sdkimport {
VeridAgentClient,
VeridGrantVerifier,
executeWithAuthorization
} from "@verid/agent-sdk";
const client = new VeridAgentClient({
baseUrl: process.env.VERID_BASE_URL,
tenantId: process.env.VERID_TENANT_ID,
accessToken: process.env.VERID_ACCESS_TOKEN
});
const proposal = {
intentId: signedIntentId,
agentId: "procurement-agent",
tool: "datadog-billing",
action: "renew",
amount: "13800.00", // string: textual scale is bound
currency: "USD",
counterparty: "datadog"
};
const envelope = client.envelopeFor(proposal);
const decision = await client.evaluate(proposal);
if (decision.decision !== "ALLOW") {
throw new Error(`2AYE refused: ${decision.decision}`);
}The SDKs share method names on purpose. A team reading a Go integration can follow a Python one without translating the security model.
envelopeForBuild the closed predicate envelope for the exact action being proposed.
evaluateEvaluate through the single canonical runtime endpoint. Anything but ALLOW stops here.
verifyThe protected tool independently verifies the ES256 signature and the exact envelope.
consumeRedeem the short-lived grant once, at the resource, immediately before the action runs.
submitReceiptSubmit what actually executed so the approved and executed action can be compared.
Each SDK below is implemented and tested in this repository. Package identifiers are the target coordinates; use the repository path until a release is published.
| Language | Package identifier | Repository path | Tests / checks |
|---|---|---|---|
| JavaScriptNode 20+ and browsers | @verid/agent-sdk | verid-sdk/javascript | 26 |
| Python3.11+ | verid-sdk | verid-sdk/python | 8 |
| .NETnet10.0 | Verid.Sdk | verid-sdk/dotnet | 12 |
| Gostandard library only | github.com/verid-ai/verid-sdk-go | verid-sdk/go | 4 |
| JavaJDK 21+ | com.verid.sdk | verid-sdk/java | 7 |
| FlutterDart 3 | verid_sdk | verid-sdk/flutter | 4 |
Counts are the checks present in each SDK’s own suite. They do not include the independently maintained platform test suite.
envelopeFor, evaluate, consume, submitReceipt. The four calls that drive the runtime loop.
Independent ES256 and exact-envelope verification, run at the protected resource rather than trusted from the caller.
Closed predicate types, so an unrecognised predicate is a refusal instead of a silently ignored field.
The refusals are tested, not only the happy path: parameter substitution, tampering, and replay each have a case.
A good SDK is usually described as lightweight, documented, customizable, secure, and easy to use. Those are easy words to write, so each one below names the thing that makes it true.
The REST API is public and the envelope format is published, so nothing here is locked behind an SDK. The difference is how much of the security model you re-implement yourself.
| 2AYE SDK | Raw REST API | |
|---|---|---|
| Time to a first governed action | Minutes | You implement envelope canonicalisation first |
| Envelope canonicalisation | Handled by the client | Must match the frozen format byte for byte |
| ES256 grant verification | Included in the verifier | You implement signature and exact-action checks |
| Single-use redemption | Enforced by the client | Yours to remember at the protected resource |
| Third-party dependencies | None | None |
| Best for | Most integrations | A language 2AYE does not ship yet |
Textual scale is part of the authorization binding, so 13800.00 and 13800 are not interchangeable.
The protected tool must still verify the signature and redeem the grant. The SDKs will not skip that.
A redeemed grant cannot be replayed, and redemption happens where the action executes.
Verification defaults to rejecting throwaway issuer keys rather than trusting them.