@valiron/sdk 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -1
- package/dist/clients.d.ts +2 -1
- package/dist/clients.js +37 -14
- package/dist/index.d.ts +6 -3
- package/dist/index.js +7 -2
- package/dist/telemetry.js +30 -10
- package/dist/types.d.ts +29 -18
- package/docs/API-REFERENCE.md +117 -37
- package/docs/DASHBOARD.md +13 -2
- package/docs/E2E-MIDDLEWARE-INTEGRATION.md +1 -1
- package/docs/ERRORS.md +12 -1
- package/docs/IDENTITY.md +18 -8
- package/docs/MCP.md +50 -0
- package/docs/PROVIDER-IDENTITY.md +5 -20
- package/docs/QUICKSTART.md +8 -5
- package/docs/README.md +6 -0
- package/docs/SANDBOX.md +5 -7
- package/docs/SDK-REFERENCE.md +24 -7
- package/docs/TRUST-MODEL.md +3 -12
- package/docs/llms.txt +25 -10
- package/package.json +21 -5
package/README.md
CHANGED
|
@@ -45,10 +45,24 @@ app.use("/api/paid", createValironGate({
|
|
|
45
45
|
// See SDK Reference for valironFastifyPlugin, createValironNextMiddleware, valironGateCheck
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
-
No API key is required for basic read operations. Pro trust signals and `getWalletRisk()` require
|
|
48
|
+
No API key is required for basic read operations. Sandbox runs require an operator API key. Pro trust signals, enriched profiles, proxy calls, webhooks, and `getWalletRisk()` require a Pro operator key.
|
|
49
49
|
|
|
50
50
|
Use `x-agent-id` for ERC-8004/Solana agents. Use `x-agent-address` plus Valiron challenge-response for local, Web2, or non-ERC-8004 agents. Agents can follow the hosted identity skill at https://www.valiron.co/auth.md.
|
|
51
51
|
|
|
52
|
+
For a verified key-based agent, a Pro operator can read private Icebreaker
|
|
53
|
+
human-owner context with `getKeyAgentIcebreaker()`:
|
|
54
|
+
|
|
55
|
+
```typescript
|
|
56
|
+
const { icebreaker } = await valiron.getKeyAgentIcebreaker("0xAgentAddress");
|
|
57
|
+
if (icebreaker.attested) {
|
|
58
|
+
console.log(icebreaker.owner, icebreaker.verifiedHandles);
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
The public key-agent profile redacts this context. The API seller decides
|
|
63
|
+
whether to require the attestation for an action; it does not automatically
|
|
64
|
+
change the Web2 behavioral score or provide social connections or mutuals.
|
|
65
|
+
|
|
52
66
|
Provider-backed identities such as ANS use signed `x-valiron-identity-*`
|
|
53
67
|
headers. SDK 1.3 provides `createAgentIdentityProof()` for agents,
|
|
54
68
|
`verifyAgentIdentity()` for low-level verification, and dedicated Express,
|
package/dist/clients.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ValironConfig, AgentProfile, AgentSnapshotSummary, WalletProfile, WalletResolution, WalletRiskSnapshot, SandboxResult, KeyAgentSandboxResult, GateResult, GateOptions, CallOptions, KeyAgentChallenge, KeyAgentProfile, WorldIdStatus, WorldIdAgentProfile, SelfAgentProfile, SelfProofPayload, SelfSessionRequest, SelfSessionResponse, SelfStatus, AgentIdentityProof, AgentIdentityPolicy, AgentIdentityVerificationResult, ProxyRequest, ProxyResponse } from "./types";
|
|
1
|
+
import { ValironConfig, AgentProfile, AgentSnapshotSummary, WalletProfile, WalletResolution, WalletRiskSnapshot, SandboxResult, KeyAgentSandboxResult, GateResult, GateOptions, CallOptions, KeyAgentChallenge, KeyAgentProfile, KeyAgentIcebreakerProfile, WorldIdStatus, WorldIdAgentProfile, SelfAgentProfile, SelfProofPayload, SelfSessionRequest, SelfSessionResponse, SelfStatus, AgentIdentityProof, AgentIdentityPolicy, AgentIdentityVerificationResult, ProxyRequest, ProxyResponse } from "./types";
|
|
2
2
|
/**
|
|
3
3
|
* HTTP client for the Valiron Operator API.
|
|
4
4
|
*
|
|
@@ -120,6 +120,7 @@ export declare class ValironClient {
|
|
|
120
120
|
* `GET /operator/key/:agentAddress`
|
|
121
121
|
*/
|
|
122
122
|
getKeyAgentProfile(agentAddress: string): Promise<KeyAgentProfile>;
|
|
123
|
+
getKeyAgentIcebreaker(agentAddress: string): Promise<KeyAgentIcebreakerProfile>;
|
|
123
124
|
/**
|
|
124
125
|
* Verify a World ID proof linking a human to an agent.
|
|
125
126
|
*
|
package/dist/clients.js
CHANGED
|
@@ -200,6 +200,9 @@ class ValironClient {
|
|
|
200
200
|
async getKeyAgentProfile(agentAddress) {
|
|
201
201
|
return this.get(`/operator/key/${agentAddress}`);
|
|
202
202
|
}
|
|
203
|
+
async getKeyAgentIcebreaker(agentAddress) {
|
|
204
|
+
return this.get(`/operator/key/${agentAddress}/icebreaker`);
|
|
205
|
+
}
|
|
203
206
|
// ─── World ID (Proof-of-Personhood) ───────────────────────────────────
|
|
204
207
|
/**
|
|
205
208
|
* Verify a World ID proof linking a human to an agent.
|
|
@@ -311,27 +314,29 @@ class ValironClient {
|
|
|
311
314
|
const controller = new AbortController();
|
|
312
315
|
const timeoutMs = this.getTimeoutForPath(path);
|
|
313
316
|
const timeoutId = setTimeout(() => controller.abort(), timeoutMs);
|
|
314
|
-
const start =
|
|
317
|
+
const start = performance.now();
|
|
318
|
+
let responseStatus;
|
|
315
319
|
try {
|
|
316
320
|
const response = await fetch(url.toString(), {
|
|
317
321
|
method: "GET",
|
|
318
322
|
headers: this.buildHeaders(),
|
|
319
323
|
signal: controller.signal,
|
|
320
324
|
});
|
|
321
|
-
|
|
322
|
-
const durationMs = Date.now() - start;
|
|
325
|
+
responseStatus = response.status;
|
|
323
326
|
const methodName = this.extractMethodName(path);
|
|
324
327
|
if (!response.ok) {
|
|
325
328
|
const body = await response
|
|
326
329
|
.json()
|
|
327
330
|
.catch(() => ({ message: response.statusText }));
|
|
331
|
+
clearTimeout(timeoutId);
|
|
332
|
+
const durationMs = Math.round(performance.now() - start);
|
|
328
333
|
this.telemetry.emit("sdk_call", {
|
|
329
334
|
method: methodName,
|
|
330
335
|
chain: chain || "server_default",
|
|
331
336
|
duration_ms: durationMs,
|
|
332
337
|
success: false,
|
|
333
338
|
http_status: response.status,
|
|
334
|
-
error_code: "API_ERROR",
|
|
339
|
+
error_code: typeof body.code === "string" ? body.code : "API_ERROR",
|
|
335
340
|
retries: 0,
|
|
336
341
|
timeout_count: 0,
|
|
337
342
|
abort_count: 0,
|
|
@@ -340,6 +345,8 @@ class ValironClient {
|
|
|
340
345
|
throw this.createApiError(response, body, path, "GET");
|
|
341
346
|
}
|
|
342
347
|
const data = await response.json();
|
|
348
|
+
clearTimeout(timeoutId);
|
|
349
|
+
const durationMs = Math.round(performance.now() - start);
|
|
343
350
|
this.telemetry.emit("sdk_call", {
|
|
344
351
|
method: methodName,
|
|
345
352
|
chain: chain || "server_default",
|
|
@@ -357,7 +364,7 @@ class ValironClient {
|
|
|
357
364
|
}
|
|
358
365
|
catch (error) {
|
|
359
366
|
clearTimeout(timeoutId);
|
|
360
|
-
const durationMs =
|
|
367
|
+
const durationMs = Math.round(performance.now() - start);
|
|
361
368
|
const methodName = this.extractMethodName(path);
|
|
362
369
|
if (error.name === "AbortError") {
|
|
363
370
|
this.telemetry.emit("sdk_call", {
|
|
@@ -376,18 +383,22 @@ class ValironClient {
|
|
|
376
383
|
}
|
|
377
384
|
if (error instanceof types_1.ValironError)
|
|
378
385
|
throw error;
|
|
386
|
+
const errorCode = responseStatus === undefined ? "NETWORK_ERROR" : "RESPONSE_ERROR";
|
|
379
387
|
this.telemetry.emit("sdk_call", {
|
|
380
388
|
method: methodName,
|
|
381
389
|
chain: chain || "server_default",
|
|
382
390
|
duration_ms: durationMs,
|
|
383
391
|
success: false,
|
|
384
|
-
|
|
392
|
+
http_status: responseStatus,
|
|
393
|
+
error_code: errorCode,
|
|
385
394
|
retries: 0,
|
|
386
395
|
timeout_count: 0,
|
|
387
396
|
abort_count: 0,
|
|
388
397
|
});
|
|
389
398
|
this.telemetry.recordLatency(methodName, chain || "server_default", durationMs);
|
|
390
|
-
throw new types_1.ValironError(
|
|
399
|
+
throw new types_1.ValironError(responseStatus === undefined
|
|
400
|
+
? `Could not reach Valiron: ${error.message || "network error"}`
|
|
401
|
+
: `Could not read Valiron's response: ${error.message || "response error"}`, errorCode, responseStatus, { method: "GET", path, action: "Check your endpoint URL, network egress, and DNS configuration before retrying." });
|
|
391
402
|
}
|
|
392
403
|
}
|
|
393
404
|
async post(path, body, chain) {
|
|
@@ -400,7 +411,8 @@ class ValironClient {
|
|
|
400
411
|
const controller = new AbortController();
|
|
401
412
|
const timeoutMs = this.getTimeoutForPath(path);
|
|
402
413
|
const timeoutId = setTimeout(() => controller.abort(), timeoutMs);
|
|
403
|
-
const start =
|
|
414
|
+
const start = performance.now();
|
|
415
|
+
let responseStatus;
|
|
404
416
|
try {
|
|
405
417
|
const headers = this.buildHeaders();
|
|
406
418
|
const hasBody = body !== undefined && body !== null;
|
|
@@ -412,20 +424,21 @@ class ValironClient {
|
|
|
412
424
|
body: hasBody ? JSON.stringify(body) : undefined,
|
|
413
425
|
signal: controller.signal,
|
|
414
426
|
});
|
|
415
|
-
|
|
416
|
-
const durationMs = Date.now() - start;
|
|
427
|
+
responseStatus = response.status;
|
|
417
428
|
const methodName = this.extractMethodName(path);
|
|
418
429
|
if (!response.ok) {
|
|
419
430
|
const respBody = await response
|
|
420
431
|
.json()
|
|
421
432
|
.catch(() => ({ message: response.statusText }));
|
|
433
|
+
clearTimeout(timeoutId);
|
|
434
|
+
const durationMs = Math.round(performance.now() - start);
|
|
422
435
|
this.telemetry.emit("sdk_call", {
|
|
423
436
|
method: methodName,
|
|
424
437
|
chain: chain || "server_default",
|
|
425
438
|
duration_ms: durationMs,
|
|
426
439
|
success: false,
|
|
427
440
|
http_status: response.status,
|
|
428
|
-
error_code: "API_ERROR",
|
|
441
|
+
error_code: typeof respBody.code === "string" ? respBody.code : "API_ERROR",
|
|
429
442
|
retries: 0,
|
|
430
443
|
timeout_count: 0,
|
|
431
444
|
abort_count: 0,
|
|
@@ -434,6 +447,8 @@ class ValironClient {
|
|
|
434
447
|
throw this.createApiError(response, respBody, path, "POST");
|
|
435
448
|
}
|
|
436
449
|
const data = await response.json();
|
|
450
|
+
clearTimeout(timeoutId);
|
|
451
|
+
const durationMs = Math.round(performance.now() - start);
|
|
437
452
|
this.telemetry.emit("sdk_call", {
|
|
438
453
|
method: methodName,
|
|
439
454
|
chain: chain || "server_default",
|
|
@@ -451,7 +466,7 @@ class ValironClient {
|
|
|
451
466
|
}
|
|
452
467
|
catch (error) {
|
|
453
468
|
clearTimeout(timeoutId);
|
|
454
|
-
const durationMs =
|
|
469
|
+
const durationMs = Math.round(performance.now() - start);
|
|
455
470
|
const methodName = this.extractMethodName(path);
|
|
456
471
|
if (error.name === "AbortError") {
|
|
457
472
|
this.telemetry.emit("sdk_call", {
|
|
@@ -470,23 +485,31 @@ class ValironClient {
|
|
|
470
485
|
}
|
|
471
486
|
if (error instanceof types_1.ValironError)
|
|
472
487
|
throw error;
|
|
488
|
+
const errorCode = responseStatus === undefined ? "NETWORK_ERROR" : "RESPONSE_ERROR";
|
|
473
489
|
this.telemetry.emit("sdk_call", {
|
|
474
490
|
method: methodName,
|
|
475
491
|
chain: chain || "server_default",
|
|
476
492
|
duration_ms: durationMs,
|
|
477
493
|
success: false,
|
|
478
|
-
|
|
494
|
+
http_status: responseStatus,
|
|
495
|
+
error_code: errorCode,
|
|
479
496
|
retries: 0,
|
|
480
497
|
timeout_count: 0,
|
|
481
498
|
abort_count: 0,
|
|
482
499
|
});
|
|
483
500
|
this.telemetry.recordLatency(methodName, chain || "server_default", durationMs);
|
|
484
|
-
throw new types_1.ValironError(
|
|
501
|
+
throw new types_1.ValironError(responseStatus === undefined
|
|
502
|
+
? `Could not reach Valiron: ${error.message || "network error"}`
|
|
503
|
+
: `Could not read Valiron's response: ${error.message || "response error"}`, errorCode, responseStatus, { method: "POST", path, action: "Check your endpoint URL, network egress, and DNS configuration before retrying." });
|
|
485
504
|
}
|
|
486
505
|
}
|
|
487
506
|
extractMethodName(path) {
|
|
507
|
+
if (/^\/operator\/agent\/[^/]+\/snapshot(?:\?|$)/.test(path))
|
|
508
|
+
return "getAgentSnapshot";
|
|
488
509
|
if (path.startsWith("/operator/agent/"))
|
|
489
510
|
return "getAgentProfile";
|
|
511
|
+
if (path === "/operator/identity/verify")
|
|
512
|
+
return "verifyAgentIdentity";
|
|
490
513
|
if (path.startsWith("/operator/resolve-wallet/"))
|
|
491
514
|
return "resolveWallet";
|
|
492
515
|
if (path.startsWith("/operator/wallet-risk/"))
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ValironConfig, CallOptions, AgentProfile, AgentSnapshotSummary, WalletProfile, WalletResolution, WalletRiskSnapshot, SandboxResult, KeyAgentSandboxResult, GateResult, GateOptions, RouteDecision, KeyAgentProfile, KeyAgentChallenge, WorldIdStatus, WorldIdAgentProfile, SelfAgentProfile, SelfProofPayload, SelfSessionRequest, SelfSessionResponse, SelfStatus, AgentIdentityProof, AgentIdentityPolicy, AgentIdentityVerificationResult, ProxyRequest, ProxyResponse } from "./types";
|
|
1
|
+
import { ValironConfig, CallOptions, AgentProfile, AgentSnapshotSummary, WalletProfile, WalletResolution, WalletRiskSnapshot, SandboxResult, KeyAgentSandboxResult, GateResult, GateOptions, RouteDecision, KeyAgentProfile, KeyAgentIcebreakerProfile, KeyAgentChallenge, WorldIdStatus, WorldIdAgentProfile, SelfAgentProfile, SelfProofPayload, SelfSessionRequest, SelfSessionResponse, SelfStatus, AgentIdentityProof, AgentIdentityPolicy, AgentIdentityVerificationResult, ProxyRequest, ProxyResponse } from "./types";
|
|
2
2
|
/**
|
|
3
3
|
* Valiron SDK – Official TypeScript SDK for the Trust Layer for Agentic Economy
|
|
4
4
|
*
|
|
@@ -271,7 +271,7 @@ export declare class ValironSDK {
|
|
|
271
271
|
* trust profile.
|
|
272
272
|
*
|
|
273
273
|
* @param params - Challenge response with EIP-191 signature and address
|
|
274
|
-
* @returns
|
|
274
|
+
* @returns Public agent profile (behavioral score if available; Icebreaker context redacted)
|
|
275
275
|
*/
|
|
276
276
|
verifyKeyAgent(params: {
|
|
277
277
|
challenge: string;
|
|
@@ -281,13 +281,16 @@ export declare class ValironSDK {
|
|
|
281
281
|
/**
|
|
282
282
|
* Get trust profile for a key-based agent by its Ethereum address.
|
|
283
283
|
*
|
|
284
|
-
* Returns behavioral score
|
|
284
|
+
* Returns behavioral score. Icebreaker ownership is redacted from this public profile.
|
|
285
|
+
* Use getKeyAgentIcebreaker() with a Pro operator key for the owner context.
|
|
285
286
|
* The agent must have been verified via challenge-response at least once.
|
|
286
287
|
*
|
|
287
288
|
* @param agentAddress - Ethereum address (keccak256-derived from secp256k1 public key)
|
|
288
289
|
* @returns Agent trust profile
|
|
289
290
|
*/
|
|
290
291
|
getKeyAgentProfile(agentAddress: string): Promise<KeyAgentProfile>;
|
|
292
|
+
/** Get private Icebreaker owner context for a verified Web2 agent. Requires a Pro operator key. */
|
|
293
|
+
getKeyAgentIcebreaker(agentAddress: string): Promise<KeyAgentIcebreakerProfile>;
|
|
291
294
|
/**
|
|
292
295
|
* Verify a World ID proof linking a human to an agent.
|
|
293
296
|
*
|
package/dist/index.js
CHANGED
|
@@ -314,7 +314,7 @@ class ValironSDK {
|
|
|
314
314
|
* trust profile.
|
|
315
315
|
*
|
|
316
316
|
* @param params - Challenge response with EIP-191 signature and address
|
|
317
|
-
* @returns
|
|
317
|
+
* @returns Public agent profile (behavioral score if available; Icebreaker context redacted)
|
|
318
318
|
*/
|
|
319
319
|
async verifyKeyAgent(params) {
|
|
320
320
|
return this.client.verifyKeyAgent(params);
|
|
@@ -322,7 +322,8 @@ class ValironSDK {
|
|
|
322
322
|
/**
|
|
323
323
|
* Get trust profile for a key-based agent by its Ethereum address.
|
|
324
324
|
*
|
|
325
|
-
* Returns behavioral score
|
|
325
|
+
* Returns behavioral score. Icebreaker ownership is redacted from this public profile.
|
|
326
|
+
* Use getKeyAgentIcebreaker() with a Pro operator key for the owner context.
|
|
326
327
|
* The agent must have been verified via challenge-response at least once.
|
|
327
328
|
*
|
|
328
329
|
* @param agentAddress - Ethereum address (keccak256-derived from secp256k1 public key)
|
|
@@ -331,6 +332,10 @@ class ValironSDK {
|
|
|
331
332
|
async getKeyAgentProfile(agentAddress) {
|
|
332
333
|
return this.client.getKeyAgentProfile(agentAddress);
|
|
333
334
|
}
|
|
335
|
+
/** Get private Icebreaker owner context for a verified Web2 agent. Requires a Pro operator key. */
|
|
336
|
+
async getKeyAgentIcebreaker(agentAddress) {
|
|
337
|
+
return this.client.getKeyAgentIcebreaker(agentAddress);
|
|
338
|
+
}
|
|
334
339
|
// ─── World ID (Proof-of-Personhood) ─────────────────────────────────
|
|
335
340
|
/**
|
|
336
341
|
* Verify a World ID proof linking a human to an agent.
|
package/dist/telemetry.js
CHANGED
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TelemetryClient = void 0;
|
|
4
|
-
|
|
4
|
+
// Read the shipped package version so releases cannot drift from telemetry.
|
|
5
|
+
const SDK_VERSION = require("../package.json").version;
|
|
6
|
+
function detectEnvironment() {
|
|
7
|
+
const nodeEnv = globalThis.process?.env?.NODE_ENV;
|
|
8
|
+
if (nodeEnv === "production")
|
|
9
|
+
return "prod";
|
|
10
|
+
if (nodeEnv === "development")
|
|
11
|
+
return "dev";
|
|
12
|
+
if (nodeEnv === "test")
|
|
13
|
+
return "test";
|
|
14
|
+
return "unknown";
|
|
15
|
+
}
|
|
5
16
|
function detectRuntime() {
|
|
6
17
|
return typeof globalThis.window === "undefined" ? "node" : "browser";
|
|
7
18
|
}
|
|
@@ -26,7 +37,7 @@ class TelemetryClient {
|
|
|
26
37
|
this.endpoint = config?.endpoint || `${apiEndpoint.replace(/\/$/, "")}/telemetry/sdk`;
|
|
27
38
|
this.appId = config?.appId;
|
|
28
39
|
this.workspaceId = config?.workspaceId;
|
|
29
|
-
this.env = config?.env
|
|
40
|
+
this.env = config?.env ?? detectEnvironment();
|
|
30
41
|
this.runtime = detectRuntime();
|
|
31
42
|
this.sampleRate = Math.max(0, Math.min(1, config?.sampleRate ?? 1));
|
|
32
43
|
this.batchSize = Math.max(1, config?.batchSize ?? 25);
|
|
@@ -62,9 +73,10 @@ class TelemetryClient {
|
|
|
62
73
|
emit(event, payload) {
|
|
63
74
|
if (!this.enabled)
|
|
64
75
|
return;
|
|
65
|
-
if (Math.random()
|
|
76
|
+
if (this.sampleRate <= 0 || Math.random() >= this.sampleRate)
|
|
66
77
|
return;
|
|
67
78
|
const enriched = {
|
|
79
|
+
...payload,
|
|
68
80
|
event,
|
|
69
81
|
ts: new Date().toISOString(),
|
|
70
82
|
sdk_version: SDK_VERSION,
|
|
@@ -72,9 +84,13 @@ class TelemetryClient {
|
|
|
72
84
|
env: this.env,
|
|
73
85
|
app_id: this.appId,
|
|
74
86
|
workspace_id: this.workspaceId,
|
|
75
|
-
|
|
87
|
+
sample_rate: this.sampleRate,
|
|
76
88
|
};
|
|
77
|
-
|
|
89
|
+
// A telemetry callback must never change the outcome of the observed API call.
|
|
90
|
+
try {
|
|
91
|
+
this.onEvent?.({ ...enriched });
|
|
92
|
+
}
|
|
93
|
+
catch { /* Best-effort telemetry. */ }
|
|
78
94
|
this.queue.push(enriched);
|
|
79
95
|
if (this.queue.length >= this.batchSize) {
|
|
80
96
|
void this.flush();
|
|
@@ -100,11 +116,15 @@ class TelemetryClient {
|
|
|
100
116
|
return;
|
|
101
117
|
const batch = this.queue.splice(0, this.queue.length);
|
|
102
118
|
try {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
119
|
+
// Keep every request within the ingestion limit, including final disposal
|
|
120
|
+
// and custom batch sizes.
|
|
121
|
+
for (let offset = 0; offset < batch.length; offset += 100) {
|
|
122
|
+
await fetch(this.endpoint, {
|
|
123
|
+
method: "POST",
|
|
124
|
+
headers: { "Content-Type": "application/json" },
|
|
125
|
+
body: JSON.stringify({ events: batch.slice(offset, offset + 100) }),
|
|
126
|
+
});
|
|
127
|
+
}
|
|
108
128
|
}
|
|
109
129
|
catch {
|
|
110
130
|
// Best-effort telemetry: drop on failures to avoid impacting SDK consumers.
|
package/dist/types.d.ts
CHANGED
|
@@ -133,7 +133,8 @@ export interface RoutingExplanation {
|
|
|
133
133
|
}
|
|
134
134
|
export interface ChainContext {
|
|
135
135
|
network: SupportedChain;
|
|
136
|
-
|
|
136
|
+
/** @deprecated Hosted API no longer returns infrastructure RPC URLs. */
|
|
137
|
+
rpcUrl?: string;
|
|
137
138
|
identityRegistry: string;
|
|
138
139
|
reputationRegistry: string;
|
|
139
140
|
/** Solana cluster identifier (only present for Solana). */
|
|
@@ -255,12 +256,12 @@ export interface AgentSnapshotSummary {
|
|
|
255
256
|
snapshotHash: string;
|
|
256
257
|
/** Hash of the prior snapshot, or "0x0" for the first evaluation. */
|
|
257
258
|
previousHash: string;
|
|
258
|
-
/**
|
|
259
|
-
encryptedDataUri
|
|
259
|
+
/** @deprecated Private evidence locations are no longer returned by public snapshot reads. */
|
|
260
|
+
encryptedDataUri?: string | null;
|
|
260
261
|
/** ISO 8601 timestamp of when the evaluation was performed. */
|
|
261
262
|
timestamp: string | null;
|
|
262
|
-
/**
|
|
263
|
-
interactionCount
|
|
263
|
+
/** @deprecated Private activity counts are no longer returned by public snapshot reads. */
|
|
264
|
+
interactionCount?: number;
|
|
264
265
|
}
|
|
265
266
|
/** Options for `gate()` call. */
|
|
266
267
|
export interface GateOptions {
|
|
@@ -361,8 +362,6 @@ export interface WorldIdStatus {
|
|
|
361
362
|
verified: boolean;
|
|
362
363
|
/** Verification level (orb = biometric, device = passkey, phone = SMS) */
|
|
363
364
|
verificationLevel?: WorldIdVerificationLevel;
|
|
364
|
-
/** Nullifier hash — unique per (user, action, app) tuple */
|
|
365
|
-
nullifierHash?: string;
|
|
366
365
|
/** The agent ID this verification is linked to */
|
|
367
366
|
agentId?: string;
|
|
368
367
|
/** Network this verification is scoped to */
|
|
@@ -454,16 +453,10 @@ export interface SelfSessionResponse {
|
|
|
454
453
|
export interface SelfStatus {
|
|
455
454
|
/** Whether the agent has a verified Self human eligibility link */
|
|
456
455
|
verified: boolean;
|
|
457
|
-
/** Nullifier hash from Self, unique to the configured disclosure/action scope */
|
|
458
|
-
nullifierHash?: string;
|
|
459
|
-
/** Optional Self verification/session identifier */
|
|
460
|
-
verificationId?: string;
|
|
461
456
|
/** The agent ID this verification is linked to */
|
|
462
457
|
agentId?: string;
|
|
463
458
|
/** Network this verification is scoped to */
|
|
464
459
|
network?: string;
|
|
465
|
-
/** Selective disclosure predicates returned by Self */
|
|
466
|
-
credentialSubject?: Record<string, unknown>;
|
|
467
460
|
/** Minimum age proven by Self, when requested */
|
|
468
461
|
minimumAge?: number;
|
|
469
462
|
/** Whether Self returned an OFAC-clear predicate */
|
|
@@ -516,6 +509,24 @@ export interface IcebreakerOwnership {
|
|
|
516
509
|
/** Icebreaker profile URL for the agent's linked address */
|
|
517
510
|
profileUrl?: string;
|
|
518
511
|
}
|
|
512
|
+
/** Private Icebreaker enrichment for a verified key-based agent. Requires a Pro operator key or the agent's own authenticated session. */
|
|
513
|
+
export interface KeyAgentIcebreakerProfile {
|
|
514
|
+
agentAddress: string;
|
|
515
|
+
icebreaker: {
|
|
516
|
+
attested: false;
|
|
517
|
+
} | {
|
|
518
|
+
attested: true;
|
|
519
|
+
uid: string | null;
|
|
520
|
+
owner: string | null;
|
|
521
|
+
verifiedHandles: {
|
|
522
|
+
source: string;
|
|
523
|
+
handle: string;
|
|
524
|
+
}[];
|
|
525
|
+
organization: string | null;
|
|
526
|
+
profileUrl: string | null;
|
|
527
|
+
credentialUrl: string | null;
|
|
528
|
+
};
|
|
529
|
+
}
|
|
519
530
|
/**
|
|
520
531
|
* Trust profile for a key-based (non-ERC-8004) agent.
|
|
521
532
|
*
|
|
@@ -534,7 +545,7 @@ export interface KeyAgentProfile {
|
|
|
534
545
|
riskLevel: RiskLevel | null;
|
|
535
546
|
/** Route decision */
|
|
536
547
|
route: RouteDecision | null;
|
|
537
|
-
/**
|
|
548
|
+
/** Redacted in public HTTP profiles; use getKeyAgentIcebreaker with a Pro key. */
|
|
538
549
|
icebreaker: IcebreakerOwnership | null;
|
|
539
550
|
/** Human-readable trust explanation */
|
|
540
551
|
reasons: string[];
|
|
@@ -551,7 +562,7 @@ export interface CallOptions {
|
|
|
551
562
|
/** Customer-selected scoring signals for profile/routing calls. */
|
|
552
563
|
trustSignals?: TrustSignal[];
|
|
553
564
|
}
|
|
554
|
-
export type TelemetryEnvironment = "prod" | "staging" | "dev";
|
|
565
|
+
export type TelemetryEnvironment = "prod" | "staging" | "dev" | "test" | "unknown";
|
|
555
566
|
export interface TelemetryEventBase {
|
|
556
567
|
event: string;
|
|
557
568
|
ts: string;
|
|
@@ -567,6 +578,7 @@ export interface TelemetryConfig {
|
|
|
567
578
|
endpoint?: string;
|
|
568
579
|
appId?: string;
|
|
569
580
|
workspaceId?: string;
|
|
581
|
+
/** Defaults to NODE_ENV when recognized, otherwise unknown. */
|
|
570
582
|
env?: TelemetryEnvironment;
|
|
571
583
|
sampleRate?: number;
|
|
572
584
|
flushIntervalMs?: number;
|
|
@@ -577,9 +589,8 @@ export interface ValironConfig {
|
|
|
577
589
|
/**
|
|
578
590
|
* Your Valiron API key.
|
|
579
591
|
*
|
|
580
|
-
*
|
|
581
|
-
*
|
|
582
|
-
* for future compatibility when API key validation is implemented.
|
|
592
|
+
* Optional for public identity/trust summaries. Required for sandbox runs;
|
|
593
|
+
* paid signals, enriched profiles, proxy calls, and webhooks also require Pro.
|
|
583
594
|
*/
|
|
584
595
|
apiKey?: string;
|
|
585
596
|
/**
|
package/docs/API-REFERENCE.md
CHANGED
|
@@ -1,15 +1,59 @@
|
|
|
1
|
-
# API Reference
|
|
1
|
+
# Valiron API Reference
|
|
2
|
+
|
|
3
|
+
Machine-readable contract: [Valiron OpenAPI](https://www.valiron.co/openapi.json). [MCP setup](./MCP.md).
|
|
2
4
|
|
|
3
5
|
Base URL: `https://valiron-edge-proxy.onrender.com`
|
|
4
6
|
|
|
5
7
|
Endpoints are organized into three groups:
|
|
6
8
|
|
|
7
|
-
- **Trust evaluation** (`/operator/agent/*`, `/operator/gate/*`, etc.) —
|
|
9
|
+
- **Trust evaluation** (`/operator/agent/*`, `/operator/gate/*`, etc.) — Profile summaries are public. Runtime gate and identity-verification requests require an operator key; Pro trust signals and wallet intelligence require a Pro account with `Authorization: Bearer val_op_...`.
|
|
8
10
|
- **Dashboard** (`/operator/register`, `/operator/login`, `/operator/endpoints`, etc.) — JWT-authenticated. Used by the Operator Dashboard. See [DASHBOARD.md](./DASHBOARD.md) for the UI guide.
|
|
9
11
|
- **Agent-ready wrappers** (`/wrap/:operatorId/*`) — Public agent-facing URLs created from Dashboard endpoint configs. These can enforce x402/MPP payment, optional trust checks, rate limits, and upstream forwarding.
|
|
10
12
|
|
|
11
13
|
---
|
|
12
14
|
|
|
15
|
+
## Access and data boundaries
|
|
16
|
+
|
|
17
|
+
Public profile endpoints return identity and trust summaries. They do not return raw behavioral metrics, stored-evidence links, RPC URLs, internal errors, or verification-provider records. Self and World ID responses return an allowlisted verification summary; nullifiers, credential subjects, and provider storage references are private.
|
|
18
|
+
|
|
19
|
+
Sandbox runs require an operator API key. Enriched profiles, the trust-gated proxy, and webhook registration require a Pro operator API key. Webhook deliveries are scoped to the operator that initiated the evaluation and the selected chain. Legacy global evaluation history and platform statistics are restricted to Valiron administrators; use authenticated operator analytics for your own account.
|
|
20
|
+
|
|
21
|
+
The gate also requires agent challenge-response headers (`x-agent-address` plus a valid `x-agent-session`, or a signed fresh challenge). Operator credentials do not replace agent identity. See [authentication](https://www.valiron.co/auth.md).
|
|
22
|
+
|
|
23
|
+
## Monthly request allowance
|
|
24
|
+
|
|
25
|
+
Free includes **100,000 metered API requests per account per UTC calendar month**.
|
|
26
|
+
Request 100,000 is allowed; subsequent requests return HTTP 429 with
|
|
27
|
+
`code: "MONTHLY_REQUEST_LIMIT_EXCEEDED"`, `error: "upgrade_required"`, `limit`,
|
|
28
|
+
`used`, `resetsAt`, and `upgradeUrl`. Upgrade to Pro or wait until the first of
|
|
29
|
+
the next month at 00:00 UTC. Pro ($149/month) and Enterprise have no monthly
|
|
30
|
+
request cap; existing feature gates, per-endpoint rate limits and traffic
|
|
31
|
+
protections still apply. Crossing the limit never automatically subscribes or
|
|
32
|
+
charges an account.
|
|
33
|
+
|
|
34
|
+
The shared account allowance counts admitted calls to:
|
|
35
|
+
|
|
36
|
+
- `POST /operator/gate/:agentId`
|
|
37
|
+
- `POST /operator/identity/verify`
|
|
38
|
+
- `POST /operator/trigger-sandbox/:agentId` and `/operator/trigger-sandbox-key/:agentAddress`
|
|
39
|
+
- `POST /proxy/:agentId` (still Pro-only)
|
|
40
|
+
- Any configured `/wrap/:operatorId/*` request, charged to the endpoint owner.
|
|
41
|
+
|
|
42
|
+
Direct metered calls require `Authorization: Bearer val_op_...` (a valid dashboard
|
|
43
|
+
JWT is also accepted). Gate/proxy agent identity requirements still apply.
|
|
44
|
+
Wrappers resolve the account from the stored endpoint; an internal trust check
|
|
45
|
+
is included in the wrapper request, not counted again. Each attempt admitted
|
|
46
|
+
by the monthly counter counts, even if payment, trust or upstream work later
|
|
47
|
+
fails. Requests rejected by authentication or the monthly limit do not count.
|
|
48
|
+
Public profile/discovery reads, identity challenges, health, account management,
|
|
49
|
+
checkout, and analytics are outside this allowance.
|
|
50
|
+
|
|
51
|
+
Responses include `X-Valiron-Monthly-Used` and `X-Valiron-Monthly-Reset`.
|
|
52
|
+
Free responses also include `X-Valiron-Monthly-Limit` and
|
|
53
|
+
`X-Valiron-Monthly-Remaining`. A quota rejection includes `Retry-After`.
|
|
54
|
+
If persistent usage storage is unavailable, metered calls return HTTP 503;
|
|
55
|
+
there is no process-local fallback that could bypass the allowance.
|
|
56
|
+
|
|
13
57
|
## Trust Evaluation Endpoints
|
|
14
58
|
|
|
15
59
|
### POST /operator/identity/verify
|
|
@@ -397,9 +441,7 @@ Get the latest behavioral snapshot hash for an agent. Returns an opaque hash sui
|
|
|
397
441
|
"agentId": "25459",
|
|
398
442
|
"snapshotHash": "0x3a7f2b...",
|
|
399
443
|
"previousHash": "0x0",
|
|
400
|
-
"
|
|
401
|
-
"timestamp": "2026-04-01T12:00:00.000Z",
|
|
402
|
-
"interactionCount": 15
|
|
444
|
+
"timestamp": "2026-04-01T12:00:00.000Z"
|
|
403
445
|
}
|
|
404
446
|
```
|
|
405
447
|
|
|
@@ -415,7 +457,7 @@ Get the latest behavioral snapshot hash for an agent. Returns an opaque hash sui
|
|
|
415
457
|
|
|
416
458
|
## POST /operator/webhooks/register
|
|
417
459
|
|
|
418
|
-
Register a webhook
|
|
460
|
+
Register a public HTTPS webhook with a Pro operator API key. Events are limited to evaluations initiated by that operator on the selected `chain`; registrations cannot subscribe to other operators. Existing registrations must be recreated after the privacy update. Set `?chain=<network>` when registering; use `?chain=key` for key-based evaluations.
|
|
419
461
|
|
|
420
462
|
### Request Body
|
|
421
463
|
|
|
@@ -431,7 +473,7 @@ Register a webhook URL to receive `evaluation_complete` events whenever Valiron
|
|
|
431
473
|
|-------|------|----------|-------------|
|
|
432
474
|
| `event` | string | yes | Must be `"evaluation_complete"` |
|
|
433
475
|
| `url` | string | yes | HTTPS endpoint to receive webhook POST requests |
|
|
434
|
-
| `agentIds` | number[] | no | Filter to specific agent IDs. Omit for
|
|
476
|
+
| `agentIds` | number[] | no | Filter to specific agent IDs. Omit for your own evaluations on the selected chain. |
|
|
435
477
|
|
|
436
478
|
### Response — 201 Created
|
|
437
479
|
|
|
@@ -491,7 +533,7 @@ When an evaluation completes, Valiron POSTs the following to your registered URL
|
|
|
491
533
|
|
|
492
534
|
---
|
|
493
535
|
|
|
494
|
-
## POST /
|
|
536
|
+
## POST /proxy/:agentId (Pro)
|
|
495
537
|
|
|
496
538
|
Forward a request through Valiron's edge proxy with automatic trust gating, logging, and SSRF protection.
|
|
497
539
|
|
|
@@ -584,17 +626,15 @@ Verify a signed challenge to authenticate a key-based agent.
|
|
|
584
626
|
"riskLevel": null,
|
|
585
627
|
"route": null,
|
|
586
628
|
"icebreaker": null,
|
|
587
|
-
"reasons": [
|
|
588
|
-
"Identity verified via cryptographic challenge-response",
|
|
589
|
-
"No behavioral data yet — agent has not been scored"
|
|
590
|
-
],
|
|
629
|
+
"reasons": [],
|
|
591
630
|
"timestamp": "2026-04-01T12:00:00.000Z"
|
|
592
631
|
}
|
|
593
632
|
```
|
|
594
633
|
|
|
595
634
|
### GET /operator/key/:agentAddress
|
|
596
635
|
|
|
597
|
-
Get the profile of a key-based agent.
|
|
636
|
+
Get the public profile of a key-based agent. Icebreaker context and reasons are
|
|
637
|
+
redacted from this response.
|
|
598
638
|
|
|
599
639
|
#### Response — 200 OK
|
|
600
640
|
|
|
@@ -607,14 +647,47 @@ Get the profile of a key-based agent.
|
|
|
607
647
|
"riskLevel": "GREEN",
|
|
608
648
|
"route": "prod",
|
|
609
649
|
"icebreaker": null,
|
|
610
|
-
"reasons": [
|
|
611
|
-
"Identity verified via cryptographic challenge-response",
|
|
612
|
-
"Valiron behavioral tier: A (GREEN)"
|
|
613
|
-
],
|
|
650
|
+
"reasons": [],
|
|
614
651
|
"timestamp": "2026-04-01T12:00:00.000Z"
|
|
615
652
|
}
|
|
616
653
|
```
|
|
617
654
|
|
|
655
|
+
### GET /operator/key/:agentAddress/icebreaker
|
|
656
|
+
|
|
657
|
+
Get the Icebreaker owner context for a verified key-based agent. Supply a Pro
|
|
658
|
+
operator API key as `Authorization: Bearer val_op_...`. The agent may instead
|
|
659
|
+
authenticate with its Valiron `x-agent-address` and `x-agent-session` headers.
|
|
660
|
+
The route returns `401` for a missing agent session and `403` when the caller
|
|
661
|
+
is neither that agent nor a Pro operator.
|
|
662
|
+
|
|
663
|
+
```typescript
|
|
664
|
+
const valiron = new ValironSDK({ apiKey: process.env.VALIRON_API_KEY });
|
|
665
|
+
const { icebreaker } = await valiron.getKeyAgentIcebreaker(agentAddress);
|
|
666
|
+
```
|
|
667
|
+
|
|
668
|
+
```json
|
|
669
|
+
{
|
|
670
|
+
"agentAddress": "0x...",
|
|
671
|
+
"icebreaker": {
|
|
672
|
+
"attested": true,
|
|
673
|
+
"uid": "0x...",
|
|
674
|
+
"owner": "Jane Doe",
|
|
675
|
+
"verifiedHandles": [{ "source": "github", "handle": "janedoe" }],
|
|
676
|
+
"organization": "Acme",
|
|
677
|
+
"profileUrl": "https://app.icebreaker.xyz/profiles/...",
|
|
678
|
+
"credentialUrl": "https://app.icebreaker.xyz/credentials/..."
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
```
|
|
682
|
+
|
|
683
|
+
When no matching credential exists, `icebreaker` is `{ "attested": false }`.
|
|
684
|
+
These are verified profile handles, not Icebreaker connections or mutuals.
|
|
685
|
+
Valiron checks the off-chain EAS signature, UID, signer, schema, recipient,
|
|
686
|
+
credential name, and expiry before returning `attested: true`. The lookup uses
|
|
687
|
+
Icebreaker's profile API and does not independently check off-chain revocation.
|
|
688
|
+
The Web2 middleware's behavioral score does not change when this attestation
|
|
689
|
+
appears; the API seller must enforce any policy that uses it.
|
|
690
|
+
|
|
618
691
|
---
|
|
619
692
|
|
|
620
693
|
## World ID Endpoints
|
|
@@ -795,7 +868,7 @@ Solana agent identity and reputation data is provided by [QuantuLabs 8004-solana
|
|
|
795
868
|
| **Extra reputation fields** | — | `solana.trustTier`, `solana.qualityScore`, `solana.confidence`, `solana.riskScore`, `solana.uniqueCallers` |
|
|
796
869
|
| **Wallet → Agent resolution** | Redis → Agent0 subgraph | QuantuLabs `getAgentsByOwner()` |
|
|
797
870
|
| **Liveness check** | — | `isItAlive()` endpoint-by-endpoint health probe |
|
|
798
|
-
| **Feedback write-back** | — | Valiron scores written on-chain via `giveFeedback()`
|
|
871
|
+
| **Feedback write-back** | — | Valiron scores written on-chain via `giveFeedback()` when enabled by Valiron |
|
|
799
872
|
|
|
800
873
|
### Sequential Agent IDs
|
|
801
874
|
|
|
@@ -838,7 +911,7 @@ The `trigger-sandbox` endpoint also includes a `liveness` summary in its respons
|
|
|
838
911
|
|
|
839
912
|
### Feedback Write-Back
|
|
840
913
|
|
|
841
|
-
When
|
|
914
|
+
When feedback write-back is enabled, Valiron automatically writes evaluation scores back to the Solana reputation registry after sandbox testing and gate evaluations. This closes the trust loop — other consumers of the 8004-solana registry can see Valiron's scores.
|
|
842
915
|
|
|
843
916
|
Feedback is submitted as fire-and-forget using the `starred` tag with `tag2: "valiron"` for attribution.
|
|
844
917
|
|
|
@@ -886,15 +959,6 @@ curl "https://valiron-edge-proxy.onrender.com/operator/wallet/7xKX...?chain=sola
|
|
|
886
959
|
curl -X POST "https://valiron-edge-proxy.onrender.com/operator/trigger-sandbox/GL4k...?chain=solana"
|
|
887
960
|
```
|
|
888
961
|
|
|
889
|
-
### Environment Variables
|
|
890
|
-
|
|
891
|
-
| Variable | Default | Description |
|
|
892
|
-
|----------|---------|-------------|
|
|
893
|
-
| `SOLANA_CLUSTER` | `mainnet-beta` | Solana cluster (`mainnet-beta` or `devnet`) |
|
|
894
|
-
| `SOLANA_RPC_URL` | Public RPC | Custom Solana RPC endpoint |
|
|
895
|
-
| `SOLANA_FEEDBACK_KEYPAIR` | — | JSON array secret key (e.g. `[1,2,...,64]`) for feedback write-back. When set, Valiron scores are written on-chain after evaluation. |
|
|
896
|
-
|
|
897
|
-
---
|
|
898
962
|
|
|
899
963
|
## Dashboard Endpoints (JWT-Authenticated)
|
|
900
964
|
|
|
@@ -969,6 +1033,7 @@ Get the current operator's profile. Requires JWT.
|
|
|
969
1033
|
"role": "operator",
|
|
970
1034
|
"plan": "standard",
|
|
971
1035
|
"fee_rate": "0.03",
|
|
1036
|
+
"onboarding_completed_at": "2026-01-01T00:05:00.000Z",
|
|
972
1037
|
"created_at": "2026-01-01T00:00:00.000Z",
|
|
973
1038
|
"updated_at": "2026-01-01T00:00:00.000Z"
|
|
974
1039
|
}
|
|
@@ -991,6 +1056,30 @@ Update operator name. Requires JWT.
|
|
|
991
1056
|
|
|
992
1057
|
---
|
|
993
1058
|
|
|
1059
|
+
### POST /operator/onboarding/complete
|
|
1060
|
+
|
|
1061
|
+
Mark the guided account setup as completed or dismissed. Requires JWT. This
|
|
1062
|
+
endpoint is idempotent, so clients can safely retry it.
|
|
1063
|
+
|
|
1064
|
+
New accounts have a null `onboarding_completed_at` value until this endpoint is
|
|
1065
|
+
called. Valiron uses that value to resume unfinished setup after email, Google,
|
|
1066
|
+
or GitHub authentication.
|
|
1067
|
+
|
|
1068
|
+
#### Response — 200 OK
|
|
1069
|
+
|
|
1070
|
+
```json
|
|
1071
|
+
{
|
|
1072
|
+
"ok": true,
|
|
1073
|
+
"operator": {
|
|
1074
|
+
"id": "uuid",
|
|
1075
|
+
"email": "you@example.com",
|
|
1076
|
+
"onboarding_completed_at": "2026-01-01T00:05:00.000Z"
|
|
1077
|
+
}
|
|
1078
|
+
}
|
|
1079
|
+
```
|
|
1080
|
+
|
|
1081
|
+
---
|
|
1082
|
+
|
|
994
1083
|
### GET /operator/keys
|
|
995
1084
|
|
|
996
1085
|
List all API keys for the current operator. Requires JWT.
|
|
@@ -1379,12 +1468,3 @@ Execute a test request through the edge proxy as a simulated agent. Requires JWT
|
|
|
1379
1468
|
```
|
|
1380
1469
|
|
|
1381
1470
|
---
|
|
1382
|
-
|
|
1383
|
-
### Admin Endpoints (require `role: "admin"`)
|
|
1384
|
-
|
|
1385
|
-
| Endpoint | Method | Description |
|
|
1386
|
-
|----------|--------|-------------|
|
|
1387
|
-
| `/operator/admin/stats` | GET | Platform-wide stats |
|
|
1388
|
-
| `/operator/admin/operators` | GET | List all operators with aggregate stats |
|
|
1389
|
-
| `/operator/admin/operators/:id` | GET | Full operator detail (keys, endpoints, agents, revenue) |
|
|
1390
|
-
| `/operator/admin/operators/:id/logs` | GET | Call logs for a specific operator |
|
package/docs/DASHBOARD.md
CHANGED
|
@@ -11,10 +11,21 @@
|
|
|
11
11
|
To create an account:
|
|
12
12
|
|
|
13
13
|
1. Go to [valiron.co/dashboard](https://www.valiron.co/dashboard) and click **Create account**
|
|
14
|
-
2. Enter your name, email, and password
|
|
14
|
+
2. Enter your name, email, and password, or continue with Google or GitHub
|
|
15
15
|
3. On success, you'll see a **one-time API key** — copy it immediately (it won't be shown again)
|
|
16
|
+
4. Complete the same guided setup for every sign-up method: Account, Signals, Policy, Endpoint, Install, Deploy, and Finish
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
Onboarding completion is stored on the operator account, so an unfinished setup
|
|
19
|
+
resumes after email, Google, or GitHub login and on another browser. If the
|
|
20
|
+
original one-time key is no longer available, the wizard can generate a
|
|
21
|
+
dedicated setup key. Existing operators are not forced back through onboarding.
|
|
22
|
+
|
|
23
|
+
The Signals step supports registered ERC-8004/Solana agents, persistent
|
|
24
|
+
key-based agents, and ANS or other provider-backed identities. ANS is an agent
|
|
25
|
+
identity option; it is not required to create a Valiron operator account.
|
|
26
|
+
|
|
27
|
+
After registration, sign in with your email and password, Google, or GitHub.
|
|
28
|
+
Your session is stored as a JWT in the browser.
|
|
18
29
|
|
|
19
30
|
---
|
|
20
31
|
|
|
@@ -109,7 +109,7 @@ Choose the behavior that fits the endpoint:
|
|
|
109
109
|
| Monetized endpoint logging | Use `ValironOperator.paywall()` to gate access, attach a configured per-call price, and record usage |
|
|
110
110
|
| Agent profile lookup | Retrieve a profile when your product needs to display or review trust evidence |
|
|
111
111
|
| Predictive risk | Use dashboard/API forecasts as an additional operational signal; do not replace the runtime gate with a forecast |
|
|
112
|
-
| Audit and operations | Capture the result in your logs or use dashboard call logs
|
|
112
|
+
| Audit and operations | Capture the result in your logs or use authenticated dashboard call logs |
|
|
113
113
|
|
|
114
114
|
Valiron does not itself settle a payment or choose a dynamic price table. It
|
|
115
115
|
provides the verified trust context that your payment and application policy
|
package/docs/ERRORS.md
CHANGED
|
@@ -199,7 +199,7 @@ The `GET /operator/agent/:agentId/liveness?chain=solana` endpoint probes each se
|
|
|
199
199
|
|
|
200
200
|
### Feedback write-back errors
|
|
201
201
|
|
|
202
|
-
If
|
|
202
|
+
If on-chain feedback is unavailable, the evaluation result is still returned. Contact Valiron support if feedback remains unavailable.
|
|
203
203
|
|
|
204
204
|
### Solana RPC rate limits
|
|
205
205
|
|
|
@@ -304,3 +304,14 @@ store or other safe-verification failure returns HTTP 503 with
|
|
|
304
304
|
| 403 | Trusted Self payload ingestion is disabled | Use the production session + signed webhook flow, or set `SELF_ALLOW_TRUSTED_PAYLOADS=true` only for local/internal tests |
|
|
305
305
|
| 404 | Agent not found on-chain | Use an existing ERC-8004 agent ID or a supported Solana agent ID before creating a Self session |
|
|
306
306
|
| 409 | Agent already has a verified Self link | Self links are immutable once verified |
|
|
307
|
+
|
|
308
|
+
## Monthly request allowance
|
|
309
|
+
|
|
310
|
+
`429 MONTHLY_REQUEST_LIMIT_EXCEEDED` means the account has used its 100,000
|
|
311
|
+
Free requests for the UTC calendar month. Upgrade to Pro or wait until
|
|
312
|
+
`resetsAt`; use `Retry-After` rather than retrying continuously. This allowance
|
|
313
|
+
is shared across API keys and hosted endpoints.
|
|
314
|
+
|
|
315
|
+
`503 MONTHLY_USAGE_UNAVAILABLE` means request usage could not be checked.
|
|
316
|
+
Retry after the response's `Retry-After` delay. No work is admitted without
|
|
317
|
+
a successful usage check.
|
package/docs/IDENTITY.md
CHANGED
|
@@ -186,10 +186,24 @@ Not every agent has an on-chain ERC-8004 identity. For local, Web2, and non-ERC-
|
|
|
186
186
|
3. Agent signs the nonce with their private key (EIP-191 personal sign)
|
|
187
187
|
4. Valiron verifies the signature and creates a `KeyAgentProfile`
|
|
188
188
|
|
|
189
|
-
The SDK and middleware auto-detect key-based agents from the `x-agent-address` header.
|
|
189
|
+
The SDK and middleware auto-detect key-based agents from the `x-agent-address` header. The standard trust gate reads a previously verified profile; the header alone is not a fresh proof of possession. API sellers should bind it to their authenticated caller before a sensitive action.
|
|
190
190
|
|
|
191
191
|
Agents can follow the hosted identity skill at [https://www.valiron.co/auth.md](https://www.valiron.co/auth.md) to generate an identifier, request a challenge, sign it, and cache the returned session token.
|
|
192
192
|
|
|
193
|
+
If an API requires a human operator link, the agent should pass its exact public
|
|
194
|
+
address to its human operator. That person creates an Icebreaker profile with
|
|
195
|
+
verified social handles and issues a `Designated agent` credential for the
|
|
196
|
+
address. The API seller reads the private Icebreaker view with a Pro key and
|
|
197
|
+
enforces its policy before the protected action. The Laso-style Web2 demo
|
|
198
|
+
returns `HUMAN_ATTESTATION_REQUIRED` until the credential exists and
|
|
199
|
+
`HUMAN_PROFILE_INCOMPLETE` if no verified social handle is available. Key
|
|
200
|
+
registration alone does not unlock that route.
|
|
201
|
+
|
|
202
|
+
A key-only sandbox relay has no agent endpoint to observe. Its score must not
|
|
203
|
+
be treated as demonstrated behavior for a sensitive purchase or payout. Bind
|
|
204
|
+
the address to the API seller's authenticated caller and use a separate,
|
|
205
|
+
action-specific policy for Icebreaker context.
|
|
206
|
+
|
|
193
207
|
### KeyAgentProfile
|
|
194
208
|
|
|
195
209
|
| Field | Type | Description |
|
|
@@ -200,8 +214,8 @@ Agents can follow the hosted identity skill at [https://www.valiron.co/auth.md](
|
|
|
200
214
|
| `tier` | string \| null | Moody's-style trust tier once scored |
|
|
201
215
|
| `riskLevel` | string \| null | GREEN / YELLOW / RED once scored |
|
|
202
216
|
| `route` | string \| null | Route decision once scored |
|
|
203
|
-
| `icebreaker` | object \| null |
|
|
204
|
-
| `reasons` | string[] |
|
|
217
|
+
| `icebreaker` | object \| null | Redacted to `null` on the public endpoint; use `getKeyAgentIcebreaker()` with a Pro key |
|
|
218
|
+
| `reasons` | string[] | Redacted to `[]` on the public endpoint |
|
|
205
219
|
| `timestamp` | string | ISO timestamp for the profile response |
|
|
206
220
|
|
|
207
221
|
### Key-Based vs On-Chain Agents
|
|
@@ -368,8 +382,4 @@ These fields appear in the `onchainReputation.solana` section of the API respons
|
|
|
368
382
|
|
|
369
383
|
### Solana Feedback Write-Back
|
|
370
384
|
|
|
371
|
-
After sandbox or gate evaluation, Valiron
|
|
372
|
-
|
|
373
|
-
| Environment Variable | Format | Description |
|
|
374
|
-
|---------------------|--------|-------------|
|
|
375
|
-
| `SOLANA_FEEDBACK_KEYPAIR` | JSON array (e.g. `[174,23,...]`) | Ed25519 secret key for signing feedback transactions |
|
|
385
|
+
After sandbox or gate evaluation, Valiron may publish scores to the Solana registry. Valiron manages this process; SDK users do not configure signing credentials.
|
package/docs/MCP.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Valiron MCP Server
|
|
2
|
+
|
|
3
|
+
Connect your MCP client to **https://www.valiron.co/mcp** with **Streamable HTTP** transport. This public server requires no API key. Use the canonical `www` URL directly to avoid redirects during POST requests.
|
|
4
|
+
|
|
5
|
+
For clients that accept a remote server configuration:
|
|
6
|
+
|
|
7
|
+
```json
|
|
8
|
+
{
|
|
9
|
+
"mcpServers": {
|
|
10
|
+
"valiron": {
|
|
11
|
+
"url": "https://www.valiron.co/mcp"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Client configuration formats vary; select Streamable HTTP when your client asks for the transport.
|
|
18
|
+
|
|
19
|
+
## Tools
|
|
20
|
+
|
|
21
|
+
| Tool | Input | Result |
|
|
22
|
+
| --- | --- | --- |
|
|
23
|
+
| `get_api_health` | `{}` | Live Valiron API health, supported chains, and default chain |
|
|
24
|
+
| `get_agent_profile` | `{"agentId":"42","chain":"ethereum"}` | Allowlisted identity and trust summary for a registered ERC-8004 or Solana agent |
|
|
25
|
+
| `get_integration_docs` | `{"topic":"quickstart"}` | Valiron documentation; topics: `quickstart`, `api`, `identity`, `integration`, `errors` |
|
|
26
|
+
|
|
27
|
+
The `https://www.valiron.co/api` MCP resource also lists developer links. Profile lookups do not grant access, verify the caller's identity, or run new sandbox tests. MCP exposes public reads only; operator keys, paid signals, account changes, sandbox execution, and access decisions use the [REST API](./API-REFERENCE.md) or SDK. Never put operator secrets in tool arguments.
|
|
28
|
+
|
|
29
|
+
## Transport
|
|
30
|
+
|
|
31
|
+
The server uses stateless Streamable HTTP with JSON responses. POST MCP JSON-RPC messages with `Content-Type: application/json` and `Accept: application/json, text/event-stream`. It does not assign session IDs or offer a persistent GET event stream; GET and DELETE return 405. The SDK negotiates supported protocol versions during initialization.
|
|
32
|
+
|
|
33
|
+
```sh
|
|
34
|
+
curl https://www.valiron.co/mcp \
|
|
35
|
+
-H 'Content-Type: application/json' \
|
|
36
|
+
-H 'Accept: application/json, text/event-stream' \
|
|
37
|
+
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"example","version":"1.0.0"}}}'
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Requests are limited to 16 KiB. Process-local admission limits allow 120 requests per minute and 8 concurrent requests per instance; a 429 includes `Retry-After`. Upstream calls time out after 10 seconds and responses are limited to 256 KiB. API failures are returned as MCP tool errors. Browser requests with an Origin header must originate from `https://www.valiron.co` or `https://valiron.co`; server-to-server clients can omit Origin.
|
|
41
|
+
|
|
42
|
+
## Other interfaces
|
|
43
|
+
|
|
44
|
+
- [Valiron developer portal](https://www.valiron.co/developers)
|
|
45
|
+
- [Valiron OpenAPI specification](https://www.valiron.co/openapi.json)
|
|
46
|
+
- [Valiron authentication](https://www.valiron.co/auth.md)
|
|
47
|
+
- [Valiron API discovery](https://www.valiron.co/api)
|
|
48
|
+
- [Valiron MCP discovery metadata](https://www.valiron.co/.well-known/mcp.json)
|
|
49
|
+
|
|
50
|
+
The profile tool strips behavioral metrics, evidence storage links, RPC URLs, and provider verification metadata even if an older upstream API returns them.
|
|
@@ -7,6 +7,8 @@ credentials and trusted CA bundle are configured. SDK 1.3 adds signing helpers,
|
|
|
7
7
|
a typed verification method, and dedicated identity gates for Express, Fastify,
|
|
8
8
|
Next.js, and framework-independent runtimes.
|
|
9
9
|
|
|
10
|
+
Verification calls require your operator API key and count toward your account’s monthly request allowance. Free includes 100,000 metered requests per UTC calendar month; Pro has no monthly request cap.
|
|
11
|
+
|
|
10
12
|
## Responsibility boundary
|
|
11
13
|
|
|
12
14
|
An identity provider establishes the agent's canonical identifier, verification
|
|
@@ -240,26 +242,9 @@ The timestamp, nonce, request digest, and `valiron-agent-request-v1` payload are
|
|
|
240
242
|
a Valiron transport-proof envelope. They are not presented as an ANS-native HTTP
|
|
241
243
|
signature standard.
|
|
242
244
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
| --- | --- | --- |
|
|
247
|
-
| `ANS_TRUSTED_CA_PEM` | yes | PEM bundle of trusted ANS Registry Authority CA roots; escaped `\\n` is accepted |
|
|
248
|
-
| `ANS_API_KEY` and `ANS_API_SECRET` | one auth method | GoDaddy classic Developer Portal `sso-key` credentials |
|
|
249
|
-
| `ANS_OAUTH_TOKEN` | one auth method | Future OAuth/PAT bearer token; takes precedence, so leave it unset when using classic credentials |
|
|
250
|
-
| `ANS_API_BASE_URL` | no | Registry Authority origin; defaults to `https://api.godaddy.com` |
|
|
251
|
-
| `ANS_TRANSPARENCY_BASE_URL` | no | Transparency Log origin; defaults to the matching production or OTE GoDaddy service |
|
|
252
|
-
|
|
253
|
-
The official production CA bundle is published at
|
|
254
|
-
<https://raw.githubusercontent.com/agentnameservice/ans-registry/main/pki/prod/ca-bundle.pem>
|
|
255
|
-
(with [PKI documentation](https://github.com/agentnameservice/ans-registry/tree/main/pki)).
|
|
256
|
-
Copy its raw PEM content with exact `BEGIN CERTIFICATE` and `END CERTIFICATE`
|
|
257
|
-
lines. Do not include Markdown backslashes or wrap the entire value in literal
|
|
258
|
-
quotes in the Render dashboard. These variables belong to Valiron's service,
|
|
259
|
-
not customer SDK installations.
|
|
260
|
-
|
|
261
|
-
If credentials or the CA bundle are absent, the resolver is not registered and
|
|
262
|
-
ANS claims return `claimed` with `failureReason: "resolver_unavailable"`.
|
|
245
|
+
Valiron manages provider credentials and trust configuration on the hosted service. Customers supply signed proofs, not provider secrets.
|
|
246
|
+
|
|
247
|
+
If the hosted resolver is unavailable, ANS claims return `claimed` with `failureReason: "resolver_unavailable"`.
|
|
263
248
|
Malformed, inactive, revoked, mismatched, untrusted, or certificate-less ANS
|
|
264
249
|
records cannot become `verified`.
|
|
265
250
|
|
package/docs/QUICKSTART.md
CHANGED
|
@@ -4,9 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
## Prerequisites
|
|
6
6
|
|
|
7
|
-
1. **Create an account** on the [Operator Dashboard](./DASHBOARD.md) at [valiron.co/dashboard](https://www.valiron.co/dashboard)
|
|
8
|
-
2. **
|
|
9
|
-
3.
|
|
7
|
+
1. **Create an account** with email/password, Google, or GitHub on the [Operator Dashboard](./DASHBOARD.md) at [valiron.co/dashboard](https://www.valiron.co/dashboard)
|
|
8
|
+
2. **Complete the guided setup** — every sign-up method enters the same resumable onboarding flow
|
|
9
|
+
3. **Copy your API key** when it is shown; returning incomplete accounts can generate a dedicated setup key
|
|
10
|
+
4. Add the SDK middleware below to the backend routes agents call. Choose registered, key-based, or ANS/provider-backed identity in the wizard.
|
|
10
11
|
|
|
11
12
|
> **Tip:** Before writing any code, try the [API Playground](./DASHBOARD.md#api-playground) to see how Valiron evaluates agents at different trust levels against your endpoints.
|
|
12
13
|
|
|
@@ -176,6 +177,7 @@ Get notified whenever Valiron evaluates an agent calling your API:
|
|
|
176
177
|
|
|
177
178
|
```bash
|
|
178
179
|
curl -X POST https://valiron-edge-proxy.onrender.com/operator/webhooks/register \
|
|
180
|
+
-H "Authorization: Bearer $VALIRON_API_KEY" \
|
|
179
181
|
-H "Content-Type: application/json" \
|
|
180
182
|
-d '{"event": "evaluation_complete", "url": "https://your-endpoint.com/hooks/valiron"}'
|
|
181
183
|
```
|
|
@@ -202,10 +204,10 @@ curl https://valiron-edge-proxy.onrender.com/operator/key/0x1234...abcd
|
|
|
202
204
|
curl -X POST https://valiron-edge-proxy.onrender.com/operator/key/0x1234...abcd/challenge
|
|
203
205
|
|
|
204
206
|
# Trigger sandbox evaluation
|
|
205
|
-
curl -X POST https://valiron-edge-proxy.onrender.com/operator/trigger-sandbox/AGENT_ID
|
|
207
|
+
curl -X POST https://valiron-edge-proxy.onrender.com/operator/trigger-sandbox/AGENT_ID -H "Authorization: Bearer $VALIRON_API_KEY"
|
|
206
208
|
|
|
207
209
|
# Trigger sandbox for key-based agent
|
|
208
|
-
curl -X POST https://valiron-edge-proxy.onrender.com/operator/trigger-sandbox-key/0x1234...abcd
|
|
210
|
+
curl -X POST https://valiron-edge-proxy.onrender.com/operator/trigger-sandbox-key/0x1234...abcd -H "Authorization: Bearer $VALIRON_API_KEY"
|
|
209
211
|
|
|
210
212
|
# Gate decision (allow/deny)
|
|
211
213
|
curl -X POST https://valiron-edge-proxy.onrender.com/operator/gate/AGENT_ID
|
|
@@ -215,6 +217,7 @@ curl https://valiron-edge-proxy.onrender.com/operator/agent/AGENT_ID/snapshot
|
|
|
215
217
|
|
|
216
218
|
# Register webhook
|
|
217
219
|
curl -X POST https://valiron-edge-proxy.onrender.com/operator/webhooks/register \
|
|
220
|
+
-H "Authorization: Bearer $VALIRON_API_KEY" \
|
|
218
221
|
-H "Content-Type: application/json" \
|
|
219
222
|
-d '{"event": "evaluation_complete", "url": "https://your-endpoint.com/hooks"}'
|
|
220
223
|
```
|
package/docs/README.md
CHANGED
|
@@ -70,3 +70,9 @@ trusted CA bundle live in Valiron's hosted service, not customer applications. S
|
|
|
70
70
|
```
|
|
71
71
|
https://valiron-edge-proxy.onrender.com
|
|
72
72
|
```
|
|
73
|
+
|
|
74
|
+
## Developer interfaces
|
|
75
|
+
|
|
76
|
+
- [Valiron OpenAPI](https://www.valiron.co/openapi.json)
|
|
77
|
+
- [Valiron MCP server setup](./MCP.md)
|
|
78
|
+
- [Valiron developer portal](https://www.valiron.co/developers)
|
package/docs/SANDBOX.md
CHANGED
|
@@ -51,10 +51,10 @@ console.log(keyResult.tier); // "A"
|
|
|
51
51
|
|
|
52
52
|
```bash
|
|
53
53
|
# On-chain agent
|
|
54
|
-
curl -X POST https://valiron-edge-proxy.onrender.com/operator/trigger-sandbox/YOUR_AGENT_ID
|
|
54
|
+
curl -X POST https://valiron-edge-proxy.onrender.com/operator/trigger-sandbox/YOUR_AGENT_ID -H "Authorization: Bearer $VALIRON_API_KEY"
|
|
55
55
|
|
|
56
56
|
# Key-based agent
|
|
57
|
-
curl -X POST https://valiron-edge-proxy.onrender.com/operator/trigger-sandbox-key/0x1234...abcd
|
|
57
|
+
curl -X POST https://valiron-edge-proxy.onrender.com/operator/trigger-sandbox-key/0x1234...abcd -H "Authorization: Bearer $VALIRON_API_KEY"
|
|
58
58
|
```
|
|
59
59
|
|
|
60
60
|
## Auto-Sandbox
|
|
@@ -91,10 +91,10 @@ const result = await valiron.triggerKeyAgentSandbox("0x1234...abcd");
|
|
|
91
91
|
|
|
92
92
|
```bash
|
|
93
93
|
# On-chain agent
|
|
94
|
-
curl -X POST https://valiron-edge-proxy.onrender.com/operator/trigger-sandbox/YOUR_AGENT_ID
|
|
94
|
+
curl -X POST https://valiron-edge-proxy.onrender.com/operator/trigger-sandbox/YOUR_AGENT_ID -H "Authorization: Bearer $VALIRON_API_KEY"
|
|
95
95
|
|
|
96
96
|
# Key-based agent
|
|
97
|
-
curl -X POST https://valiron-edge-proxy.onrender.com/operator/trigger-sandbox-key/0x1234...abcd
|
|
97
|
+
curl -X POST https://valiron-edge-proxy.onrender.com/operator/trigger-sandbox-key/0x1234...abcd -H "Authorization: Bearer $VALIRON_API_KEY"
|
|
98
98
|
```
|
|
99
99
|
|
|
100
100
|
## Tips for Passing Sandbox Tests
|
|
@@ -121,9 +121,7 @@ If all endpoints are unreachable (`status: "dead"`), the sandbox may still proce
|
|
|
121
121
|
|
|
122
122
|
After a sandbox evaluation completes, Valiron writes the computed trust score back to the Solana reputation registry via the ATOM engine's `giveFeedback()`. This closes the loop — sandbox results become on-chain reputation.
|
|
123
123
|
|
|
124
|
-
|
|
125
|
-
- `SOLANA_FEEDBACK_KEYPAIR` environment variable must be set (JSON array of the Ed25519 secret key)
|
|
126
|
-
- The keypair must have sufficient SOL for transaction fees
|
|
124
|
+
Feedback write-back is managed by Valiron; SDK users do not configure signing credentials.
|
|
127
125
|
|
|
128
126
|
Feedback write-back is **fire-and-forget** — if it fails, the sandbox result is still returned to the caller.
|
|
129
127
|
|
package/docs/SDK-REFERENCE.md
CHANGED
|
@@ -22,7 +22,7 @@ const valiron = new ValironSDK(config?: ValironConfig);
|
|
|
22
22
|
|
|
23
23
|
| Field | Type | Default | Description |
|
|
24
24
|
|-------|------|---------|-------------|
|
|
25
|
-
| `apiKey` | string | — | Operator API key. Optional for basic reads; required for Pro
|
|
25
|
+
| `apiKey` | string | — | Operator API key. Optional for basic reads; required for sandbox runs; Pro is required for paid signals, enriched profiles, proxy calls, and webhooks |
|
|
26
26
|
| `endpoint` | string | `https://valiron-edge-proxy.onrender.com` | API base URL |
|
|
27
27
|
| `chain` | SupportedChain | `"ethereum"` | Default blockchain network |
|
|
28
28
|
| `timeout` | number | method-aware | Request timeout in milliseconds. Defaults are 10s generally, 15s for `gate()`/`proxy()`, and 30s for sandbox triggers. If set, this value overrides all method-aware defaults. |
|
|
@@ -531,7 +531,12 @@ The SDK auto-detects key-based agents from the `x-agent-address` header. No conf
|
|
|
531
531
|
|
|
532
532
|
### Sandbox Evaluation for Key Agents
|
|
533
533
|
|
|
534
|
-
New key agents (verified but not yet scored)
|
|
534
|
+
New key agents (verified but not yet scored) receive 403 with `retryAfterMs: 30000`. The middleware attempts to trigger `triggerKeyAgentSandbox()` in the background. This run requires a valid operator API key; if it fails, the agent remains pending until an operator starts an evaluation. After evaluation completes, the agent receives a trust score; middleware allows the request when `verified === true` and the score meets the endpoint's `minScore`.
|
|
535
|
+
|
|
536
|
+
The current key-only sandbox relay does not observe the agent's own HTTP
|
|
537
|
+
behavior. Do not use that score alone to authorize a high-value purchase or
|
|
538
|
+
payout. The Web2 Icebreaker demo uses signed key ownership and reports
|
|
539
|
+
`behavioralScore: null` when no real behavioral evidence exists.
|
|
535
540
|
|
|
536
541
|
You can also trigger evaluation manually:
|
|
537
542
|
|
|
@@ -542,7 +547,7 @@ const result = await valiron.triggerKeyAgentSandbox("0x1234...abcd");
|
|
|
542
547
|
Or via HTTP:
|
|
543
548
|
|
|
544
549
|
```bash
|
|
545
|
-
curl -X POST https://valiron-edge-proxy.onrender.com/operator/trigger-sandbox-key/0x1234...abcd
|
|
550
|
+
curl -X POST https://valiron-edge-proxy.onrender.com/operator/trigger-sandbox-key/0x1234...abcd -H "Authorization: Bearer $VALIRON_API_KEY"
|
|
546
551
|
```
|
|
547
552
|
|
|
548
553
|
### KeyAgentProfile
|
|
@@ -555,10 +560,20 @@ curl -X POST https://valiron-edge-proxy.onrender.com/operator/trigger-sandbox-ke
|
|
|
555
560
|
| `tier` | string \| null | Moody's-style trust tier once scored |
|
|
556
561
|
| `riskLevel` | string \| null | GREEN / YELLOW / RED once scored |
|
|
557
562
|
| `route` | string \| null | Route decision once scored |
|
|
558
|
-
| `icebreaker` | object \| null |
|
|
559
|
-
| `reasons` | string[] |
|
|
563
|
+
| `icebreaker` | object \| null | Redacted from the public profile; use `getKeyAgentIcebreaker()` with a Pro key |
|
|
564
|
+
| `reasons` | string[] | Redacted from the public profile |
|
|
560
565
|
| `timestamp` | string | ISO timestamp for the profile response |
|
|
561
566
|
|
|
567
|
+
```typescript
|
|
568
|
+
const valiron = new ValironSDK({ apiKey: process.env.VALIRON_API_KEY });
|
|
569
|
+
const { icebreaker } = await valiron.getKeyAgentIcebreaker(agentAddress);
|
|
570
|
+
```
|
|
571
|
+
|
|
572
|
+
The private Icebreaker result contains the attestation state, owner, verified
|
|
573
|
+
social handles, organization, and profile and credential URLs. It does not
|
|
574
|
+
contain social connections or mutuals, and does not alter the Web2 behavioral
|
|
575
|
+
score automatically.
|
|
576
|
+
|
|
562
577
|
---
|
|
563
578
|
|
|
564
579
|
## World ID Methods
|
|
@@ -654,13 +669,16 @@ Trusted-payload ingestion for local/internal tests only. Production integrations
|
|
|
654
669
|
|
|
655
670
|
The SDK collects opt-out usage telemetry to improve reliability. Events include SDK version, runtime, environment, method names, chain labels, latency, HTTP status/error buckets, route decisions, and coarse score/reputation buckets. Raw agent IDs, wallet addresses, API keys, and exact scores are not sent in SDK telemetry. Operator paywall usage logs are separate customer analytics and are authenticated with the operator API key.
|
|
656
671
|
|
|
672
|
+
SDK reports are anonymous client reports and may be sampled. Signal counts describe reported selections, not successful verifications. Version comes from the shipped package metadata. Environment defaults to recognized `NODE_ENV` values (`production` → `prod`, `development` → `dev`, `test` → `test`), otherwise `unknown`; set it explicitly for browser applications. Telemetry observer failures do not affect API calls. Server statistics identify persisted counters versus counters limited to one process, and latency percentiles cover the latest 1,000 reported calls per method, chain, and version.
|
|
673
|
+
|
|
657
674
|
### TelemetryConfig
|
|
658
675
|
|
|
659
676
|
| Field | Type | Default | Description |
|
|
660
677
|
|-------|------|---------|-------------|
|
|
661
678
|
| `enabled` | boolean | `true` | Enable/disable telemetry |
|
|
662
679
|
| `sampleRate` | number | `1.0` | Fraction of events to sample (0–1) |
|
|
663
|
-
| `
|
|
680
|
+
| `env` | prod / staging / dev / test / unknown | NODE_ENV or unknown | Environment label |
|
|
681
|
+
| `onEvent` | function | — | Custom event handler; failures are isolated from API calls |
|
|
664
682
|
|
|
665
683
|
**Example**:
|
|
666
684
|
```typescript
|
|
@@ -913,7 +931,6 @@ import {
|
|
|
913
931
|
| Webhooks | — | ✓ |
|
|
914
932
|
| Proxy gateway | — | ✓ |
|
|
915
933
|
| Analytics & logs | — | ✓ |
|
|
916
|
-
| Evaluation history | — | ✓ |
|
|
917
934
|
| Custom tier thresholds | — | ✓ |
|
|
918
935
|
| Wallet intelligence | — | ✓ |
|
|
919
936
|
|
package/docs/TRUST-MODEL.md
CHANGED
|
@@ -53,16 +53,7 @@ Supported signals:
|
|
|
53
53
|
| `icebreaker` | Icebreaker human/background attestation | Pro |
|
|
54
54
|
| `wallet` | Explainable wallet-history activity and risk signal | Pro |
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
| Signal | Default Weight |
|
|
59
|
-
|--------|----------------|
|
|
60
|
-
| `sandbox` | 55 |
|
|
61
|
-
| `8004` | 25 |
|
|
62
|
-
| `world` | 15 |
|
|
63
|
-
| `self` | 15 |
|
|
64
|
-
| `icebreaker` | 5 |
|
|
65
|
-
| `wallet` | 15 |
|
|
56
|
+
Selected trust signals contribute to a combined trust assessment. Exact weighting and scoring internals are not part of the public API contract.
|
|
66
57
|
|
|
67
58
|
If no signals are specified, Valiron uses the plug-and-play default: sandbox plus any other available trust signals.
|
|
68
59
|
|
|
@@ -137,7 +128,7 @@ console.log(`Meets threshold: ${result.meetsThreshold}`);
|
|
|
137
128
|
Or via HTTP:
|
|
138
129
|
|
|
139
130
|
```bash
|
|
140
|
-
curl -X POST https://valiron-edge-proxy.onrender.com/operator/trigger-sandbox/AGENT_ID
|
|
131
|
+
curl -X POST https://valiron-edge-proxy.onrender.com/operator/trigger-sandbox/AGENT_ID -H "Authorization: Bearer $VALIRON_API_KEY"
|
|
141
132
|
```
|
|
142
133
|
|
|
143
134
|
Use selected signals in middleware:
|
|
@@ -174,4 +165,4 @@ ATOM reputation updated
|
|
|
174
165
|
Next evaluation includes new on-chain data
|
|
175
166
|
```
|
|
176
167
|
|
|
177
|
-
|
|
168
|
+
Feedback write-back is managed by Valiron. Write-back is fire-and-forget — if the transaction fails, the evaluation result is still returned.
|
package/docs/llms.txt
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# Valiron
|
|
2
2
|
|
|
3
|
+
## Access and data boundaries
|
|
4
|
+
|
|
5
|
+
Public profile endpoints return identity and trust summaries. They do not return raw behavioral metrics, stored-evidence links, RPC URLs, internal errors, or verification-provider records. Self and World ID responses return an allowlisted verification summary; nullifiers, credential subjects, and provider storage references are private.
|
|
6
|
+
|
|
7
|
+
Sandbox runs require an operator API key. Enriched profiles, the trust-gated proxy, and webhook registration require a Pro operator API key. Webhook deliveries are scoped to the operator that initiated the evaluation and the selected chain. Legacy global evaluation history and platform statistics are restricted to Valiron administrators; use authenticated operator analytics for your own account.
|
|
8
|
+
|
|
9
|
+
The gate also requires agent challenge-response headers (`x-agent-address` plus a valid `x-agent-session`, or a signed fresh challenge). Operator credentials do not replace agent identity. See [authentication](https://www.valiron.co/auth.md).
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
## Valiron Developer Resources
|
|
13
|
+
|
|
14
|
+
- [Valiron developer portal](https://www.valiron.co/developers): REST API, SDK, authentication, webhooks, and MCP setup.
|
|
15
|
+
- [Valiron OpenAPI specification](https://www.valiron.co/openapi.json): Machine-readable public API contract.
|
|
16
|
+
- [Valiron public API discovery](https://www.valiron.co/api): API URLs and integration resources, no authentication required.
|
|
17
|
+
- [Valiron API health](https://www.valiron.co/api/health): Live availability and supported chains, no authentication required.
|
|
18
|
+
- [Valiron authentication](https://www.valiron.co/auth.md): Operator keys and agent identity proofs.
|
|
19
|
+
- [Valiron API and webhook reference](https://www.valiron.co/docs/agents/API-REFERENCE.md): REST endpoints and evaluation-complete webhooks.
|
|
20
|
+
- [Valiron MCP server](https://www.valiron.co/mcp): Streamable HTTP (POST), no API key; public health, agent profiles, and integration docs.
|
|
21
|
+
- [Valiron MCP setup](https://www.valiron.co/docs/agents/MCP.md): Client configuration, tool scope, and transport details.
|
|
22
|
+
|
|
23
|
+
|
|
3
24
|
> Protect your API endpoints from bad or malicious AI agents.
|
|
4
25
|
|
|
5
26
|
Valiron is trust and reputation middleware for API sellers. It evaluates incoming AI agents using on-chain identity (ERC-8004/Solana), key-based identity for local/Web2/non-ERC-8004 agents, behavioral sandbox testing, optional wallet-history intelligence, predictive risk forecasts, and Moody's-style credit ratings (AAA to C). Trustworthy agents get production access. Risky agents are throttled, sandboxed, or blocked — automatically.
|
|
@@ -30,7 +51,7 @@ Returns: { available, wallet, network, provider, score, rawScore, risk, confiden
|
|
|
30
51
|
### Resolve wallet to agent ID
|
|
31
52
|
GET /operator/resolve-wallet/{wallet}?chain={chain}
|
|
32
53
|
Returns: { wallet, agentId, source, chainId?, agentName?, timestamp }
|
|
33
|
-
Resolution
|
|
54
|
+
Resolution returns a registered agent ID when available, or null.
|
|
34
55
|
|
|
35
56
|
### Run sandbox test (on-chain agent)
|
|
36
57
|
POST /operator/trigger-sandbox/{agentId}
|
|
@@ -214,7 +235,7 @@ ethereum, monad, arbitrum, base, avalanche, celo, polygon, linea, abstract, bsc,
|
|
|
214
235
|
|
|
215
236
|
## Plans & Limits
|
|
216
237
|
|
|
217
|
-
Free: 3 gated endpoints, 5 sandbox tests/day. Pro: unlimited endpoints, unlimited sandbox, webhooks, proxy gateway, analytics
|
|
238
|
+
Free: 3 gated endpoints, 5 sandbox tests/day. Pro: unlimited endpoints, unlimited sandbox, webhooks, proxy gateway, analytics and custom tier thresholds. Pro requires operator API key (val_op_ prefix).
|
|
218
239
|
|
|
219
240
|
## Proxy Gateway (Pro)
|
|
220
241
|
|
|
@@ -241,7 +262,7 @@ New key agents are automatically sandbox-evaluated on first gated request. Middl
|
|
|
241
262
|
|
|
242
263
|
## Telemetry
|
|
243
264
|
|
|
244
|
-
Opt-
|
|
265
|
+
Opt-out anonymous client usage reports. Disable with `telemetry: { enabled: false }`. Supports custom sampleRate (0–1) and custom handler function. Environment defaults to recognized NODE_ENV values, otherwise unknown. Signal selections do not measure successful verifications.
|
|
245
266
|
|
|
246
267
|
## Middleware Error Responses
|
|
247
268
|
|
|
@@ -255,7 +276,7 @@ All middleware returns actionable JSON. Use the stable `code` for program logic
|
|
|
255
276
|
- Identity and reputation provided by QuantuLabs (separate from EVM 8004 contracts)
|
|
256
277
|
- Extra reputation fields: trustTier, qualityScore, confidence, riskScore, uniqueCallers
|
|
257
278
|
- Liveness endpoint: GET /operator/agent/{agentId}/liveness?chain=solana
|
|
258
|
-
- Feedback write-back: Valiron scores written on-chain via giveFeedback()
|
|
279
|
+
- Feedback write-back: Valiron scores written on-chain via giveFeedback() when enabled by Valiron
|
|
259
280
|
|
|
260
281
|
## Documentation
|
|
261
282
|
|
|
@@ -324,9 +345,3 @@ GET /operator/analytics/logs?limit=50&offset=0&days=7
|
|
|
324
345
|
|
|
325
346
|
POST /operator/playground
|
|
326
347
|
Body: { "method": "GET", "path": "/api/test", "agentId": "25459", "chain": "ethereum", "dryRun": false, "headers": {}, "body": null }
|
|
327
|
-
|
|
328
|
-
### Admin Endpoints (require role: "admin")
|
|
329
|
-
GET /operator/admin/stats
|
|
330
|
-
GET /operator/admin/operators
|
|
331
|
-
GET /operator/admin/operators/{id}
|
|
332
|
-
GET /operator/admin/operators/{id}/logs
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@valiron/sdk",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Official TypeScript SDK for Valiron
|
|
3
|
+
"version": "1.4.0",
|
|
4
|
+
"description": "Official TypeScript SDK for Valiron \u2014 Trust & Reputation Middleware for API Protection",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/vatsashah45/Valiron.git",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"clean": "node -e \"const fs=require('fs');fs.rmSync('dist',{recursive:true,force:true});\"",
|
|
21
21
|
"build": "pnpm clean && tsc",
|
|
22
22
|
"dev": "tsc --watch",
|
|
23
|
-
"test": "node test/validate.mjs && node test/validate-examples.mjs && node test/validate-middleware.mjs && node test/validate-provider-identity.mjs && tsx test/test-identity.ts",
|
|
23
|
+
"test": "node test/validate-telemetry.mjs && node test/validate.mjs && node test/validate-examples.mjs && node test/validate-middleware.mjs && node test/validate-provider-identity.mjs && node --import tsx test/test-identity.ts",
|
|
24
24
|
"prepublishOnly": "pnpm build"
|
|
25
25
|
},
|
|
26
26
|
"keywords": [
|
|
@@ -46,8 +46,24 @@
|
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
48
|
"files": [
|
|
49
|
-
"dist",
|
|
50
|
-
"
|
|
49
|
+
"dist/clients.js",
|
|
50
|
+
"dist/clients.d.ts",
|
|
51
|
+
"dist/identity.js",
|
|
52
|
+
"dist/identity.d.ts",
|
|
53
|
+
"dist/identityMiddleware.js",
|
|
54
|
+
"dist/identityMiddleware.d.ts",
|
|
55
|
+
"dist/index.js",
|
|
56
|
+
"dist/index.d.ts",
|
|
57
|
+
"dist/middleware.js",
|
|
58
|
+
"dist/middleware.d.ts",
|
|
59
|
+
"dist/operatorSdk.js",
|
|
60
|
+
"dist/operatorSdk.d.ts",
|
|
61
|
+
"dist/telemetry.js",
|
|
62
|
+
"dist/telemetry.d.ts",
|
|
63
|
+
"dist/types.js",
|
|
64
|
+
"dist/types.d.ts",
|
|
65
|
+
"docs/*.md",
|
|
66
|
+
"docs/llms.txt",
|
|
51
67
|
"README.md"
|
|
52
68
|
]
|
|
53
69
|
}
|