@valiron/sdk 0.12.0 → 1.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.
@@ -0,0 +1,253 @@
1
+ # Operator Dashboard
2
+
3
+ > Manage your Valiron integration from a single web interface — register endpoints, monitor agent activity, test trust evaluations, and view analytics.
4
+
5
+ **Dashboard URL:** [https://valiron.co/dashboard](https://valiron.co/dashboard)
6
+
7
+ ---
8
+
9
+ ## Getting Access
10
+
11
+ To create an account:
12
+
13
+ 1. Go to [valiron.co/dashboard](https://valiron.co/dashboard) and click **Create account**
14
+ 2. Enter your name, email, and password
15
+ 3. On success, you'll see a **one-time API key** — copy it immediately (it won't be shown again)
16
+
17
+ After registration, sign in with your email and password. Your session is stored as a JWT in the browser.
18
+
19
+ ---
20
+
21
+ ## Overview
22
+
23
+ **Route:** `/dashboard`
24
+
25
+ Your landing page after signing in. Shows a summary of your integration at a glance:
26
+
27
+ - **Top stats** — Total Revenue, Total Calls, Unique Agents, Avg Latency
28
+ - **Secondary stats** — Active API Keys, Registered Endpoints, Calls Today, Plan + fee rate
29
+ - **Recent Activity** — Last 5 call logs with method, path, agent, cost, and timestamp
30
+ - **Quick Start** — 3-step guide: get API key → register endpoints → add SDK middleware (with code sample)
31
+
32
+ ---
33
+
34
+ ## Agents
35
+
36
+ **Route:** `/dashboard/agents`
37
+
38
+ View every AI agent that has called your API, sorted by last seen, call volume, spend, or error count.
39
+
40
+ Each agent card shows:
41
+ - Agent ID (ERC-8004 token ID)
42
+ - Chain badges (multi-chain support)
43
+ - Last seen, total calls, total spent, avg latency, error count
44
+
45
+ **Click an agent** to drill into:
46
+ - Summary stats and first/last seen dates
47
+ - Endpoint breakdown table — which of your endpoints they called, how many times, spend, avg latency, errors
48
+ - Recent call log for that agent
49
+
50
+ ---
51
+
52
+ ## Analytics
53
+
54
+ **Route:** `/dashboard/analytics`
55
+
56
+ Revenue and usage analytics with time-range filtering.
57
+
58
+ - **Stats grid** — Total Revenue, Total Calls, Unique Agents, Avg Latency
59
+ - **Today's stats** — Calls Today, Revenue Today, Error Rate (highlighted if > 5%)
60
+ - **Daily Revenue chart** — Bar chart with tooltips (7 / 30 / 90 day range selector)
61
+ - **Top Endpoints** — Ranked by call volume with revenue, avg latency, and unique agent count
62
+
63
+ ---
64
+
65
+ ## Call Logs
66
+
67
+ **Route:** `/dashboard/logs`
68
+
69
+ Paginated log of every API call made through your Valiron-gated endpoints.
70
+
71
+ Each row shows:
72
+ - Timestamp
73
+ - Agent label + ID
74
+ - Chain badge
75
+ - Endpoint (method + path)
76
+ - Status code (color-coded: green for 2xx, yellow for 4xx, red for 5xx)
77
+ - Cost charged
78
+ - Latency
79
+ - Session ID
80
+
81
+ **Filters:**
82
+ - Time range: All time, Last 24h, 7 days, 30 days, 90 days
83
+ - Pagination: 50 entries per page
84
+
85
+ ---
86
+
87
+ ## API Keys
88
+
89
+ **Route:** `/dashboard/keys`
90
+
91
+ Manage your operator API keys. These keys authenticate your backend when calling Valiron's trust evaluation API via the SDK.
92
+
93
+ **Actions:**
94
+ - **Generate new key** — Creates a new `val_op_` prefixed key. Shown once — copy it immediately.
95
+ - **Revoke key** — Permanently disables a key. Revoked keys are shown separately.
96
+
97
+ Each key shows its prefix, label, last used date, and creation date.
98
+
99
+ ---
100
+
101
+ ## Endpoints
102
+
103
+ **Route:** `/dashboard/endpoints`
104
+
105
+ Register the API endpoints you want to protect with Valiron. When an agent calls one of these paths, Valiron uses the registered pricing and rate limits to evaluate and charge appropriately.
106
+
107
+ **To register an endpoint:**
108
+
109
+ | Field | Required | Description |
110
+ |-------|----------|-------------|
111
+ | Path | Yes | Your API path (e.g. `/api/v1/weather`) |
112
+ | Method | Yes | HTTP method: GET, POST, PUT, PATCH, DELETE |
113
+ | Price per call (USD) | Yes | How much to charge per API call |
114
+ | Rate limit (req/min) | No | Max requests per minute per agent (null = unlimited) |
115
+ | Base URL | No | Your backend URL (e.g. `https://myapi.com`). When set, the playground forwards requests to this URL + path. Must be HTTPS. |
116
+ | Description | No | What this endpoint does |
117
+
118
+ **Removing an endpoint** performs a soft-delete — the endpoint is deactivated but still visible in the list.
119
+
120
+ > **Note:** Registering an endpoint here tells Valiron about your pricing and rate limits. You still need to [integrate the SDK](#integration-with-the-sdk) into your backend to actually gate incoming agent traffic.
121
+
122
+ ---
123
+
124
+ ## API Playground
125
+
126
+ **Route:** `/dashboard/playground`
127
+
128
+ Test how Valiron evaluates different AI agents against your endpoints — without writing any code or sending real traffic.
129
+
130
+ ### How it works
131
+
132
+ 1. **Pick a chain** — All supported chains are available (Ethereum, Monad, Arbitrum, Base, Avalanche, Polygon, Optimism, Solana, testnets, and more). Chains with pre-registered sample agents show agent cards; other chains require a custom agent ID.
133
+ 2. **Select an agent** — Choose from pre-registered sample agents at different trust levels, or enter a custom agent ID:
134
+ - **Good agents** (score 80–95, tier A/AA) — would be routed to production
135
+ - **Bad agents** (score 30–45, tier CA/CAA) — would be routed to sandbox
136
+ - **Zero agents** (score 0, tier C) — no reputation, requires behavioral testing
137
+ 3. **Build the request** — Pick a method and enter a path. Headers (`Content-Type`, `X-Agent-Id`, `X-Valiron-Chain`, `X-Api-Key`) are added automatically. Expand **Advanced options** to add custom headers, query params, or a request body
138
+ 4. **Send** — The playground evaluates the agent's on-chain trust profile and shows the result
139
+
140
+ ### Dry-run mode
141
+
142
+ Toggle **Dry Run** on to see the trust evaluation without logging the call:
143
+ - Resolved tier (AAA–C)
144
+ - Routing decision (prod / sandbox / blocked)
145
+ - Price per call (from your registered endpoint)
146
+ - On-chain reputation score and feedback count
147
+
148
+ ### Standard mode
149
+
150
+ With dry-run off, the playground performs the full trust evaluation and logs the call to your Analytics/Logs pages.
151
+
152
+ - **If your endpoint has a Base URL** — the playground forwards the request to your backend (Base URL + path) with Valiron headers (`X-Agent-Id`, `X-Valiron-Chain`, `X-Valiron-Tier`, `X-Valiron-Route`). You'll see the real HTTP response from your server.
153
+ - **If no Base URL is set** — the playground returns the trust evaluation only (tier, route, cost, on-chain score).
154
+
155
+ > **Tip:** Add a Base URL to your endpoints in the Endpoints page to enable end-to-end testing in the playground.
156
+
157
+ ### Response panel
158
+
159
+ Every request shows:
160
+ - **Status code** — Color-coded (green 2xx, yellow 3xx/4xx, red 5xx)
161
+ - **Latency** — Round-trip time in ms
162
+ - **Route** — Where the agent would be routed (prod, sandbox, blocked)
163
+ - **Cost** — Per-call price from your endpoint registration
164
+ - **Tier** — The agent's resolved trust tier
165
+ - **Body** — Trust evaluation details
166
+
167
+ ### History
168
+
169
+ The sidebar shows up to 20 recent requests from the current page session. Each entry shows method, path, agent, status, latency, and timestamp. Click an entry to repopulate the request form; history is not persisted across sessions.
170
+
171
+ ---
172
+
173
+ ## Settings
174
+
175
+ **Route:** `/dashboard/settings`
176
+
177
+ Manage your operator profile.
178
+
179
+ - **Name** — Editable display name
180
+ - **Email** — Read-only (set during registration)
181
+ - **Plan** — Your current plan and fee rate
182
+ - **Account info** — Operator ID and account creation date
183
+
184
+ ---
185
+
186
+ ## Admin Panel
187
+
188
+ **Route:** `/dashboard/admin` (admin-only)
189
+
190
+ Platform-wide administration. Only visible to operators with `role: "admin"`.
191
+
192
+ - **Platform stats** — Total operators, total API calls, total revenue
193
+ - **All operators table** — Name, email, role, plan, keys, endpoints, calls, revenue, agents, join date
194
+ - **Operator drill-down** — Click any operator to see their full detail: stats, daily revenue chart, API keys, endpoints, agents, account info
195
+
196
+ ---
197
+
198
+ ## Integration with the SDK
199
+
200
+ The dashboard and SDK work together. Here's the typical operator workflow:
201
+
202
+ ### Step 1 — Dashboard setup
203
+
204
+ 1. Create your account on the dashboard
205
+ 2. Copy your API key from the Keys page
206
+ 3. Register your endpoints on the Endpoints page (path, method, pricing)
207
+
208
+ ### Step 2 — SDK integration
209
+
210
+ Install the SDK and add it to your backend:
211
+
212
+ ```bash
213
+ npm install @valiron/sdk
214
+ ```
215
+
216
+ **Option A — Express middleware (recommended):**
217
+
218
+ ```typescript
219
+ import { ValironOperator } from "@valiron/sdk";
220
+
221
+ const operator = new ValironOperator({ apiKey: "val_op_xxxx" });
222
+ app.use("/api/weather", operator.paywall({ pricePerCall: 0.05 }));
223
+ ```
224
+
225
+ **Option B — Manual gating:**
226
+
227
+ ```typescript
228
+ import { ValironSDK } from "@valiron/sdk";
229
+
230
+ const valiron = new ValironSDK({ chain: "ethereum" });
231
+
232
+ app.use("/api/weather", async (req, res, next) => {
233
+ const agentId = req.headers["x-agent-id"];
234
+ const profile = await valiron.getAgentProfile(agentId);
235
+
236
+ if (profile.routing.finalRoute === "prod") return next();
237
+ if (profile.routing.finalRoute === "sandbox")
238
+ return res.status(403).json({ error: "Agent under evaluation" });
239
+ return res.status(403).json({ error: "Agent not trusted" });
240
+ });
241
+ ```
242
+
243
+ ### Step 3 — Test with the Playground
244
+
245
+ Before going live, use the Playground to verify:
246
+ - That your endpoint pricing and rate limits are configured correctly
247
+ - That high-reputation agents get routed to production
248
+ - That low/zero-reputation agents get sandboxed or blocked
249
+ - What the full request/response cycle looks like with real latency numbers
250
+
251
+ ### Step 4 — Monitor
252
+
253
+ Use the dashboard to track agent activity, review call logs, and monitor revenue.
package/docs/ERRORS.md CHANGED
@@ -88,6 +88,10 @@ The agent has not been evaluated in the sandbox yet. Trigger a sandbox test:
88
88
  await valiron.triggerSandboxTest("YOUR_AGENT_ID");
89
89
  ```
90
90
 
91
+ ### Provisional scores
92
+
93
+ 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.
94
+
91
95
  ### Timeout errors
92
96
 
93
97
  The default SDK timeout is 5 seconds. For sandbox tests (which run real evaluations), increase it:
@@ -141,3 +145,42 @@ Public Solana RPC endpoints have aggressive rate limits. If you see frequent tim
141
145
  ```bash
142
146
  SOLANA_RPC_URL=https://your-private-rpc.example.com
143
147
  ```
148
+
149
+ ---
150
+
151
+ ## Middleware Error Responses
152
+
153
+ All Valiron middleware (Express, Fastify, Next.js, generic) returns consistent error responses:
154
+
155
+ | Status | When | Body |
156
+ |--------|------|------|
157
+ | 401 | No agent ID found in request | `{ error: "No agent identity provided" }` |
158
+ | 403 | Agent denied by trust gate | `{ error: "Access denied", tier, riskLevel, route }` |
159
+ | 503 | Valiron service unavailable | `{ error: "Trust evaluation unavailable" }` |
160
+
161
+ > **Fail-closed:** When the Valiron service is unreachable, middleware returns 503 — it never fails open and never allows unverified agents through.
162
+
163
+ ## Proxy Gateway Errors
164
+
165
+ | Status | When | Action |
166
+ |--------|------|--------|
167
+ | 400 | Missing `targetUrl` or invalid request | Check your proxy request fields |
168
+ | 403 | Agent denied by trust gate | Agent does not meet the trust threshold |
169
+ | 403 | SSRF blocked | The `targetUrl` resolves to a private IP, localhost, or metadata endpoint |
170
+ | 503 | Origin server unreachable | Your target URL is down or timed out |
171
+
172
+ ## Key-Based Agent Errors
173
+
174
+ | Status | When | Action |
175
+ |--------|------|--------|
176
+ | 400 | Invalid Ethereum address format | Verify the `x-agent-address` header is a valid `0x...` address |
177
+ | 401 | Challenge expired | Request a new challenge — challenges expire after a short window |
178
+ | 401 | Invalid signature | The EIP-191 signature does not match the address |
179
+
180
+ ## World ID Errors
181
+
182
+ | Status | When | Action |
183
+ |--------|------|--------|
184
+ | 400 | Invalid or malformed proof | Verify your World ID proof payload fields |
185
+ | 404 | Agent has no World ID verification | The agent hasn't completed World ID verification yet |
186
+ | 409 | Nullifier hash already used | This World ID proof has already been submitted |
package/docs/IDENTITY.md CHANGED
@@ -147,6 +147,77 @@ On-chain reputation contributes to an agent's overall trust evaluation. More fee
147
147
 
148
148
  ---
149
149
 
150
+ ## Key-Based Agents (Web2)
151
+
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.
153
+
154
+ ### How It Works
155
+
156
+ 1. Agent sends a request with the `x-agent-address: 0x...` header
157
+ 2. Valiron returns a challenge nonce
158
+ 3. Agent signs the nonce with their private key (EIP-191 personal sign)
159
+ 4. Valiron verifies the signature and creates a `KeyAgentProfile`
160
+
161
+ The SDK and middleware auto-detect key-based agents from the `x-agent-address` header. No configuration needed.
162
+
163
+ ### KeyAgentProfile
164
+
165
+ | Field | Type | Description |
166
+ |-------|------|-------------|
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 |
174
+
175
+ ### Key-Based vs On-Chain Agents
176
+
177
+ | | On-Chain (ERC-8004) | Key-Based |
178
+ |---|---|---|
179
+ | 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 |
183
+ | Solana support | Yes (Metaplex Core) | No (EVM only) |
184
+
185
+ ### API Endpoints
186
+
187
+ See [API-REFERENCE.md](./API-REFERENCE.md#key-based-agent-endpoints) for the full HTTP API.
188
+
189
+ ---
190
+
191
+ ## World ID (Proof-of-Personhood)
192
+
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.
194
+
195
+ ### How It Works
196
+
197
+ 1. Agent owner completes World ID verification (orb or device level)
198
+ 2. The proof is submitted to Valiron via `verifyWorldId()` or the API endpoint
199
+ 3. Valiron stores the verification status and includes it in trust evaluation
200
+
201
+ ### SDK Methods
202
+
203
+ ```typescript
204
+ // Submit a World ID proof
205
+ await valiron.verifyWorldId("25459", proof);
206
+
207
+ // Check verification status
208
+ const status = await valiron.getWorldIdStatus("25459");
209
+ // { verified: true, verifiedAt: "...", level: "orb" }
210
+
211
+ // Get full profile
212
+ const profile = await valiron.getWorldIdProfile("25459");
213
+ ```
214
+
215
+ ### API Endpoints
216
+
217
+ See [API-REFERENCE.md](./API-REFERENCE.md#world-id-endpoints) for the full HTTP API.
218
+
219
+ ---
220
+
150
221
  ## Solana Identity (QuantuLabs 8004-solana)
151
222
 
152
223
  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.
@@ -2,12 +2,22 @@
2
2
 
3
3
  > Estimated integration time: under 2 minutes.
4
4
 
5
+ ## Prerequisites
6
+
7
+ 1. **Create an account** on the [Operator Dashboard](./DASHBOARD.md) at [valiron.co/dashboard](https://valiron.co/dashboard)
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
10
+
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
+
5
13
  ## Step 1 — Install the SDK
6
14
 
7
15
  ```bash
8
16
  npm install @valiron/sdk
9
17
  ```
10
18
 
19
+ > **Requirements:** Node.js >= 18.0.0. Zero external dependencies.
20
+
11
21
  ## Step 2 — Initialize the client
12
22
 
13
23
  ```typescript
@@ -100,6 +110,15 @@ curl -X POST https://valiron-edge-proxy.onrender.com/operator/webhooks/register
100
110
  -d '{"event": "evaluation_complete", "url": "https://your-endpoint.com/hooks/valiron"}'
101
111
  ```
102
112
 
113
+ ## Step 8 — Monitor in the Dashboard
114
+
115
+ Once your integration is live, use the [Operator Dashboard](./DASHBOARD.md) to:
116
+
117
+ - **Agents** — See every agent that has called your API, sorted by activity, spend, or errors
118
+ - **Analytics** — Track revenue, call volume, and top endpoints over time
119
+ - **Call Logs** — Paginated log of every request with status codes, latency, and cost
120
+ - **Playground** — Test how agents at different trust levels are evaluated against your endpoints
121
+
103
122
  ## Using the HTTP API directly (no SDK)
104
123
 
105
124
  ```bash
@@ -123,68 +142,26 @@ curl -X POST https://valiron-edge-proxy.onrender.com/operator/webhooks/register
123
142
 
124
143
  ---
125
144
 
126
- ## Quickstart: Payment Channels (Solana)
127
-
128
- Monetize your API with trust-adaptive USDC credit lines. Agents deposit USDC, consume on a tab, and get refunded unused balance.
145
+ ## Cleanup (long-running servers)
129
146
 
130
- ### Step 1 — Preflight check
147
+ Call `dispose()` when shutting down to flush pending telemetry:
131
148
 
132
149
  ```typescript
133
- const valiron = new ValironSDK({ chain: "solana" });
134
-
135
- const preflight = await valiron.channelPreflight("1226", "7xKXtg2CW87d...");
136
- console.log(preflight.escrowAddress); // deposit USDC here
137
- console.log(preflight.creditLineReadable); // "$50.00"
138
- ```
139
-
140
- ### Step 2 — Agent deposits USDC, then open the channel
141
-
142
- ```typescript
143
- // After the agent sends USDC to preflight.escrowAddress...
144
- const channel = await valiron.channelOpen("1226", "7xKXtg2CW87d...", "5eykt...");
145
- const sessionId = channel.sessionId; // "ch_a1b2c3..."
146
- ```
147
-
148
- ### Step 3 — Charge per API call
149
-
150
- ```typescript
151
- const usage = await valiron.channelConsume(sessionId, 0.50, "GPT-4o call");
152
- console.log(usage.session.remainingReadable); // "$49.50"
153
- ```
154
-
155
- ### Step 4 — Settle and refund
156
-
157
- ```typescript
158
- const settlement = await valiron.channelSettle(sessionId);
159
- console.log(settlement.refundReadable); // "$49.50" refunded to agent
150
+ process.on("SIGTERM", async () => {
151
+ await valiron.dispose();
152
+ process.exit(0);
153
+ });
160
154
  ```
161
155
 
162
- ### Using the HTTP API directly
163
-
164
- ```bash
165
- # Preflight
166
- curl -X POST https://valiron-edge-proxy.onrender.com/channel/preflight/1226 \
167
- -H "Content-Type: application/json" \
168
- -d '{"walletAddress": "7xKXtg2CW87d..."}'
169
-
170
- # Open channel
171
- curl -X POST https://valiron-edge-proxy.onrender.com/channel/open/1226 \
172
- -H "Content-Type: application/json" \
173
- -d '{"walletAddress": "7xKXtg2CW87d...", "depositSignature": "5eykt..."}'
174
-
175
- # Consume (use sessionId as Bearer token)
176
- curl -X POST https://valiron-edge-proxy.onrender.com/channel/consume/ch_a1b2c3 \
177
- -H "Content-Type: application/json" \
178
- -H "Authorization: Bearer ch_a1b2c3" \
179
- -d '{"cost": 0.50, "description": "GPT-4o call"}'
156
+ ---
180
157
 
181
- # Status
182
- curl https://valiron-edge-proxy.onrender.com/channel/status/ch_a1b2c3
158
+ ## What's next?
183
159
 
184
- # Settle
185
- curl -X POST https://valiron-edge-proxy.onrender.com/channel/settle/ch_a1b2c3 \
186
- -H "Content-Type: application/json" -d '{}'
187
- ```
160
+ - **[Proxy Gateway](./SDK-REFERENCE.md#proxy-gateway-pro)** — Forward requests through Valiron's edge proxy (Pro)
161
+ - **[Key-Based Agents](./SDK-REFERENCE.md#key-based-agents)** — Support Web2 agents without on-chain identity
162
+ - **[World ID](./SDK-REFERENCE.md#world-id-methods)** — Verify agent-human linkage
163
+ - **[Fastify / Next.js / Hono middleware](./SDK-REFERENCE.md#middleware)** — Framework-specific middleware
164
+ - **[Plans & Limits](./SDK-REFERENCE.md#plans--limits)** — Free vs Pro feature comparison
188
165
 
189
166
  ---
190
167
 
package/docs/README.md CHANGED
@@ -13,6 +13,7 @@ Valiron is trust infrastructure for API sellers. It evaluates AI agents using on
13
13
  | File | Purpose |
14
14
  |------|---------|
15
15
  | [QUICKSTART.md](./QUICKSTART.md) | Get started in under 2 minutes — install the SDK, gate your first endpoint |
16
+ | [DASHBOARD.md](./DASHBOARD.md) | Operator Dashboard — manage endpoints, keys, analytics, and playground |
16
17
  | [API-REFERENCE.md](./API-REFERENCE.md) | Complete HTTP API reference with request/response schemas |
17
18
  | [SDK-REFERENCE.md](./SDK-REFERENCE.md) | TypeScript SDK methods, signatures, and usage examples |
18
19
  | [TRUST-MODEL.md](./TRUST-MODEL.md) | How agents are scored, what behaviors are penalized, tier assignments |
@@ -29,7 +30,6 @@ Valiron is trust infrastructure for API sellers. It evaluates AI agents using on
29
30
  - **Risk Level**: GREEN, YELLOW, or RED.
30
31
  - **Route Decision**: `prod`, `prod_throttled`, `sandbox`, or `sandbox_only` — determines what access level your API should give.
31
32
  - **Sandbox**: An isolated test environment where Valiron evaluates agent behavior before granting production access.
32
- - **Payment Channel** (Solana): Trust-adaptive USDC credit line. Agents deposit to escrow, consume per API call, and get refunded on settlement.
33
33
  - **Liveness** (Solana only): Endpoint health probe via `isItAlive()`. See [API-REFERENCE.md](./API-REFERENCE.md#solana-support).
34
34
 
35
35
  ## Supported Registries
package/docs/SANDBOX.md CHANGED
@@ -12,12 +12,7 @@ The sandbox is an isolated testing environment where Valiron evaluates agent beh
12
12
 
13
13
  ## What Gets Tested
14
14
 
15
- The sandbox evaluates agents against a mix of:
16
- - **Successful responses** — normal API interactions
17
- - **Rate-limit responses (429)** — tests whether the agent backs off appropriately
18
- - **Server errors (500)** — tests error handling and retry behavior
19
-
20
- The exact distribution and test patterns vary and are not disclosed.
15
+ The sandbox evaluates agents through a series of simulated API interactions that test how the agent handles various scenarios. The specific test types, distribution, and patterns are proprietary and not disclosed.
21
16
 
22
17
  ## Graduation
23
18
 
@@ -54,15 +49,7 @@ curl -X POST https://valiron-edge-proxy.onrender.com/operator/trigger-sandbox/YO
54
49
 
55
50
  ## Tips for Passing Sandbox Tests
56
51
 
57
- Agents that follow these patterns will earn higher trust tiers on your endpoints:
58
-
59
- 1. **Respect 429s immediately.** Stop sending requests when rate-limited.
60
- 2. **Read and honor `Retry-After` headers.** Wait the specified duration before retrying.
61
- 3. **Use exponential backoff.** 1s → 2s → 4s → 8s between retries.
62
- 4. **Don't retry auth failures.** A 401 or 403 means stop, not retry harder.
63
- 5. **Stay within authorized scope.** Only access paths they’re allowed to.
64
- 6. **Keep request volume reasonable.** Avoid excessive request bursts.
65
- 7. **Handle errors gracefully.** 500 errors happen — back off, don't flood.
52
+ Agents that demonstrate responsible, well-behaved API usage will earn higher trust tiers. The specific scoring criteria are proprietary, but in general: respect API boundaries, handle errors gracefully, and avoid aggressive request patterns.
66
53
 
67
54
  ---
68
55