@valiron/sdk 1.0.1 → 1.1.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 -2
- package/dist/clients.d.ts +40 -1
- package/dist/clients.js +69 -6
- package/dist/index.d.ts +50 -1
- package/dist/index.js +51 -0
- package/dist/middleware.d.ts +9 -1
- package/dist/middleware.js +228 -9
- package/dist/operatorSdk.d.ts +11 -1
- package/dist/operatorSdk.js +152 -3
- package/dist/telemetry.js +1 -1
- package/dist/types.d.ts +101 -2
- package/docs/AGENT-READY-APIS.md +417 -0
- package/docs/API-REFERENCE.md +208 -26
- package/docs/DASHBOARD.md +107 -28
- package/docs/ERRORS.md +12 -2
- package/docs/IDENTITY.md +67 -14
- package/docs/QUICKSTART.md +67 -5
- package/docs/README.md +20 -4
- package/docs/SDK-REFERENCE.md +58 -12
- package/docs/TRUST-MODEL.md +38 -4
- package/docs/llms.txt +119 -7
- package/package.json +2 -2
package/docs/IDENTITY.md
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
|
-
# Identity
|
|
1
|
+
# Agent Identity: ERC-8004 and Key-Based Agents
|
|
2
2
|
|
|
3
|
-
Valiron
|
|
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
|
|
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
|
-
| `
|
|
168
|
-
| `
|
|
169
|
-
| `
|
|
170
|
-
| `
|
|
171
|
-
| `
|
|
172
|
-
| `
|
|
173
|
-
| `
|
|
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) |
|
|
181
|
-
| Trust improvement | Sandbox testing + on-chain feedback |
|
|
182
|
-
| World ID linkage | 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
|
|
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.
|
package/docs/QUICKSTART.md
CHANGED
|
@@ -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.
|
|
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
|
|
|
@@ -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
|
-
|
|
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,6 +74,16 @@ console.log(profile.routing.meetsThreshold); // true
|
|
|
56
74
|
console.log(profile.onchainReputation.averageScore); // 92.5
|
|
57
75
|
```
|
|
58
76
|
|
|
77
|
+
For a local, Web2, or non-ERC-8004 agent:
|
|
78
|
+
|
|
79
|
+
```typescript
|
|
80
|
+
const profile = await valiron.getKeyAgentProfile("0xAgentAddress");
|
|
81
|
+
|
|
82
|
+
console.log(profile.verified); // true
|
|
83
|
+
console.log(profile.score); // 82
|
|
84
|
+
console.log(profile.route); // "prod_throttled"
|
|
85
|
+
```
|
|
86
|
+
|
|
59
87
|
## Step 5 — Gate your endpoint (recommended)
|
|
60
88
|
|
|
61
89
|
The fastest way to protect your API — add Valiron as Express middleware:
|
|
@@ -66,9 +94,9 @@ import { createValironGate } from "@valiron/sdk";
|
|
|
66
94
|
app.use("/api/paid", createValironGate({ sdk: valiron }));
|
|
67
95
|
```
|
|
68
96
|
|
|
69
|
-
This
|
|
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.
|
|
70
98
|
|
|
71
|
-
Or use `getAgentProfile()` directly for custom logic:
|
|
99
|
+
Or use `getAgentProfile()` directly for on-chain custom logic:
|
|
72
100
|
|
|
73
101
|
```typescript
|
|
74
102
|
const profile = await valiron.getAgentProfile("INCOMING_AGENT_ID");
|
|
@@ -82,6 +110,17 @@ if (finalRoute === "prod" || finalRoute === "prod_throttled") {
|
|
|
82
110
|
|
|
83
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.
|
|
84
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
|
+
|
|
85
124
|
## What happens next?
|
|
86
125
|
|
|
87
126
|
Based on the route decision, your API should:
|
|
@@ -135,6 +174,12 @@ Once your integration is live, use the [Operator Dashboard](./DASHBOARD.md) to:
|
|
|
135
174
|
# Check an agent's trust profile
|
|
136
175
|
curl https://valiron-edge-proxy.onrender.com/operator/agent/AGENT_ID
|
|
137
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
|
+
|
|
138
183
|
# Trigger sandbox evaluation
|
|
139
184
|
curl -X POST https://valiron-edge-proxy.onrender.com/operator/trigger-sandbox/AGENT_ID
|
|
140
185
|
|
|
@@ -153,6 +198,21 @@ curl -X POST https://valiron-edge-proxy.onrender.com/operator/webhooks/register
|
|
|
153
198
|
-d '{"event": "evaluation_complete", "url": "https://your-endpoint.com/hooks"}'
|
|
154
199
|
```
|
|
155
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
|
+
|
|
156
216
|
---
|
|
157
217
|
|
|
158
218
|
## Cleanup (long-running servers)
|
|
@@ -171,8 +231,10 @@ process.on("SIGTERM", async () => {
|
|
|
171
231
|
## What's next?
|
|
172
232
|
|
|
173
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
|
|
174
235
|
- **[Key-Based Agents](./SDK-REFERENCE.md#key-based-agents)** — Support Web2 agents without on-chain identity
|
|
175
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
|
|
176
238
|
- **[Fastify / Next.js / Hono middleware](./SDK-REFERENCE.md#middleware)** — Framework-specific middleware
|
|
177
239
|
- **[Plans & Limits](./SDK-REFERENCE.md#plans--limits)** — Free vs Pro feature comparison
|
|
178
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
|
|
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) |
|
|
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 |
|
package/docs/SDK-REFERENCE.md
CHANGED
|
@@ -25,7 +25,7 @@ const valiron = new ValironSDK(config?: ValironConfig);
|
|
|
25
25
|
| `apiKey` | string | — | API key (optional for read operations) |
|
|
26
26
|
| `endpoint` | string | `https://valiron-edge-proxy.onrender.com` | API base URL |
|
|
27
27
|
| `chain` | SupportedChain | `"ethereum"` | Default blockchain network |
|
|
28
|
-
| `timeout` | number |
|
|
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. |
|
|
29
29
|
| `debug` | boolean | `false` | Enable debug logging |
|
|
30
30
|
| `telemetry` | TelemetryConfig | — | Optional telemetry configuration |
|
|
31
31
|
|
|
@@ -360,6 +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" | "self" | "icebreaker">;
|
|
363
364
|
cacheTtlMs?: number; // default: 30000 (30s client-side cache)
|
|
364
365
|
extractAgentId?: (req: Request) => string | null;
|
|
365
366
|
extractAgentAddress?: (req: Request) => string | null;
|
|
@@ -386,6 +387,7 @@ app.use("/api/paid", createValironGate({ sdk: valiron }));
|
|
|
386
387
|
app.use("/api/premium", createValironGate({
|
|
387
388
|
sdk: valiron,
|
|
388
389
|
minScore: 85,
|
|
390
|
+
trustSignals: ["8004", "sandbox"],
|
|
389
391
|
cacheTtlMs: 60_000, // 60s
|
|
390
392
|
}));
|
|
391
393
|
|
|
@@ -478,7 +480,7 @@ The SDK auto-detects key-based agents from the `x-agent-address` header. No conf
|
|
|
478
480
|
|
|
479
481
|
### Sandbox Evaluation for Key Agents
|
|
480
482
|
|
|
481
|
-
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
|
|
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`.
|
|
482
484
|
|
|
483
485
|
You can also trigger evaluation manually:
|
|
484
486
|
|
|
@@ -496,13 +498,15 @@ curl -X POST https://valiron-edge-proxy.onrender.com/operator/trigger-sandbox-ke
|
|
|
496
498
|
|
|
497
499
|
| Field | Type | Description |
|
|
498
500
|
|-------|------|-------------|
|
|
499
|
-
| `
|
|
500
|
-
| `
|
|
501
|
-
| `
|
|
502
|
-
| `
|
|
503
|
-
| `
|
|
504
|
-
| `
|
|
505
|
-
| `
|
|
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 |
|
|
506
510
|
|
|
507
511
|
---
|
|
508
512
|
|
|
@@ -553,9 +557,51 @@ const profile = await valiron.getWorldIdProfile(agentId: string, options?: {
|
|
|
553
557
|
|
|
554
558
|
---
|
|
555
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
|
+
|
|
556
602
|
## Telemetry
|
|
557
603
|
|
|
558
|
-
The SDK
|
|
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.
|
|
559
605
|
|
|
560
606
|
### TelemetryConfig
|
|
561
607
|
|
|
@@ -563,7 +609,7 @@ The SDK optionally collects anonymous usage metrics (gate calls, latency, error
|
|
|
563
609
|
|-------|------|---------|-------------|
|
|
564
610
|
| `enabled` | boolean | `true` | Enable/disable telemetry |
|
|
565
611
|
| `sampleRate` | number | `1.0` | Fraction of events to sample (0–1) |
|
|
566
|
-
| `
|
|
612
|
+
| `onEvent` | function | — | Custom event handler |
|
|
567
613
|
|
|
568
614
|
**Example**:
|
|
569
615
|
```typescript
|
|
@@ -577,7 +623,7 @@ const valiron = new ValironSDK({
|
|
|
577
623
|
const valiron = new ValironSDK({
|
|
578
624
|
telemetry: {
|
|
579
625
|
sampleRate: 0.1, // Sample 10% of events
|
|
580
|
-
|
|
626
|
+
onEvent: (event) => { // Custom handler
|
|
581
627
|
myAnalytics.track(event);
|
|
582
628
|
},
|
|
583
629
|
},
|
package/docs/TRUST-MODEL.md
CHANGED
|
@@ -4,7 +4,7 @@ Valiron uses a hybrid trust model to evaluate AI agents hitting your API. This d
|
|
|
4
4
|
|
|
5
5
|
## Trust Tiers
|
|
6
6
|
|
|
7
|
-
Valiron assigns a Moody's-style credit tier
|
|
7
|
+
Valiron assigns a Moody's-style credit tier from a normalized `0-100` trust score:
|
|
8
8
|
|
|
9
9
|
| Tier | Meaning | Route Decision |
|
|
10
10
|
|------|---------|----------------|
|
|
@@ -18,11 +18,35 @@ Valiron assigns a Moody's-style credit tier based on an agent's behavioral evalu
|
|
|
18
18
|
| CA | Extremely speculative | `sandbox_only` |
|
|
19
19
|
| C | Default risk | `sandbox_only` |
|
|
20
20
|
|
|
21
|
-
##
|
|
21
|
+
## Selectable Trust Signals
|
|
22
|
+
|
|
23
|
+
API sellers can use Valiron plug-and-play, or choose the trust signals used for a specific endpoint.
|
|
24
|
+
|
|
25
|
+
Supported signals:
|
|
26
|
+
|
|
27
|
+
| Signal | Description | Plan |
|
|
28
|
+
|--------|-------------|------|
|
|
29
|
+
| `8004` | ERC-8004 / Solana on-chain reputation | Free |
|
|
30
|
+
| `sandbox` | Valiron behavioral sandbox score | Free |
|
|
31
|
+
| `world` | World ID human-agent link | Pro |
|
|
32
|
+
| `self` | Self eligible-human proof and optional Self Agent ID link | Pro |
|
|
33
|
+
| `icebreaker` | Icebreaker human/background attestation | Pro |
|
|
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:
|
|
36
|
+
|
|
37
|
+
| Signal | Default Weight |
|
|
38
|
+
|--------|----------------|
|
|
39
|
+
| `sandbox` | 55 |
|
|
40
|
+
| `8004` | 25 |
|
|
41
|
+
| `world` | 15 |
|
|
42
|
+
| `self` | 15 |
|
|
43
|
+
| `icebreaker` | 5 |
|
|
22
44
|
|
|
23
|
-
|
|
45
|
+
If no signals are specified, Valiron uses the plug-and-play default: sandbox plus any other available trust signals.
|
|
24
46
|
|
|
25
|
-
|
|
47
|
+
## Behavioral Factors
|
|
48
|
+
|
|
49
|
+
Valiron evaluates agents across multiple behavioral dimensions. The behavioral evaluation is holistic — no single sandbox behavior determines the outcome. The specific factors evaluated and their weights are proprietary and not disclosed.
|
|
26
50
|
|
|
27
51
|
## What Makes an Agent Trustworthy
|
|
28
52
|
|
|
@@ -47,6 +71,16 @@ Or via HTTP:
|
|
|
47
71
|
curl -X POST https://valiron-edge-proxy.onrender.com/operator/trigger-sandbox/AGENT_ID
|
|
48
72
|
```
|
|
49
73
|
|
|
74
|
+
Use selected signals in middleware:
|
|
75
|
+
|
|
76
|
+
```typescript
|
|
77
|
+
app.use("/api/paid", createValironGate({
|
|
78
|
+
sdk: valiron,
|
|
79
|
+
trustSignals: ["8004", "sandbox"],
|
|
80
|
+
minScore: 70,
|
|
81
|
+
}));
|
|
82
|
+
```
|
|
83
|
+
|
|
50
84
|
---
|
|
51
85
|
|
|
52
86
|
## Solana Trust Evaluation
|