@valiron/sdk 1.3.1 → 2.0.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.
@@ -1,5 +1,7 @@
1
1
  # End-to-End Valiron Middleware Integration
2
2
 
3
+ > **Request verification:** Examples using `verifyAgentRequest` assume an application-owned verifier imported from your own module, not an SDK export. It must verify a fresh signature against the claimed identity, bind method, full URL and body, and atomically reject replayed nonces. See the [request-proof upgrade guide](https://www.valiron.co/docs/agents/SECURITY-UPGRADE-2026-10-31.md). Missing or invalid proofs return 401 before profile-cache lookup.
4
+
3
5
  This guide helps API teams integrate Valiron middleware from the first incoming
4
6
  agent request through the downstream action they want to take. Start with the
5
7
  agent identity, choose the trust signals that match your policy, then use the
@@ -18,8 +20,8 @@ Incoming request
18
20
  ## Before you start
19
21
 
20
22
  1. Create an operator account in the [Dashboard](./DASHBOARD.md).
21
- 2. Copy an operator API key (`val_op_...`) if you will use Pro trust signals,
22
- operator usage logging, or hosted products.
23
+ 2. Copy an operator API key (`val_op_...`) for profile reads, gates, sandbox runs,
24
+ operator usage logging, or hosted products on Free or paid plans.
23
25
  3. Install the SDK:
24
26
 
25
27
  ```bash
@@ -65,10 +67,10 @@ protecting.
65
67
  | --- | --- | --- |
66
68
  | `8004` | Registry-backed on-chain identity and reputation | All plans |
67
69
  | `sandbox` | Behavioral evaluation and route readiness | All plans |
68
- | `world` | World ID proof-of-personhood linkage | Pro |
69
- | `self` | Self eligible-human verification | Pro |
70
+ | `world` | World ID proof-of-personhood linkage | Free |
71
+ | `self` | Self eligible-human verification | Free |
70
72
  | `icebreaker` | Human-to-agent attestation | Pro |
71
- | `wallet` | Explainable wallet-history risk, confidence, and hard flags | Pro |
73
+ | `wallet` | Explainable wallet-history risk, confidence, and hard flags | Free |
72
74
 
73
75
  For example, a high-value endpoint might require on-chain reputation,
74
76
  behavioral evidence, and wallet intelligence:
@@ -82,6 +84,7 @@ const valiron = new ValironSDK({
82
84
  });
83
85
 
84
86
  const trustGate = createValironGate({
87
+ verifyRequest: verifyAgentRequest,
85
88
  sdk: valiron,
86
89
  trustSignals: ["8004", "sandbox", "wallet"],
87
90
  minScore: 80,
@@ -108,8 +111,8 @@ Choose the behavior that fits the endpoint:
108
111
  | Trust-aware pricing | Read the result in your handler and apply your own price or entitlement policy |
109
112
  | Monetized endpoint logging | Use `ValironOperator.paywall()` to gate access, attach a configured per-call price, and record usage |
110
113
  | Agent profile lookup | Retrieve a profile when your product needs to display or review trust evidence |
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 and evaluation history |
114
+ | Predictive risk | Use dashboard forecasts as an additional operational signal; do not replace the runtime gate with a forecast |
115
+ | Audit and operations | Capture the result in your logs or use authenticated dashboard call logs |
113
116
 
114
117
  Valiron does not itself settle a payment or choose a dynamic price table. It
115
118
  provides the verified trust context that your payment and application policy
@@ -117,7 +120,9 @@ can use.
117
120
 
118
121
  ## 4. Put the gate in front of your handler
119
122
 
120
- Here is a complete Express example that supports both agent identity paths and
123
+ Import `verifyAgentRequest` from your application-owned signature verifier. It must bind the identity, method, full URL and body, enforce freshness, and atomically claim nonces before returning true; see the [upgrade guide](./SECURITY-UPGRADE-2026-10-31.md).
124
+
125
+ Here is an Express example that supports both agent identity paths and
121
126
  uses the route decision for graduated access:
122
127
 
123
128
  ```typescript
@@ -131,6 +136,7 @@ const valiron = new ValironSDK({
131
136
  });
132
137
 
133
138
  app.use("/api/research", createValironGate({
139
+ verifyRequest: verifyAgentRequest,
134
140
  sdk: valiron,
135
141
  trustSignals: ["8004", "sandbox", "wallet"],
136
142
  minScore: 65,
@@ -147,9 +153,8 @@ app.get("/api/research", (req, res) => {
147
153
  res.set("X-Rate-Limit-Policy", "reduced");
148
154
  }
149
155
 
150
- if (trust.route === "sandbox") {
151
- return res.json({ mode: "sandbox", results: [] });
152
- }
156
+ // Denied and pending agents never reach this handler. Use a separate,
157
+ // explicitly scoped route if your product offers sandbox data.
153
158
 
154
159
  return res.json({
155
160
  mode: "production",
@@ -182,6 +187,7 @@ const operator = new ValironOperator({
182
187
  });
183
188
 
184
189
  app.use("/api/premium", operator.paywall({
190
+ verifyRequest: verifyAgentRequest,
185
191
  pricePerCall: 0.05,
186
192
  minTrustScore: 65,
187
193
  trustSignals: ["8004", "sandbox", "wallet"],
@@ -197,9 +203,9 @@ to reach it.
197
203
 
198
204
  Test each case before production:
199
205
 
200
- 1. A registered agent using `x-agent-id`.
201
- 2. A verified key-based agent using `x-agent-address`.
202
- 3. A request without either identity header.
206
+ 1. A registered agent using `x-agent-id` plus a fresh valid request proof.
207
+ 2. An enrolled key-based agent using `x-agent-address` plus a fresh valid request proof.
208
+ 3. Missing headers, a forged identity claim, a replayed nonce and a signature for a different method/URL/body; all must deny access.
203
209
  4. An agent below your `minScore`.
204
210
  5. A new agent pending sandbox evaluation.
205
211
  6. A production-eligible agent on every protected route.
package/docs/ERRORS.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  Common error scenarios, status codes, and guidance on how to handle them.
4
4
 
5
+ The separate Crawler Protection product uses `AdmissionError` and adapter codes `CRAWLER_LIMIT` (429), `CRAWLER_UNAVAILABLE` (503), and `CRAWLER_BLOCK` (403 for an enforced crawler deny rule or application-defined block). These are not `ValironError` failures from `@valiron/sdk`. See [crawler decisions and recovery](./CRAWLER-PROTECTION.md#decisions-and-recovery); rate/capacity rejections must not execute protected work. The standalone gateway adds proxy errors such as 413 for oversized requests, 503 for exhausted origin capacity and 504 for an origin timeout. The private work API uses 401/403 for service/capability failures and 503 for unavailable work. Do not automatically retry an ambiguous acquisition or release capacity because an HTTP timeout elapsed; query settlement must be confirmed.
6
+
5
7
  ## Read an error before retrying
6
8
 
7
9
  Every SDK failure is a `ValironError`. Its stable `code` is for program logic; its `message` is safe to show in developer logs; and `details` provides the recovery information that was available from the API.
@@ -61,7 +63,7 @@ The SDK throws typed errors that you can catch:
61
63
  ```typescript
62
64
  import { ValironSDK } from "@valiron/sdk";
63
65
 
64
- const valiron = new ValironSDK();
66
+ const valiron = new ValironSDK({ apiKey: process.env.VALIRON_API_KEY });
65
67
 
66
68
  try {
67
69
  const profile = await valiron.getAgentProfile("99999");
@@ -128,14 +130,14 @@ await valiron.triggerSandboxTest("YOUR_AGENT_ID");
128
130
 
129
131
  ### Provisional scores
130
132
 
131
- First-time agents that haven't been sandbox-tested yet receive provisional scores. Provisional evaluations use a higher trust threshold — meaning the agent must prove itself more thoroughly on its first interaction. After the first sandbox run completes, future gate() calls use the standard threshold.
133
+ New agents remain denied while their real sandbox evaluation is pending. Provisional or synthetic scores cannot authorize production access and cannot overwrite definitive evaluation results. Retry with the same identity and a fresh request proof after the indicated delay.
132
134
 
133
135
  ### Timeout errors
134
136
 
135
137
  The SDK uses method-aware default timeouts: 10 seconds generally, 15 seconds for `gate()`/`proxy()`, and 30 seconds for sandbox triggers. To force a single timeout for all calls, configure it explicitly:
136
138
 
137
139
  ```typescript
138
- const valiron = new ValironSDK({ timeout: 30000 }); // 30 seconds
140
+ const valiron = new ValironSDK({ apiKey: process.env.VALIRON_API_KEY, timeout: 30000 }); // 30 seconds
139
141
  ```
140
142
 
141
143
  ### Chain mismatch
@@ -143,7 +145,7 @@ const valiron = new ValironSDK({ timeout: 30000 }); // 30 seconds
143
145
  If the agent is registered on Monad but you query Ethereum (the default), it will return 404. Always specify the correct chain:
144
146
 
145
147
  ```typescript
146
- const valiron = new ValironSDK({ chain: "monad" });
148
+ const valiron = new ValironSDK({ apiKey: process.env.VALIRON_API_KEY, chain: "monad" });
147
149
  ```
148
150
 
149
151
  ### Wallet intelligence unavailable
@@ -157,15 +159,17 @@ const valiron = new ValironSDK({ chain: "monad" });
157
159
 
158
160
  Unavailable wallet intelligence is excluded from profile and gate composite scoring. Retry provider failures according to your policy; do not reinterpret an unavailable assessment as malicious activity.
159
161
 
160
- ### Wallet intelligence requires Pro
162
+ ### Social Graph requires Pro
163
+
164
+ Wallet intelligence is included with Free, but requires an authenticated operator key. Missing or invalid credentials return HTTP 401 before provider work.
161
165
 
162
- Direct wallet-risk requests and policies containing `trustSignals: ["wallet"]` require a valid Pro or Enterprise operator key. A Free or unauthenticated request returns:
166
+ Policies containing `trustSignals: ["icebreaker"]` require Pro or Enterprise. An authenticated Free request returns HTTP 403:
163
167
 
164
168
  ```json
165
169
  {
166
170
  "error": "upgrade_required",
167
- "feature": "enriched_profiles",
168
- "message": "World ID, Self, Icebreaker, and wallet intelligence signals require a Pro plan. Free plans can use ERC-8004 and sandbox signals."
171
+ "feature": "social_graph",
172
+ "message": "Social Graph (Icebreaker) requires a Pro plan. ERC-8004, sandbox, World ID, Self, and wallet intelligence are included with Free."
169
173
  }
170
174
  ```
171
175
 
@@ -199,7 +203,7 @@ The `GET /operator/agent/:agentId/liveness?chain=solana` endpoint probes each se
199
203
 
200
204
  ### Feedback write-back errors
201
205
 
202
- If `SOLANA_FEEDBACK_KEYPAIR` is not set or the keypair has insufficient SOL balance, feedback write-back fails silently (fire-and-forget). Check edge-proxy logs for `solana feedback error` messages.
206
+ If on-chain feedback is unavailable, the evaluation result is still returned. Contact Valiron support if feedback remains unavailable.
203
207
 
204
208
  ### Solana RPC rate limits
205
209
 
@@ -218,11 +222,12 @@ All Valiron middleware (Express, Fastify, Next.js, generic) returns consistent e
218
222
  | Status | Code | When | What to do |
219
223
  |--------|------|------|
220
224
  | 401 | `MISSING_AGENT_IDENTITY` | No identity header | Send one supported identity header: `x-agent-id` or `x-agent-address` |
225
+ | 401 | `AGENT_OWNERSHIP_REQUIRED` | Missing verifier, invalid owner proof, stale timestamp, wrong request binding or replay | Configure the verifier/signer; generate a fresh nonce and sign the actual identity, chain, method, URL and body |
221
226
  | 403 | `TRUST_GATE_DENIED` | Agent did not meet the configured policy | Inspect `score`, `tier`, `route`, and `reasons`; do not blindly retry |
222
227
  | 403 | `AGENT_EVALUATION_PENDING` | New identity is sandbox-evaluating | Keep the same identity and retry after `retryAfterMs` |
223
228
  | 503 | `TRUST_GATE_UNAVAILABLE` | Trust evaluation could not complete | Fail closed; retry shortly and inspect the logged `cause` |
224
229
 
225
- Each response includes `message`, `action`, and `docsUrl`; denials retain the trust result fields so an application can make a deliberate fallback decision.
230
+ Standard missing-identity, trust-denial, pending and unavailable responses include recovery fields such as `message`, `action`, and `docsUrl`. Ownership-proof rejections may contain only `code` and `error`; handle the stable code without assuming those optional fields exist.
226
231
 
227
232
  > **Fail-closed:** When the Valiron service is unreachable, middleware returns 503 — it never fails open and never allows unverified agents through.
228
233
 
@@ -241,8 +246,8 @@ its exact bytes. `IDENTITY_GATE_UNAVAILABLE` is a fail-closed HTTP 503.
241
246
  | Failure reason | Meaning | Action |
242
247
  | --- | --- | --- |
243
248
  | `provider_missing` | An agent ID was supplied without a provider | Send the resolver provider name |
244
- | `resolver_unavailable` | No adapter is registered for the provider | For ANS, configure credentials and a trusted CA bundle; never treat the claim as verified |
245
- | `proof_incomplete` | Signature, timestamp, nonce, or digest is missing | Construct and sign the complete proof |
249
+ | `resolver_unavailable` | No adapter is registered for the provider | For hosted ANS, retry or contact support; never treat an unavailable resolver as verified |
250
+ | `proof_incomplete` | Signature, timestamp, nonce, digest, audience, method or URL is missing | Construct and sign the complete proof |
246
251
  | `request_digest_invalid` | Digest is not `sha256:` plus 64 hex characters | Recalculate and format the SHA-256 digest |
247
252
  | `nonce_invalid` | Nonce is shorter than 16 characters or contains unsupported characters | Generate a 16–256 character URL-safe nonce |
248
253
  | `timestamp_invalid` | Timestamp cannot be parsed | Send an ISO-8601 timestamp |
@@ -291,16 +296,30 @@ store or other safe-verification failure returns HTTP 503 with
291
296
 
292
297
  | Status | When | Action |
293
298
  |--------|------|--------|
294
- | 400 | Invalid or malformed proof | Verify your World ID proof payload fields |
295
- | 404 | Agent has no World ID verification | The agent hasn't completed World ID verification yet |
296
- | 409 | Nullifier hash already used | This World ID proof has already been submitted |
299
+ | 401 | Missing operator credentials or owner proof | Authenticate the operator and sign this exact enrollment request |
300
+ | 400 | Missing/unsupported IDKit result, failed server verification or proof bound to another agent | Submit the complete production result for the configured action; partial proofs and caller-selected strength are insufficient |
301
+ | 404 | Agent not found on-chain | Use an existing registry agent; an unverified status lookup normally returns `verified: false` |
297
302
 
298
303
  ## Self Errors
299
304
 
305
+ Session creation requires an operator key and fresh owner signature. Missing/invalid ownership returns 401; an unsupported return origin returns 400. Older sessions without owner-verification provenance cannot establish a new trusted link.
306
+
300
307
  | Status | When | Action |
301
308
  |--------|------|--------|
302
- | 400 | Raw webhook body unavailable or Self webhook signature invalid | Configure Self to call `/operator/self/webhook` and keep the endpoint's `whsec_...` value in `SELF_TEST_WEBHOOK_SECRET` or `SELF_LIVE_WEBHOOK_SECRET` |
309
+ | 400 | Raw webhook body unavailable or Self webhook signature invalid | Valiron manages the provider callback. Check session status and contact support if verification remains pending after completing the Self flow |
303
310
  | 400 | Self webhook cannot be mapped to a Valiron session | Create sessions through `createSelfSession()` or `POST /operator/self/session/:agentId` so `externalUuid` is stored before the webhook arrives |
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 |
311
+ | 403 | Trusted Self payload ingestion is disabled | Use `createSelfSession()` and check `getSelfStatus()`; direct proof ingestion is not supported for hosted customer integrations |
305
312
  | 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
313
  | 409 | Agent already has a verified Self link | Self links are immutable once verified |
314
+
315
+ ## Monthly request allowance
316
+
317
+ `429 MONTHLY_REQUEST_LIMIT_EXCEEDED` means the account has used its monthly
318
+ allowance (10,000 on Free or 100,000 on Pro) for the UTC calendar month.
319
+ Agent and bot protection allowances are separate. Upgrade Free to Pro, email
320
+ founders@valiron.co for Enterprise, or wait until `resetsAt`; use `Retry-After` rather than retrying continuously. This allowance
321
+ is shared across API keys and hosted endpoints.
322
+
323
+ `503 MONTHLY_USAGE_UNAVAILABLE` means request usage could not be checked.
324
+ Retry after the response's `Retry-After` delay. No work is admitted without
325
+ a successful usage check.
package/docs/IDENTITY.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Agent Identity: On-Chain, Key-Based, and Provider-Backed Agents
2
2
 
3
+ Ordinary website crawlers use a separate [Valiron Crawler Protection source-verification path](./CRAWLER-PROTECTION.md). They need not register an agent key, wallet or on-chain identity. IP/DNS or authenticated verified-WAF evidence establishes network provenance, not signed agent possession or human identity; work budgets remain necessary even for a verified crawler.
4
+
3
5
  Valiron supports on-chain, key-based, and provider-backed middleware identity
4
6
  paths:
5
7
 
@@ -14,7 +16,7 @@ Use `/operator/agent/:agentId` only for registry-backed on-chain agents. Local a
14
16
 
15
17
  The provider-backed framework normalizes identity into `anonymous`, `claimed`,
16
18
  or `verified`, performs freshness and replay checks, and can return an
17
- `allow`, `limit`, `challenge`, or `block` policy action. SDK 1.3 includes
19
+ `allow`, `limit`, `challenge`, or `block` policy action. The SDK includes
18
20
  signing helpers and dedicated provider identity gates; Valiron hosts the ANS
19
21
  credentials and trusted CA bundle. See
20
22
  [Provider-Backed Agent Identity](./PROVIDER-IDENTITY.md) for the exact request,
@@ -22,7 +24,7 @@ signature payload, SDK integration, response, and current ANS boundary.
22
24
 
23
25
  ## Wallet as a Trust Input
24
26
 
25
- When a Pro policy selects `trustSignals: ["wallet"]`, Valiron evaluates the wallet associated with the chosen identity path. ERC-8004 and Solana agents use the wallet resolved from their registry identity; key-based agents use their verified persistent agent address. Wallet intelligence does not establish identity by itself—it is an additional economic-history signal applied after Valiron has a wallet address.
27
+ When a Free or paid policy selects `trustSignals: ["wallet"]`, Valiron evaluates the wallet associated with the chosen identity path. ERC-8004 and Solana agents use the wallet resolved from their registry identity; key-based agents use their verified persistent agent address. Wallet intelligence does not establish identity by itself—it is an additional economic-history signal applied after Valiron has a wallet address.
26
28
 
27
29
  Use `getWalletProfile()` to resolve a wallet to an agent profile. Use `getWalletRisk()` when you need only the explainable wallet-history assessment. See [TRUST-MODEL.md](./TRUST-MODEL.md#wallet-intelligence) for supported networks and limitations.
28
30
 
@@ -123,7 +125,7 @@ const tokenUri = await client.readContract({
123
125
  ```typescript
124
126
  import { ValironSDK } from "@valiron/sdk";
125
127
 
126
- const valiron = new ValironSDK();
128
+ const valiron = new ValironSDK({ apiKey: process.env.VALIRON_API_KEY });
127
129
  const profile = await valiron.getAgentProfile("25459");
128
130
 
129
131
  console.log(profile.identity.name);
@@ -186,10 +188,24 @@ Not every agent has an on-chain ERC-8004 identity. For local, Web2, and non-ERC-
186
188
  3. Agent signs the nonce with their private key (EIP-191 personal sign)
187
189
  4. Valiron verifies the signature and creates a `KeyAgentProfile`
188
190
 
189
- The SDK and middleware auto-detect key-based agents from the `x-agent-address` header. No configuration needed.
191
+ The middleware detects key-based claims from `x-agent-address`, then requires `verifyRequest` to verify a fresh request-bound signature and reject replay. The header or a previously enrolled profile is insufficient. See the [request-proof upgrade guide](./SECURITY-UPGRADE-2026-10-31.md).
190
192
 
191
193
  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
194
 
195
+ If an API requires a human operator link, the agent should pass its exact public
196
+ address to its human operator. That person creates an Icebreaker profile with
197
+ verified social handles and issues a `Designated agent` credential for the
198
+ address. The API seller reads the private Icebreaker view with a Pro key and
199
+ enforces its policy before the protected action. The Laso-style Web2 demo
200
+ returns `HUMAN_ATTESTATION_REQUIRED` until the credential exists and
201
+ `HUMAN_PROFILE_INCOMPLETE` if no verified social handle is available. Key
202
+ registration alone does not unlock that route.
203
+
204
+ A key-only sandbox relay has no agent endpoint to observe. Its score must not
205
+ be treated as demonstrated behavior for a sensitive purchase or payout. Bind
206
+ the address to the API seller's authenticated caller and use a separate,
207
+ action-specific policy for Icebreaker context.
208
+
193
209
  ### KeyAgentProfile
194
210
 
195
211
  | Field | Type | Description |
@@ -200,8 +216,8 @@ Agents can follow the hosted identity skill at [https://www.valiron.co/auth.md](
200
216
  | `tier` | string \| null | Moody's-style trust tier once scored |
201
217
  | `riskLevel` | string \| null | GREEN / YELLOW / RED once scored |
202
218
  | `route` | string \| null | Route decision once scored |
203
- | `icebreaker` | object \| null | Optional ownership context from Icebreaker |
204
- | `reasons` | string[] | Human-readable trust explanation |
219
+ | `icebreaker` | object \| null | Redacted to `null` on the authenticated summary endpoint; use `getKeyAgentIcebreaker()` with a Pro key |
220
+ | `reasons` | string[] | Redacted to `[]` on the authenticated summary endpoint |
205
221
  | `timestamp` | string | ISO timestamp for the profile response |
206
222
 
207
223
  ### Key-Based vs On-Chain Agents
@@ -226,9 +242,9 @@ World ID verifies that an agent is linked to a real human via Worldcoin's zero-k
226
242
 
227
243
  ### How It Works
228
244
 
229
- 1. Agent owner completes World ID verification (orb or device level)
230
- 2. The proof is submitted to Valiron via `verifyWorldId()` or the API endpoint
231
- 3. Valiron stores the verification status and includes it in trust evaluation
245
+ 1. The current registry owner authorizes enrollment with a fresh signed request, and an authenticated operator submits it.
246
+ 2. The complete production IDKit result is submitted unchanged as `idkit_result`; current enrollment accepts proof-of-human credentials.
247
+ 3. Valiron verifies the configured RP/action server-side, derives credential strength from verified evidence, and stores the link. Legacy records without server-verification provenance require re-verification.
232
248
 
233
249
  ### SDK Methods
234
250
 
@@ -238,7 +254,7 @@ await valiron.verifyWorldId("25459", proof);
238
254
 
239
255
  // Check verification status
240
256
  const status = await valiron.getWorldIdStatus("25459");
241
- // { verified: true, verifiedAt: "...", level: "orb" }
257
+ // status.worldId: { verified: true, verificationLevel: "orb" }
242
258
 
243
259
  // Get full profile
244
260
  const profile = await valiron.getWorldIdProfile("25459");
@@ -258,7 +274,7 @@ Self Agent ID can be supplied when creating a session. When present and confirme
258
274
 
259
275
  ### How It Works
260
276
 
261
- 1. Valiron creates a Self Enterprise session with `createSelfSession()` or `POST /operator/self/session/:agentId`
277
+ 1. An authenticated operator submits a fresh registry-owner proof; Valiron creates an owner-authorized Self Enterprise session with `createSelfSession()` or `POST /operator/self/session/:agentId`
262
278
  2. The user opens the returned `verificationUrl` and completes the Self flow
263
279
  3. Self sends a signed `verification.completed` webhook to `/operator/self/webhook`
264
280
  4. Valiron verifies the raw webhook body with Self's webhook verifier and stores the Self status
@@ -334,10 +350,10 @@ Both work interchangeably in Valiron's API:
334
350
 
335
351
  ```bash
336
352
  # By asset pubkey
337
- curl "https://valiron-edge-proxy.onrender.com/operator/agent/DFknts...?chain=solana"
353
+ curl -H "Authorization: Bearer $VALIRON_API_KEY" "https://valiron-edge-proxy.onrender.com/operator/agent/DFknts...?chain=solana"
338
354
 
339
355
  # By sequential ID
340
- curl "https://valiron-edge-proxy.onrender.com/operator/agent/1226?chain=solana"
356
+ curl -H "Authorization: Bearer $VALIRON_API_KEY" "https://valiron-edge-proxy.onrender.com/operator/agent/1226?chain=solana"
341
357
  ```
342
358
 
343
359
  ### Reading Solana Identity
@@ -345,7 +361,7 @@ curl "https://valiron-edge-proxy.onrender.com/operator/agent/1226?chain=solana"
345
361
  ```typescript
346
362
  import { ValironSDK } from "@valiron/sdk";
347
363
 
348
- const valiron = new ValironSDK({ chain: "solana" });
364
+ const valiron = new ValironSDK({ apiKey: process.env.VALIRON_API_KEY, chain: "solana" });
349
365
  const profile = await valiron.getAgentProfile("1226"); // sequential ID
350
366
 
351
367
  console.log(profile.identity.name); // "NoahScout_Bot.noah"
@@ -368,8 +384,4 @@ These fields appear in the `onchainReputation.solana` section of the API respons
368
384
 
369
385
  ### Solana Feedback Write-Back
370
386
 
371
- After sandbox or gate evaluation, Valiron can write scores back to the Solana registry via `giveFeedback()`. This requires a funded Solana keypair:
372
-
373
- | Environment Variable | Format | Description |
374
- |---------------------|--------|-------------|
375
- | `SOLANA_FEEDBACK_KEYPAIR` | JSON array (e.g. `[174,23,...]`) | Ed25519 secret key for signing feedback transactions |
387
+ After sandbox or gate evaluation, Valiron may publish scores to the Solana registry. Valiron manages this process; SDK users do not configure signing credentials.
@@ -3,10 +3,12 @@
3
3
  Valiron now has a provider-independent verification foundation for identities
4
4
  resolved through ANS, DNS, DIDs, API keys, and future standards. An ANS REST
5
5
  resolver adapter is implemented and is registered at service startup when its
6
- credentials and trusted CA bundle are configured. SDK 1.3 adds signing helpers,
6
+ credentials and trusted CA bundle are configured. The SDK provides 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 10,000 metered agent requests per UTC calendar month; Pro includes 100,000. Bot protection has a separate allowance at the same limits. Enterprise: email founders@valiron.co.
11
+
10
12
  ## Responsibility boundary
11
13
 
12
14
  An identity provider establishes the agent's canonical identifier, verification
@@ -61,6 +63,9 @@ const proof = await createAgentIdentityProof({
61
63
  provider: "ans",
62
64
  agentId: "ans://v1.0.0.sales-agent.acme.com",
63
65
  body,
66
+ audience: "https://api.example.com",
67
+ method: "POST",
68
+ url: "https://api.example.com/quote",
64
69
  sign: (payload) => agentKey.sign(payload),
65
70
  });
66
71
 
@@ -114,6 +119,8 @@ const valiron = new ValironSDK({ apiKey: process.env.VALIRON_API_KEY });
114
119
 
115
120
  app.post("/quote", createValironIdentityGate({
116
121
  sdk: valiron,
122
+ audience: "https://api.example.com",
123
+ origin: "https://api.example.com",
117
124
  policy: {
118
125
  anonymous: "challenge",
119
126
  claimed: "block",
@@ -163,7 +170,10 @@ Equivalent exports are `valironIdentityFastifyPlugin`,
163
170
  The signature covers the UTF-8 bytes of this exact payload:
164
171
 
165
172
  ```text
166
- valiron-agent-request-v1
173
+ valiron-agent-request-v2
174
+ audience:<API-owner-configured-audience>
175
+ method:<UPPERCASE-HTTP-method>
176
+ url:<absolute-request-URL>
167
177
  agent-id:<provider-canonical-agent-id>
168
178
  timestamp:<timestamp-as-submitted>
169
179
  nonce:<nonce-as-submitted>
@@ -174,6 +184,8 @@ The request digest must use `sha256:` followed by 64 hexadecimal characters.
174
184
  The nonce must contain 16–256 URL-safe characters. The default timestamp window
175
185
  is five minutes, and nonce claims are retained for ten minutes.
176
186
 
187
+ The receiving API must derive the audience, method, URL and `requestDigest` from its own trusted configuration and the actual protected request. It must not copy these fields from caller-supplied headers.
188
+
177
189
  The caller must calculate `requestDigest` from the protected request bytes and
178
190
  apply the returned decision to that same request. This standalone verification
179
191
  endpoint cannot infer the bytes of a separate downstream request.
@@ -209,7 +221,7 @@ machine-readable `failureReason`. See [Errors](./ERRORS.md#provider-backed-ident
209
221
 
210
222
  ## Replay and storage behavior
211
223
 
212
- Nonce claims use an atomic Redis write. Verification returns HTTP 503 when the
224
+ Each request nonce can be accepted only once. Verification returns HTTP 503 when the
213
225
  replay store is unavailable, so the flow cannot fail open. Only verified
214
226
  requests update the stable identity activity record. Failed claims cannot write
215
227
  activity or reputation against the identity they attempted to impersonate.
@@ -236,30 +248,13 @@ For an ANS claim, the adapter:
236
248
  6. loads the current Transparency Log record, requires `ACTIVE` or `WARNING`, and matches its identity-certificate fingerprint; and
237
249
  7. extracts the certificate public key for the Valiron request proof.
238
250
 
239
- The timestamp, nonce, request digest, and `valiron-agent-request-v1` payload are
251
+ The timestamp, nonce, request digest, and `valiron-agent-request-v2` payload are
240
252
  a Valiron transport-proof envelope. They are not presented as an ANS-native HTTP
241
253
  signature standard.
242
254
 
243
- Configure the resolver on the edge-proxy service with:
244
-
245
- | Variable | Required | Purpose |
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"`.
255
+ Valiron manages provider credentials and trust configuration on the hosted service. Customers supply signed proofs, not provider secrets.
256
+
257
+ If the hosted resolver is unavailable, ANS claims return `claimed` with `failureReason: "resolver_unavailable"`.
263
258
  Malformed, inactive, revoked, mismatched, untrusted, or certificate-less ANS
264
259
  records cannot become `verified`.
265
260