@valiron/sdk 1.0.2 → 1.1.1

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/docs/IDENTITY.md CHANGED
@@ -1,6 +1,18 @@
1
- # Identity (ERC-8004)
1
+ # Agent Identity: ERC-8004 and Key-Based Agents
2
2
 
3
- Valiron uses the ERC-8004 standard for on-chain AI agent identity. Each agent is represented by an ERC-721 token in the Identity Registry.
3
+ Valiron supports two identity paths:
4
+
5
+ | Agent type | Use this identifier | Request header | Lookup path |
6
+ |------------|---------------------|----------------|-------------|
7
+ | ERC-8004 / on-chain EVM agent | ERC-8004 token ID | `x-agent-id` | `/operator/agent/:agentId` |
8
+ | Solana 8004 agent | Metaplex Core asset pubkey or indexed ID | `x-agent-id` | `/operator/agent/:agentId?chain=solana` |
9
+ | Local, Web2, or non-ERC-8004 agent | Persistent Ethereum-style agent address | `x-agent-address` | `/operator/key/:agentAddress` |
10
+
11
+ Use `/operator/agent/:agentId` only for registry-backed on-chain agents. Local and Web2 agents should generate or reuse a persistent keypair, prove ownership through Valiron's challenge-response flow, and then use their `x-agent-address` for trust checks.
12
+
13
+ ## ERC-8004 Identity
14
+
15
+ For EVM on-chain agents, Valiron uses the ERC-8004 standard for AI agent identity. Each agent is represented by an ERC-721 token in the Identity Registry.
4
16
 
5
17
  ## How Identity Works
6
18
 
@@ -149,7 +161,7 @@ On-chain reputation contributes to an agent's overall trust evaluation. More fee
149
161
 
150
162
  ## Key-Based Agents (Web2)
151
163
 
152
- Not every agent has an on-chain ERC-8004 identity. For Web2 agents that only have an Ethereum keypair (no minted token), Valiron supports **key-based authentication** using EIP-191 challenge-response.
164
+ Not every agent has an on-chain ERC-8004 identity. For local, Web2, and non-ERC-8004 agents that only have a persistent Ethereum keypair (no minted token), Valiron supports **key-based authentication** using EIP-191 challenge-response.
153
165
 
154
166
  ### How It Works
155
167
 
@@ -160,26 +172,30 @@ Not every agent has an on-chain ERC-8004 identity. For Web2 agents that only hav
160
172
 
161
173
  The SDK and middleware auto-detect key-based agents from the `x-agent-address` header. No configuration needed.
162
174
 
175
+ 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.
176
+
163
177
  ### KeyAgentProfile
164
178
 
165
179
  | Field | Type | Description |
166
180
  |-------|------|-------------|
167
- | `address` | string | Ethereum address |
168
- | `isKeyAgent` | boolean | Always `true` |
169
- | `tier` | string | Trust tier (starts at C, can improve over time) |
170
- | `riskLevel` | string | GREEN / YELLOW / RED |
171
- | `route` | string | Route decision |
172
- | `firstSeen` | string | ISO timestamp of first interaction |
173
- | `totalRequests` | number | Lifetime request count |
181
+ | `agentAddress` | string | Ethereum-style address used as the key-based agent identifier |
182
+ | `verified` | boolean | Whether the agent proved key ownership through challenge-response |
183
+ | `score` | number \| null | Behavioral score once sandbox evaluation has run |
184
+ | `tier` | string \| null | Moody's-style trust tier once scored |
185
+ | `riskLevel` | string \| null | GREEN / YELLOW / RED once scored |
186
+ | `route` | string \| null | Route decision once scored |
187
+ | `icebreaker` | object \| null | Optional ownership context from Icebreaker |
188
+ | `reasons` | string[] | Human-readable trust explanation |
189
+ | `timestamp` | string | ISO timestamp for the profile response |
174
190
 
175
191
  ### Key-Based vs On-Chain Agents
176
192
 
177
193
  | | On-Chain (ERC-8004) | Key-Based |
178
194
  |---|---|---|
179
195
  | Identity source | Minted ERC-721 token | Ethereum address + EIP-191 signature |
180
- | Starting trust | Varies (based on on-chain reputation) | Starts at C tier |
181
- | Trust improvement | Sandbox testing + on-chain feedback | Behavioral history over time |
182
- | World ID linkage | Supported | Supported |
196
+ | Starting trust | Varies (based on on-chain reputation) | Verified identity first, score/tier appear after sandbox evaluation |
197
+ | Trust improvement | Sandbox testing + on-chain feedback | Key-agent sandbox evaluation + behavioral history |
198
+ | World ID linkage | Supported | Not currently supported by key-agent endpoints |
183
199
  | Solana support | Yes (Metaplex Core) | No (EVM only) |
184
200
 
185
201
  ### API Endpoints
@@ -190,7 +206,7 @@ See [API-REFERENCE.md](./API-REFERENCE.md#key-based-agent-endpoints) for the ful
190
206
 
191
207
  ## World ID (Proof-of-Personhood)
192
208
 
193
- World ID verifies that an agent is linked to a real human via Worldcoin's zero-knowledge proof system. This is one of Valiron's four trust signals and provides a strong indicator that an agent is operated by a verified person.
209
+ World ID verifies that an agent is linked to a real human via Worldcoin's zero-knowledge proof system. This is one of Valiron's human identity signals and provides a strong indicator that an agent is operated by a verified person.
194
210
 
195
211
  ### How It Works
196
212
 
@@ -218,6 +234,43 @@ See [API-REFERENCE.md](./API-REFERENCE.md#world-id-endpoints) for the full HTTP
218
234
 
219
235
  ---
220
236
 
237
+ ## Self (Eligible-Human Proof)
238
+
239
+ Self verifies that an agent is linked to a real eligible human through Self Enterprise. Valiron creates a Self verification session, receives Self's signed webhook after completion, stores the verified predicates, and can include the result as the `self` trust signal during scoring.
240
+
241
+ Self Agent ID can be supplied when creating a session. When present and confirmed, Valiron records it as a stronger sub-signal; it is not required for the base Self eligible-human proof.
242
+
243
+ ### How It Works
244
+
245
+ 1. Valiron creates a Self Enterprise session with `createSelfSession()` or `POST /operator/self/session/:agentId`
246
+ 2. The user opens the returned `verificationUrl` and completes the Self flow
247
+ 3. Self sends a signed `verification.completed` webhook to `/operator/self/webhook`
248
+ 4. Valiron verifies the raw webhook body with Self's webhook verifier and stores the Self status
249
+
250
+ ### SDK Methods
251
+
252
+ ```typescript
253
+ // Create a Self verification session
254
+ const session = await valiron.createSelfSession("25459", {
255
+ selfAgentId: "self-agent-...",
256
+ });
257
+
258
+ console.log(session.self.verificationUrl);
259
+
260
+ // Check verification status
261
+ const status = await valiron.getSelfStatus("25459");
262
+ console.log(status.self.verified);
263
+
264
+ // Get full Self profile
265
+ const profile = await valiron.getSelfProfile("25459");
266
+ ```
267
+
268
+ ### API Endpoints
269
+
270
+ See [API-REFERENCE.md](./API-REFERENCE.md#self-endpoints) for the full HTTP API.
271
+
272
+ ---
273
+
221
274
  ## Solana Identity (QuantuLabs 8004-solana)
222
275
 
223
276
  Solana agent identity uses a separate registry operated by [QuantuLabs](https://8004.qnt.sh/) — not the EVM ERC-8004 contracts. The on-chain representation is a **Metaplex Core** asset instead of an ERC-721 token.
@@ -4,9 +4,9 @@
4
4
 
5
5
  ## Prerequisites
6
6
 
7
- 1. **Create an account** on the [Operator Dashboard](./DASHBOARD.md) at [valiron.co/dashboard](https://valiron.co/dashboard)
7
+ 1. **Create an account** on the [Operator Dashboard](./DASHBOARD.md) at [valiron.co/dashboard](https://www.valiron.co/dashboard)
8
8
  2. **Copy your API key** from the Keys page
9
- 3. **Register your endpoints** on the Endpoints page — set path, method, price per call, and rate limits
9
+ 3. Add the SDK middleware below to the backend routes agents call.
10
10
 
11
11
  > **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
12
 
@@ -26,7 +26,7 @@ import { ValironSDK } from "@valiron/sdk";
26
26
  const valiron = new ValironSDK({
27
27
  endpoint: "https://valiron-edge-proxy.onrender.com",
28
28
  chain: "ethereum", // or: monad, arbitrum, base, polygon, solana, etc.
29
- // timeout: 30000, // optional override for all calls
29
+ timeout: 5000,
30
30
  });
31
31
  ```
32
32
 
@@ -39,15 +39,33 @@ No API key is required for read operations.
39
39
 
40
40
  ## Step 3 — Check an agent's trust level
41
41
 
42
- When an agent calls your API, check their trust route:
42
+ First identify which kind of agent is calling your API:
43
+
44
+ | Agent type | Header | SDK/API path |
45
+ |------------|--------|--------------|
46
+ | ERC-8004 / Solana agent | `x-agent-id` | `getAgentProfile()` / `/operator/agent/:agentId` |
47
+ | Local, Web2, or non-ERC-8004 agent | `x-agent-address` | `getKeyAgentProfile()` / `/operator/key/:agentAddress` |
48
+
49
+ Do not pass a local agent name such as `my-agent` to `/operator/agent/:agentId`. That endpoint expects an on-chain ERC-8004 token ID or Solana agent identifier. Non-ERC-8004 agents should use the key-based identity flow from [auth.md](https://www.valiron.co/auth.md).
50
+
51
+ For an on-chain agent, check their trust route:
43
52
 
44
53
  ```typescript
45
54
  const route = await valiron.checkAgent("INCOMING_AGENT_ID");
46
55
  // Returns: "prod" | "prod_throttled" | "sandbox" | "sandbox_only"
47
56
  ```
48
57
 
58
+ For a key-based agent, look up the verified agent address:
59
+
60
+ ```typescript
61
+ const profile = await valiron.getKeyAgentProfile("0xAgentAddress");
62
+ console.log(profile.route); // "prod" | "prod_throttled" | "sandbox" | "sandbox_only"
63
+ ```
64
+
49
65
  ## Step 4 — Get the full trust profile
50
66
 
67
+ For an on-chain agent:
68
+
51
69
  ```typescript
52
70
  const profile = await valiron.getAgentProfile("INCOMING_AGENT_ID");
53
71
 
@@ -56,31 +74,29 @@ console.log(profile.routing.meetsThreshold); // true
56
74
  console.log(profile.onchainReputation.averageScore); // 92.5
57
75
  ```
58
76
 
59
- ## Step 5 — Gate your endpoint (recommended)
60
-
61
- The fastest way to protect your API — add Valiron as Express middleware:
77
+ For a local, Web2, or non-ERC-8004 agent:
62
78
 
63
79
  ```typescript
64
- import { createValironGate } from "@valiron/sdk";
80
+ const profile = await valiron.getKeyAgentProfile("0xAgentAddress");
65
81
 
66
- app.use("/api/paid", createValironGate({ sdk: valiron }));
82
+ console.log(profile.verified); // true
83
+ console.log(profile.score); // 82
84
+ console.log(profile.route); // "prod_throttled"
67
85
  ```
68
86
 
69
- This reads `x-agent-id` from the request header, checks trust via the public agent profile endpoint, and returns 403 for untrusted agents. It's safe with Express 4 (async errors are handled) and includes a 30-second client-side cache for x402 compatibility.
87
+ ## Step 5 — Gate your endpoint (recommended)
70
88
 
71
- You can also choose which trust signals an endpoint uses:
89
+ The fastest way to protect your API — add Valiron as Express middleware:
72
90
 
73
91
  ```typescript
74
- app.use("/api/paid", createValironGate({
75
- sdk: valiron,
76
- trustSignals: ["8004", "sandbox"], // Free
77
- minScore: 70,
78
- }));
92
+ import { createValironGate } from "@valiron/sdk";
93
+
94
+ app.use("/api/paid", createValironGate({ sdk: valiron }));
79
95
  ```
80
96
 
81
- Free plans support `8004` and `sandbox`. Pro plans can also include `world` and `icebreaker`.
97
+ This checks `x-agent-id` first for on-chain agents, then falls back to `x-agent-address` for key-based agents. It returns 403 for untrusted agents, is safe with Express 4 (async errors are handled), and includes a 30-second client-side cache for x402 compatibility.
82
98
 
83
- Or use `getAgentProfile()` directly for custom logic:
99
+ Or use `getAgentProfile()` directly for on-chain custom logic:
84
100
 
85
101
  ```typescript
86
102
  const profile = await valiron.getAgentProfile("INCOMING_AGENT_ID");
@@ -94,6 +110,17 @@ if (finalRoute === "prod" || finalRoute === "prod_throttled") {
94
110
 
95
111
  > **Note**: The `gate()` method calls a protected endpoint that requires agent challenge-response auth. Use the middleware (`createValironGate`) or `getAgentProfile()` for server-side trust checks.
96
112
 
113
+ For key-based agents, use `getKeyAgentProfile()` directly:
114
+
115
+ ```typescript
116
+ const profile = await valiron.getKeyAgentProfile("0xAgentAddress");
117
+ if (profile.verified && (profile.score ?? 0) >= 65) {
118
+ // Serve the request
119
+ } else {
120
+ // Block or ask the agent to complete https://www.valiron.co/auth.md
121
+ }
122
+ ```
123
+
97
124
  ## What happens next?
98
125
 
99
126
  Based on the route decision, your API should:
@@ -147,6 +174,12 @@ Once your integration is live, use the [Operator Dashboard](./DASHBOARD.md) to:
147
174
  # Check an agent's trust profile
148
175
  curl https://valiron-edge-proxy.onrender.com/operator/agent/AGENT_ID
149
176
 
177
+ # Check a key-based agent profile
178
+ curl https://valiron-edge-proxy.onrender.com/operator/key/0x1234...abcd
179
+
180
+ # Get a key-based identity challenge
181
+ curl -X POST https://valiron-edge-proxy.onrender.com/operator/key/0x1234...abcd/challenge
182
+
150
183
  # Trigger sandbox evaluation
151
184
  curl -X POST https://valiron-edge-proxy.onrender.com/operator/trigger-sandbox/AGENT_ID
152
185
 
@@ -165,6 +198,21 @@ curl -X POST https://valiron-edge-proxy.onrender.com/operator/webhooks/register
165
198
  -d '{"event": "evaluation_complete", "url": "https://your-endpoint.com/hooks"}'
166
199
  ```
167
200
 
201
+ ## Separate product — API Scaffolding
202
+
203
+ Valiron middleware is the primary backend integration. API Scaffolding is a separate product for exposing an existing HTTPS API through a Valiron-hosted, agent-facing URL.
204
+
205
+ 1. Open [valiron.co/dashboard](https://www.valiron.co/dashboard).
206
+ 2. Go to **Make API Agent-Ready**.
207
+ 3. Enter your public path, upstream API base URL, price, payment protocol, and optional trust settings.
208
+ 4. Distribute the generated wrapper URL to agent clients:
209
+
210
+ ```text
211
+ https://valiron-edge-proxy.onrender.com/wrap/{operatorId}/{path}
212
+ ```
213
+
214
+ API Scaffolding can collect payment, apply optional trust checks, enforce rate limits, forward upstream, and log usage. For deployments requiring full backend control, protect the API directly with Valiron middleware using `createValironGate()` or `ValironOperator.paywall()`.
215
+
168
216
  ---
169
217
 
170
218
  ## Cleanup (long-running servers)
@@ -183,8 +231,10 @@ process.on("SIGTERM", async () => {
183
231
  ## What's next?
184
232
 
185
233
  - **[Proxy Gateway](./SDK-REFERENCE.md#proxy-gateway-pro)** — Forward requests through Valiron's edge proxy (Pro)
234
+ - **[API Scaffolding](./AGENT-READY-APIS.md)** — Create hosted x402/MPP wrappers for existing APIs
186
235
  - **[Key-Based Agents](./SDK-REFERENCE.md#key-based-agents)** — Support Web2 agents without on-chain identity
187
236
  - **[World ID](./SDK-REFERENCE.md#world-id-methods)** — Verify agent-human linkage
237
+ - **[Self](./SDK-REFERENCE.md#self-methods)** — Create Self Enterprise sessions and verify eligible-human linkage
188
238
  - **[Fastify / Next.js / Hono middleware](./SDK-REFERENCE.md#middleware)** — Framework-specific middleware
189
239
  - **[Plans & Limits](./SDK-REFERENCE.md#plans--limits)** — Free vs Pro feature comparison
190
240
 
package/docs/README.md CHANGED
@@ -4,34 +4,50 @@
4
4
 
5
5
  ## What is Valiron?
6
6
 
7
- Valiron is trust infrastructure for API sellers. It evaluates AI agents using on-chain identity (ERC-8004), behavioral sandbox testing, and a Moody's-style credit rating system — so you can allow trusted agents and block risky ones automatically.
7
+ Valiron is trust infrastructure for API sellers. It evaluates AI agents using on-chain identity (ERC-8004 or Solana), key-based identity for non-ERC-8004 agents, behavioral sandbox testing, and a Moody's-style credit rating system — so you can allow trusted agents and block risky ones automatically.
8
8
 
9
- **If you sell APIs**, Valiron sits in front of your endpoints and evaluates every agent that calls them. Trusted agents (AAA–A) get full production access. Untrusted agents (B–C) are sandboxed or blocked.
9
+ **If you sell APIs**, Valiron's core product is middleware deployed within the API backend through the SDK. It provides direct control over trust checks, routing, sandboxing, payment gating, and analytics before requests reach application handlers.
10
+
11
+ Valiron also provides **API Scaffolding** as a separate product for organizations that require a hosted, agent-facing wrapper URL for an existing HTTPS API. It can add x402/MPP payment challenges, optional trust checks, rate limits, upstream forwarding, and logging without requiring backend code changes. Scaffolding can serve as an evaluation path before adopting a first-party backend integration protected by Valiron middleware.
10
12
 
11
13
  ## Documentation Index
12
14
 
13
15
  | File | Purpose |
14
16
  |------|---------|
15
17
  | [QUICKSTART.md](./QUICKSTART.md) | Get started in under 2 minutes — install the SDK, gate your first endpoint |
18
+ | [AGENT-READY-APIS.md](./AGENT-READY-APIS.md) | API Scaffolding — hosted x402/MPP wrappers for existing APIs |
16
19
  | [DASHBOARD.md](./DASHBOARD.md) | Operator Dashboard — manage endpoints, keys, analytics, and playground |
17
20
  | [API-REFERENCE.md](./API-REFERENCE.md) | Complete HTTP API reference with request/response schemas |
18
21
  | [SDK-REFERENCE.md](./SDK-REFERENCE.md) | TypeScript SDK methods, signatures, and usage examples |
19
22
  | [TRUST-MODEL.md](./TRUST-MODEL.md) | How agents are scored, what behaviors are penalized, tier assignments |
20
- | [IDENTITY.md](./IDENTITY.md) | ERC-8004 on-chain identity — how agents are registered and identified |
23
+ | [IDENTITY.md](./IDENTITY.md) | Agent identity — ERC-8004/Solana agents and key-based Web2 agents |
21
24
  | [SANDBOX.md](./SANDBOX.md) | How the sandbox evaluates agents and determines production readiness |
22
25
  | [CHAINS.md](./CHAINS.md) | Supported blockchain networks and contract addresses |
23
26
  | [ERRORS.md](./ERRORS.md) | Error codes, troubleshooting, and retry guidance |
24
27
 
25
28
  ## Key Concepts (Summary)
26
29
 
27
- - **Agent ID**: An agent's ERC-8004 token ID (EVM) or Metaplex Core asset pubkey (Solana) — their on-chain identity.
30
+ - **Agent ID**: An agent's ERC-8004 token ID (EVM) or Metaplex Core asset pubkey (Solana) — their on-chain identity. Use this with `x-agent-id` and `/operator/agent/:agentId`.
31
+ - **Key-Based Agent Address**: A persistent Ethereum-style address for a local, Web2, or non-ERC-8004 agent. Use this with `x-agent-address` and `/operator/key/:agentAddress`.
28
32
  - **Sequential ID** (Solana only): A convenience integer (1, 2, 42…) assigned by the QuantuLabs indexer. Maps to an asset pubkey.
29
33
  - **Trust Tier**: AAA (highest trust) → C (lowest trust). Assigned based on behavioral evaluation.
30
34
  - **Risk Level**: GREEN, YELLOW, or RED.
31
35
  - **Route Decision**: `prod`, `prod_throttled`, `sandbox`, or `sandbox_only` — determines what access level your API should give.
36
+ - **API Scaffolding**: A separate hosted Valiron wrapper product at `/wrap/{operatorId}/{path}` that can collect x402/MPP payments, optionally gate by trust, and forward to an upstream API.
37
+ - **Payment Protocol**: `x402` for Base/USDC HTTP payments or `mpp` for Machine Payment Protocol payments through Tempo.
32
38
  - **Sandbox**: An isolated test environment where Valiron evaluates agent behavior before granting production access.
33
39
  - **Liveness** (Solana only): Endpoint health probe via `isItAlive()`. See [API-REFERENCE.md](./API-REFERENCE.md#solana-support).
34
40
 
41
+ ## Which Identity Path Should I Use?
42
+
43
+ | Agent type | Use this identifier | Request header | Lookup path |
44
+ |------------|---------------------|----------------|-------------|
45
+ | ERC-8004 / on-chain EVM agent | ERC-8004 token ID | `x-agent-id` | `/operator/agent/:agentId` |
46
+ | Solana 8004 agent | Metaplex Core asset pubkey or indexed ID | `x-agent-id` | `/operator/agent/:agentId?chain=solana` |
47
+ | Local, Web2, or non-ERC-8004 agent | Persistent Ethereum-style agent address | `x-agent-address` | `/operator/key/:agentAddress` |
48
+
49
+ Do not send a local agent name such as `my-agent` to `/operator/agent/:agentId`. That endpoint is for registry-backed on-chain agents. Local and Web2 agents should generate or reuse a persistent keypair, prove ownership through Valiron's challenge-response flow, and then use their `x-agent-address` for trust checks.
50
+
35
51
  ## Supported Registries
36
52
 
37
53
  | Network | Provider | Identity | Reputation |
@@ -360,7 +360,7 @@ import { ValironSDK, createValironGate } from "@valiron/sdk";
360
360
  const gate = createValironGate(config: {
361
361
  sdk: ValironSDK;
362
362
  minScore?: number; // default: 65
363
- trustSignals?: Array<"8004" | "sandbox" | "world" | "icebreaker">;
363
+ trustSignals?: Array<"8004" | "sandbox" | "world" | "self" | "icebreaker">;
364
364
  cacheTtlMs?: number; // default: 30000 (30s client-side cache)
365
365
  extractAgentId?: (req: Request) => string | null;
366
366
  extractAgentAddress?: (req: Request) => string | null;
@@ -480,7 +480,7 @@ The SDK auto-detects key-based agents from the `x-agent-address` header. No conf
480
480
 
481
481
  ### Sandbox Evaluation for Key Agents
482
482
 
483
- New key agents (verified but not yet scored) are automatically evaluated when they first hit a gated endpoint. The middleware triggers `triggerKeyAgentSandbox()` in the background and returns 403 with `retryAfterMs: 30000`. After evaluation completes, the agent receives a trust score and can access endpoints normally.
483
+ New key agents (verified but not yet scored) are automatically evaluated when they first hit a gated endpoint. The middleware triggers `triggerKeyAgentSandbox()` in the background and returns 403 with `retryAfterMs: 30000`. After evaluation completes, the agent receives a trust score; middleware allows the request when `verified === true` and the score meets the endpoint's `minScore`.
484
484
 
485
485
  You can also trigger evaluation manually:
486
486
 
@@ -498,13 +498,15 @@ curl -X POST https://valiron-edge-proxy.onrender.com/operator/trigger-sandbox-ke
498
498
 
499
499
  | Field | Type | Description |
500
500
  |-------|------|-------------|
501
- | `address` | string | Ethereum address |
502
- | `isKeyAgent` | boolean | Always `true` |
503
- | `tier` | string | Trust tier (starts at C, can improve) |
504
- | `riskLevel` | string | GREEN / YELLOW / RED |
505
- | `route` | string | Route decision |
506
- | `firstSeen` | string | ISO timestamp of first interaction |
507
- | `totalRequests` | number | Lifetime request count |
501
+ | `agentAddress` | string | Ethereum-style address used as the key-based agent identifier |
502
+ | `verified` | boolean | Whether the agent proved key ownership through challenge-response |
503
+ | `score` | number \| null | Behavioral score once sandbox evaluation has run |
504
+ | `tier` | string \| null | Moody's-style trust tier once scored |
505
+ | `riskLevel` | string \| null | GREEN / YELLOW / RED once scored |
506
+ | `route` | string \| null | Route decision once scored |
507
+ | `icebreaker` | object \| null | Optional ownership context from Icebreaker |
508
+ | `reasons` | string[] | Human-readable trust explanation |
509
+ | `timestamp` | string | ISO timestamp for the profile response |
508
510
 
509
511
  ---
510
512
 
@@ -555,6 +557,48 @@ const profile = await valiron.getWorldIdProfile(agentId: string, options?: {
555
557
 
556
558
  ---
557
559
 
560
+ ## Self Methods
561
+
562
+ Self provides eligible-human verification from government ID credentials and can optionally bind that verified human to Self Agent ID. Valiron stores the verified Self predicates as the selectable `self` trust signal.
563
+
564
+ ### createSelfSession(agentId, request, options?)
565
+
566
+ Create a Self Enterprise verification session for an agent. Redirect the user to the returned `verificationUrl`; Self will call Valiron's signed webhook after completion.
567
+
568
+ ```typescript
569
+ const session = await valiron.createSelfSession("25459", {
570
+ selfAgentId: "self-agent-...",
571
+ successUrl: "https://example.com/verified",
572
+ failureUrl: "https://example.com/failed",
573
+ });
574
+ console.log(session.self.verificationUrl);
575
+ ```
576
+
577
+ ### getSelfStatus(agentId, options?)
578
+
579
+ Check if an agent has a verified Self human eligibility link.
580
+
581
+ ```typescript
582
+ const { self } = await valiron.getSelfStatus("25459");
583
+ console.log(self.verified, self.selfAgentLinked);
584
+ ```
585
+
586
+ ### getSelfProfile(agentId, options?)
587
+
588
+ Get the full Self eligible-human / Agent ID profile.
589
+
590
+ ```typescript
591
+ const profile = await valiron.getSelfProfile("25459");
592
+ console.log(profile.humanTrust.hasEligibleHuman);
593
+ console.log(profile.humanTrust.hasAgentBinding);
594
+ ```
595
+
596
+ ### verifySelf(agentId, proof, options?)
597
+
598
+ Trusted-payload ingestion for local/internal tests only. Production integrations should use `createSelfSession()` plus Self's signed webhook.
599
+
600
+ ---
601
+
558
602
  ## Telemetry
559
603
 
560
604
  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.
@@ -29,6 +29,7 @@ Supported signals:
29
29
  | `8004` | ERC-8004 / Solana on-chain reputation | Free |
30
30
  | `sandbox` | Valiron behavioral sandbox score | Free |
31
31
  | `world` | World ID human-agent link | Pro |
32
+ | `self` | Self eligible-human proof and optional Self Agent ID link | Pro |
32
33
  | `icebreaker` | Icebreaker human/background attestation | Pro |
33
34
 
34
35
  When multiple signals are selected, Valiron computes each signal on a `0-100` scale and normalizes the configured weights across only those selected signals. The default weights are:
@@ -38,6 +39,7 @@ When multiple signals are selected, Valiron computes each signal on a `0-100` sc
38
39
  | `sandbox` | 55 |
39
40
  | `8004` | 25 |
40
41
  | `world` | 15 |
42
+ | `self` | 15 |
41
43
  | `icebreaker` | 5 |
42
44
 
43
45
  If no signals are specified, Valiron uses the plug-and-play default: sandbox plus any other available trust signals.
@@ -50,6 +52,26 @@ Valiron evaluates agents across multiple behavioral dimensions. The behavioral e
50
52
 
51
53
  Agents that demonstrate responsible API usage patterns will earn the highest trust tiers. The specific behaviors that contribute to trust scoring are proprietary. In general, agents that are well-behaved, respect API boundaries, and handle errors gracefully will score highly.
52
54
 
55
+ ## Predictive Risk
56
+
57
+ Valiron also computes an explainable forecast for agents with enough observed history. Predictive risk does not replace the trust gate; it helps operators decide what should happen before the next sensitive action.
58
+
59
+ The forecast combines:
60
+
61
+ - Recent sandbox evaluation scores, route decisions, and score trend
62
+ - Recurring behavioral failures such as rate-limit disrespect, loops, high error rate, and burstiness
63
+ - Behavioral fingerprints such as request cadence, backoff pattern, protocol mix, and error-response pattern
64
+ - Recent operator call logs including production error rate and latency
65
+
66
+ The output includes `predictedNextScore`, `passProbability`, `riskDirection`, `confidence`, `recommendedPolicy`, `recommendedTests`, and human-readable reasons. A low-confidence forecast means Valiron has sparse evidence; it should be treated as a prompt to run another sandbox evaluation rather than a final judgment.
67
+
68
+ Fetch it with:
69
+
70
+ ```bash
71
+ curl -H "Authorization: Bearer YOUR_JWT" \
72
+ https://valiron-edge-proxy.onrender.com/operator/analytics/agents/AGENT_ID/prediction
73
+ ```
74
+
53
75
  ## Checking an Agent's Trust Status
54
76
 
55
77
  ```typescript