@valiron/sdk 1.1.0 → 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/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Official TypeScript SDK for **Valiron** — Trust & Reputation Middleware for API Protection
4
4
 
5
- Protect your API endpoints from bad or malicious AI agents. Valiron evaluates incoming agents using on-chain identity (ERC-8004/Solana), key-based identity for local/Web2 agents, behavioral sandbox testing, and Moody's-style credit ratings — so you can allow trusted agents and block risky ones automatically.
5
+ Protect your API endpoints from bad or malicious AI agents. Valiron evaluates incoming agents using on-chain identity (ERC-8004/Solana), key-based identity for local/Web2 agents, behavioral sandbox testing, predictive risk forecasts, and Moody's-style credit ratings — so you can allow trusted agents and block risky ones automatically.
6
6
 
7
7
  ## Installation
8
8
 
@@ -49,6 +49,7 @@ Use `x-agent-id` for ERC-8004/Solana agents. Use `x-agent-address` plus Valiron
49
49
  ### Additional Features
50
50
 
51
51
  - **Auto-Sandbox** — Middleware automatically evaluates new agents (on-chain and key-based) on their first gated request
52
+ - **Predictive Risk** — Dashboard/API forecasts whether an observed agent is improving, stable, or becoming riskier before the next action
52
53
  - **Proxy Gateway** (Pro) — Forward requests through Valiron's edge proxy with SSRF protection
53
54
  - **Key-Based Agents** — Support Web2 agents via EIP-191 challenge-response (auto-detected, auto-sandboxed)
54
55
  - **World ID** — Verify agent-human linkage via Worldcoin proof-of-personhood
package/dist/clients.js CHANGED
@@ -473,6 +473,14 @@ class ValironClient {
473
473
  return "getWorldIdStatus";
474
474
  if (path.startsWith("/operator/world-id/profile/"))
475
475
  return "getWorldIdProfile";
476
+ if (path.startsWith("/operator/self/session/"))
477
+ return "createSelfSession";
478
+ if (path.startsWith("/operator/self/verify/"))
479
+ return "verifySelf";
480
+ if (path.startsWith("/operator/self/status/"))
481
+ return "getSelfStatus";
482
+ if (path.startsWith("/operator/self/profile/"))
483
+ return "getSelfProfile";
476
484
  if (path.startsWith("/operator/key/"))
477
485
  return "keyAgent";
478
486
  return "unknown";
package/dist/telemetry.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TelemetryClient = void 0;
4
- const SDK_VERSION = "1.0.2";
4
+ const SDK_VERSION = "1.1.1";
5
5
  function detectRuntime() {
6
6
  return typeof globalThis.window === "undefined" ? "node" : "browser";
7
7
  }
@@ -1063,7 +1063,63 @@ Paginated agent summaries. Requires JWT.
1063
1063
 
1064
1064
  ### GET /operator/analytics/agents/:agentId
1065
1065
 
1066
- Detailed view of a single agent. Requires JWT. Returns summary stats, endpoint breakdown, and recent call log.
1066
+ Detailed view of a single agent. Requires JWT. Returns summary stats, endpoint breakdown, recent call log, and the current predictive risk forecast.
1067
+
1068
+ The `prediction` object is an explainable forecast derived from recent sandbox evaluations, behavioral fingerprints, and operator call logs:
1069
+
1070
+ ```json
1071
+ {
1072
+ "prediction": {
1073
+ "agentId": "25459",
1074
+ "modelVersion": "heuristic-v1",
1075
+ "predictedNextScore": 72,
1076
+ "passProbability": 0.68,
1077
+ "riskDirection": "worsening",
1078
+ "confidence": "medium",
1079
+ "recommendedPolicy": "sandbox",
1080
+ "recommendedTests": ["rate_limit", "concurrency"],
1081
+ "reasons": [
1082
+ {
1083
+ "severity": "warning",
1084
+ "signal": "score_trend",
1085
+ "message": "Recent evaluation scores are trending down.",
1086
+ "weight": -12
1087
+ }
1088
+ ],
1089
+ "evidenceWindow": {
1090
+ "evaluationCount": 5,
1091
+ "callCount": 42,
1092
+ "fingerprintSampleCount": 5,
1093
+ "from": "2026-07-01T12:00:00.000Z",
1094
+ "to": "2026-07-13T12:00:00.000Z"
1095
+ }
1096
+ }
1097
+ }
1098
+ ```
1099
+
1100
+ ---
1101
+
1102
+ ### GET /operator/analytics/agents/:agentId/prediction
1103
+
1104
+ Fetch only the predictive risk forecast for one agent. Requires JWT.
1105
+
1106
+ Use this when you want to show a pre-action warning, trigger a new sandbox test, or decide whether the next request should be allowed, throttled, stepped up, sandboxed, or denied.
1107
+
1108
+ Before using persisted prediction snapshots in a new edge-proxy deployment, apply database migrations:
1109
+
1110
+ ```bash
1111
+ pnpm --filter edge-proxy db:migrate
1112
+ ```
1113
+
1114
+ | Field | Type | Description |
1115
+ |-------|------|-------------|
1116
+ | `predictedNextScore` | number | Forecasted next Valiron score on a 0-110 scale |
1117
+ | `passProbability` | number | Estimated probability that the next evaluation/action passes policy |
1118
+ | `riskDirection` | string | `improving`, `stable`, `worsening`, or `unknown` |
1119
+ | `confidence` | string | `low`, `medium`, or `high` based on evidence volume |
1120
+ | `recommendedPolicy` | string | `allow`, `throttle`, `sandbox`, `step_up`, or `deny` |
1121
+ | `recommendedTests` | string[] | Test families most relevant to run next |
1122
+ | `reasons` | object[] | Human-readable signals explaining the forecast |
1067
1123
 
1068
1124
  ---
1069
1125
 
package/docs/DASHBOARD.md CHANGED
@@ -43,10 +43,13 @@ Each agent card shows:
43
43
  - Last seen, total calls, total spent, avg latency, error count
44
44
 
45
45
  **Click an agent** to drill into:
46
+ - Predictive risk — forecasted next score, pass probability, trend, confidence, recommended policy, suggested tests, and plain-English reasons
46
47
  - Summary stats and first/last seen dates
47
48
  - Endpoint breakdown table — which of your endpoints they called, how many times, spend, avg latency, errors
48
49
  - Recent call log for that agent
49
50
 
51
+ Predictive risk is computed from recent sandbox evaluations, behavioral fingerprints, and your operator call logs. It does not replace the trust gate. Low-confidence forecasts mean Valiron has sparse evidence and should usually trigger another sandbox run before broadening production access.
52
+
50
53
  ---
51
54
 
52
55
  ## Analytics
@@ -52,6 +52,26 @@ Valiron evaluates agents across multiple behavioral dimensions. The behavioral e
52
52
 
53
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.
54
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
+
55
75
  ## Checking an Agent's Trust Status
56
76
 
57
77
  ```typescript
package/docs/llms.txt CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  > Protect your API endpoints from bad or malicious AI agents.
4
4
 
5
- Valiron is trust and reputation middleware for API sellers. It evaluates incoming AI agents using on-chain identity (ERC-8004/Solana), key-based identity for local/Web2/non-ERC-8004 agents, behavioral sandbox testing, and Moody's-style credit ratings (AAA to C). Trustworthy agents get production access. Risky agents are throttled, sandboxed, or blocked — automatically.
5
+ Valiron is trust and reputation middleware for API sellers. It evaluates incoming AI agents using on-chain identity (ERC-8004/Solana), key-based identity for local/Web2/non-ERC-8004 agents, behavioral sandbox testing, predictive risk forecasts, and Moody's-style credit ratings (AAA to C). Trustworthy agents get production access. Risky agents are throttled, sandboxed, or blocked — automatically.
6
6
 
7
7
  ## Identity Paths
8
8
 
@@ -143,6 +143,8 @@ Valiron evaluates agents using five independent trust signals:
143
143
  4. **Self** — Self Enterprise eligible-human proof via signed session webhooks, with optional Self Agent ID binding.
144
144
  5. **Icebreaker** — Human attestation via Ethereum Attestation Service (EAS) on Base. A human attests this is their "designated agent."
145
145
 
146
+ Predictive risk is available in the dashboard/API for observed agents. It forecasts the next score, pass probability, trend, confidence, recommended policy, suggested tests, and reasons from recent sandbox evaluations, behavioral fingerprints, and operator call logs. It does not replace the trust gate; low-confidence forecasts mean more evaluation data is needed.
147
+
146
148
  ## Trust Tiers
147
149
 
148
150
  Valiron assigns Moody's-style credit tiers: AAA (highest trust) through C (lowest trust). Higher tiers route to production, lower tiers are sandboxed or blocked. Exact score ranges are not disclosed.
@@ -253,7 +255,7 @@ Dashboard URL: https://www.valiron.co/dashboard (JWT-authenticated)
253
255
 
254
256
  ### Dashboard Features
255
257
  - Overview: revenue, calls, agents, latency stats + quick start guide
256
- - Agents: view every agent that called your API, drill into per-agent detail
258
+ - Agents: view every agent that called your API, drill into per-agent detail with predictive risk
257
259
  - Analytics: revenue charts (7/30/90 days), top endpoints, today's stats
258
260
  - Call Logs: paginated log with time/agent/chain/endpoint/status/cost/latency filters
259
261
  - API Keys: generate, copy, and revoke operator API keys (val_op_ prefix)
@@ -292,6 +294,7 @@ GET /operator/analytics/revenue?days=30
292
294
  GET /operator/analytics/top-endpoints?limit=10
293
295
  GET /operator/analytics/agents?sortBy=lastSeen&limit=50&offset=0
294
296
  GET /operator/analytics/agents/{agentId}
297
+ GET /operator/analytics/agents/{agentId}/prediction
295
298
  GET /operator/analytics/logs?limit=50&offset=0&days=7
296
299
 
297
300
  POST /operator/playground
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@valiron/sdk",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Official TypeScript SDK for Valiron — Trust & Reputation Middleware for API Protection",
5
5
  "repository": {
6
6
  "type": "git",