@valiron/sdk 2.1.0 → 2.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 +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/operatorSdk.d.ts +8 -0
- package/dist/operatorSdk.js +8 -0
- package/docs/API-REFERENCE.md +53 -80
- package/docs/CRAWLER-PROTECTION.md +339 -24
- package/docs/DASHBOARD.md +61 -219
- package/docs/E2E-MIDDLEWARE-INTEGRATION.md +9 -46
- package/docs/ERRORS.md +1 -11
- package/docs/PROVIDER-IDENTITY.md +1 -1
- package/docs/QUICKSTART.md +2 -23
- package/docs/README.md +5 -10
- package/docs/SDK-REFERENCE.md +8 -9
- package/docs/SECURITY-UPGRADE-2026-10-31.md +3 -3
- package/docs/llms.txt +10 -15
- package/package.json +1 -1
- package/docs/AGENT-READY-APIS.md +0 -294
package/docs/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Valiron — Documentation
|
|
2
2
|
|
|
3
|
-
Social Graph (Icebreaker) is
|
|
3
|
+
Each product includes 10,000 requests a month on Free and 100,000 on Pro ($149/month), then $0.001 per additional request once enabled. Social Graph (Icebreaker) is Pro only. Crawler Protection traffic insights and the edge rules simulator are included with Pro; Crawler Protection enforcement (Cloudflare, AWS WAF, and the SDK/gateway runtime) is a $29.99/month add-on to Pro. Everything else in Agent Access is included with Free, with 5 sandbox runs/day. Enterprise: email founders@valiron.co. Operator authentication and tenant isolation apply on every plan.
|
|
4
4
|
|
|
5
|
-
Choose a product in the [documentation home](https://www.valiron.co/docs): [Crawler Protection](https://www.valiron.co/docs/crawler-protection)
|
|
5
|
+
Choose a product in the [documentation home](https://www.valiron.co/docs): [Crawler Protection](https://www.valiron.co/docs/crawler-protection) or [Agent Access](https://www.valiron.co/docs/agent-access). Each product has its own setup guide and navigation; accounts and billing are shared. The Markdown references below retain their existing URLs.
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
> **Protect your API endpoints from bad or malicious AI agents.** This documentation covers how to integrate Valiron into your API to gate, score, and sandbox agents before they reach your infrastructure.
|
|
@@ -13,22 +13,19 @@ Valiron is trust infrastructure for API sellers. It evaluates AI agents using on
|
|
|
13
13
|
|
|
14
14
|
**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.
|
|
15
15
|
|
|
16
|
-
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.
|
|
17
|
-
|
|
18
16
|
## Documentation Index
|
|
19
17
|
|
|
20
18
|
| File | Purpose |
|
|
21
19
|
|------|---------|
|
|
22
20
|
| [QUICKSTART.md](./QUICKSTART.md) | Install the SDK, configure caller verification and gate an endpoint |
|
|
23
21
|
| [E2E-MIDDLEWARE-INTEGRATION.md](./E2E-MIDDLEWARE-INTEGRATION.md) | End-to-end middleware integration — identity, trust signals, downstream policy, and testing |
|
|
24
|
-
| [
|
|
25
|
-
| [DASHBOARD.md](./DASHBOARD.md) | Operator Dashboard — manage endpoints, keys, analytics, and playground |
|
|
22
|
+
| [DASHBOARD.md](./DASHBOARD.md) | Operator Dashboard — manage keys, agents, analytics, and logs |
|
|
26
23
|
| [API-REFERENCE.md](./API-REFERENCE.md) | Complete HTTP API reference with request/response schemas |
|
|
27
24
|
| [SDK-REFERENCE.md](./SDK-REFERENCE.md) | TypeScript SDK methods, signatures, and usage examples |
|
|
28
25
|
| [TRUST-MODEL.md](./TRUST-MODEL.md) | How agents are scored, what behaviors are penalized, tier assignments |
|
|
29
26
|
| [IDENTITY.md](./IDENTITY.md) | Agent identity — ERC-8004/Solana agents and key-based Web2 agents |
|
|
30
27
|
| [PROVIDER-IDENTITY.md](./PROVIDER-IDENTITY.md) | Provider-backed identity — SDK signing helpers and gates, normalized proofs, replay protection, policies, and ANS |
|
|
31
|
-
| [CRAWLER-PROTECTION.md](./CRAWLER-PROTECTION.md) | Valiron Crawler Protection 0.6.0
|
|
28
|
+
| [CRAWLER-PROTECTION.md](./CRAWLER-PROTECTION.md) | Valiron Crawler Protection — read-only traffic insights from request logs (Pro) (Cloudflare, AWS WAF, CloudFront, server logs or SDK request log); 0.6.0 official AI source verification, explicit allow/block defaults, shared quotas, HTTP gateway and language-neutral work admission |
|
|
32
29
|
| [SANDBOX.md](./SANDBOX.md) | How the sandbox evaluates agents and determines production readiness |
|
|
33
30
|
| [CHAINS.md](./CHAINS.md) | Supported blockchain networks and contract addresses |
|
|
34
31
|
| [ERRORS.md](./ERRORS.md) | Error codes, troubleshooting, and retry guidance |
|
|
@@ -42,8 +39,6 @@ Valiron also provides **API Scaffolding** as a separate product for organization
|
|
|
42
39
|
- **Trust Tier**: AAA (highest trust) → C (lowest trust). Assigned based on behavioral evaluation.
|
|
43
40
|
- **Risk Level**: GREEN, YELLOW, or RED.
|
|
44
41
|
- **Route Decision**: `prod`, `prod_throttled`, `sandbox`, or `sandbox_only` — determines what access level your API should give.
|
|
45
|
-
- **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.
|
|
46
|
-
- **Payment Protocol**: `x402` for Base/USDC HTTP payments or `mpp` for Machine Payment Protocol payments through Tempo.
|
|
47
42
|
- **Sandbox**: An isolated test environment where Valiron evaluates agent behavior before granting production access.
|
|
48
43
|
- **Wallet Intelligence**: A Free trust signal that converts bounded Alchemy or Helius wallet history into an explainable score, risk level, confidence, and reasons.
|
|
49
44
|
- **Liveness** (Solana only): Endpoint health probe via `isItAlive()`. See [API-REFERENCE.md](./API-REFERENCE.md#solana-support).
|
|
@@ -88,7 +83,7 @@ https://valiron-edge-proxy.onrender.com
|
|
|
88
83
|
|
|
89
84
|
Follow [Request-bound identity upgrade](./SECURITY-UPGRADE-2026-10-31.md) before deploying the hardened source contract. Configure local verifiers and hosted signers, migrate provider proofs to v2, re-verify legacy World ID/Self links and re-register tenant-scoped webhooks. Check package availability separately from source changes.
|
|
90
85
|
|
|
91
|
-
Both products include 100,000 requests on Pro, then 0.001 per additional call
|
|
86
|
+
Both products include 100,000 requests on Pro, then $0.001 per additional call with separate opt-ins. See [monthly request billing](./API-REFERENCE.md#monthly-request-allowance).
|
|
92
87
|
|
|
93
88
|
Track both products in [Dashboard → Usage](https://www.valiron.co/dashboard/usage): monthly admitted requests, remaining allowance, additional calls and estimated request-overage charges. Counts refresh every 15 seconds while visible; usage billing and traffic analytics use separate data sources.
|
|
94
89
|
|
package/docs/SDK-REFERENCE.md
CHANGED
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
See the [security upgrade guide](SECURITY-UPGRADE-2026-10-31.md) before upgrading existing integrations: trust gates require request-bound identity verification, and enrollment and signed-request contracts have changed.
|
|
6
6
|
|
|
7
|
-
Social Graph (Icebreaker) is
|
|
7
|
+
Each product includes 10,000 requests a month on Free and 100,000 on Pro ($149/month), then $0.001 per additional request once enabled. Social Graph (Icebreaker) is Pro only. Crawler Protection traffic insights and the edge rules simulator are included with Pro; Crawler Protection enforcement (Cloudflare, AWS WAF, and the SDK/gateway runtime) is a $29.99/month add-on to Pro. Everything else in Agent Access is included with Free, with 5 sandbox runs/day. Enterprise: email founders@valiron.co. Operator authentication and tenant isolation apply on every plan.
|
|
8
8
|
|
|
9
9
|
Package: `@valiron/sdk`
|
|
10
10
|
|
|
11
11
|
Crawler source checks and shared work admission belong to the separate `@valiron/crawler-protection` integration package. `createCrawlerGateway()`, `createCrawlerWorkServer()`, `createCrawlerRuntime()`, `CrawlerGuard`, `RedisAdmission`, `createNodeCrawlerMiddleware()` and `createNuxtCrawlerMiddleware()` are exports of that package, not `@valiron/sdk`. The gateway fronts HTTP origins independently of their application language. The private work API is database-independent but requires operation integration and confirmed settlement. A Python client is included; SQLite and MariaDB are tested, while other drivers/stacks require validation. Install it with `npm install @valiron/crawler-protection`. See [controlled crawler access](./CRAWLER-PROTECTION.md) for its integration and recovery contracts.
|
|
12
12
|
|
|
13
|
-
Crawler SDK 0.3.0+ requires
|
|
13
|
+
Crawler SDK 0.3.0+ requires an operator API key for a Pro account with the Crawler Protection add-on (or Enterprise) and account-bound activation via `activateCrawlerProtection()` before constructing its runtime. Activation uses a short-lived local lease, refreshed in the background. Each protected HTTP request requires hosted monthly quota admission; database operations are not counted again. See the crawler guide for revocation, outage and recovery behavior.
|
|
14
14
|
|
|
15
15
|
For the current crawler integration, install `@valiron/crawler-protection@^0.6.0`. It adds official Anthropic and Google agent/Notebook feeds alongside OpenAI support, and `crawlerAccessDefault` / `unverifiedAccess` configuration. These are customer-runtime controls, not hosted policy-deployment APIs. See [selected AI services and upgrade steps](./CRAWLER-PROTECTION.md#allow-selected-ai-services); source verification does not grant unlimited access or authorize account actions.
|
|
16
16
|
|
|
@@ -304,7 +304,7 @@ console.log(result.valironScore); // 85
|
|
|
304
304
|
|
|
305
305
|
### gate(agentId, options?)
|
|
306
306
|
|
|
307
|
-
Low-level hosted gate combining on-chain reputation and sandbox tests. The HTTP endpoint requires an operator API key plus a fresh registry-owner signature bound to this request. Configure `signRequest` with the [wallet-request v2 contract](./SECURITY-UPGRADE-2026-10-31.md#hosted-
|
|
307
|
+
Low-level hosted gate combining on-chain reputation and sandbox tests. The HTTP endpoint requires an operator API key plus a fresh registry-owner signature bound to this request. Configure `signRequest` with the [wallet-request v2 contract](./SECURITY-UPGRADE-2026-10-31.md#hosted-gates-and-proxy). An API key, a claimed address, or a prior agent session alone is insufficient. Local middleware instead calls your `verifyRequest` verifier before authenticated profile reads.
|
|
308
308
|
|
|
309
309
|
```typescript
|
|
310
310
|
const result = await valiron.gate(agentId: string, options?: {
|
|
@@ -680,7 +680,7 @@ Deprecated; retained for compatibility until the next major SDK release. Not sup
|
|
|
680
680
|
|
|
681
681
|
## Telemetry
|
|
682
682
|
|
|
683
|
-
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.
|
|
683
|
+
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.
|
|
684
684
|
|
|
685
685
|
SDK reports are anonymous client reports and may be sampled. Signal counts describe reported selections, not successful verifications. Version comes from the shipped package metadata. Environment defaults to recognized `NODE_ENV` values (`production` → `prod`, `development` → `dev`, `test` → `test`), otherwise `unknown`; set it explicitly for browser applications. Telemetry observer failures do not affect API calls.
|
|
686
686
|
|
|
@@ -949,7 +949,6 @@ Headers attached to proxied/gated requests:
|
|
|
949
949
|
```typescript
|
|
950
950
|
import {
|
|
951
951
|
ValironSDK,
|
|
952
|
-
ValironOperator,
|
|
953
952
|
ValironClient,
|
|
954
953
|
createValironGate,
|
|
955
954
|
valironFastifyPlugin,
|
|
@@ -986,15 +985,15 @@ import {
|
|
|
986
985
|
| World ID and Self | ✓ | ✓ |
|
|
987
986
|
| Social Graph (Icebreaker) | — | ✓ |
|
|
988
987
|
| Valiron Crawler Protection | ✓ | ✓ |
|
|
989
|
-
| Monthly
|
|
990
|
-
| Monthly
|
|
988
|
+
| Monthly Agent Access requests | 10,000 | 100,000 |
|
|
989
|
+
| Monthly Crawler Protection requests | 10,000 | 100,000 |
|
|
991
990
|
|
|
992
991
|
Pro plan requires an operator API key (`val_op_` prefix) from the [Operator Dashboard](./DASHBOARD.md).
|
|
993
992
|
|
|
994
|
-
Usage billing: website signup and a server-side operator API key are required. Free includes 10,000 requests per product per UTC month; Pro includes 100,000 per product. An active paid Pro subscriber can separately enable additional
|
|
993
|
+
Usage billing: website signup and a server-side operator API key are required. Free includes 10,000 requests per product per UTC month; Pro includes 100,000 per product. An active paid Pro subscriber can separately enable additional Crawler Protection or Agent Access calls at $0.001 each. Each product has its own allowance, meter and opt-in. Without opt-in, that product stops at 100,000; Free must upgrade after 10,000. Billing uses durable hosted admission counters, not optional telemetry or every local SDK function call. SDK 0.5.0 also requires account activation for returning-browser recognition.
|
|
995
994
|
|
|
996
995
|
Track both products in [Dashboard → Usage](https://www.valiron.co/dashboard/usage): monthly admitted requests, remaining allowance, additional calls and estimated request-overage charges. Counts refresh every 15 seconds while visible; usage billing and traffic analytics use separate data sources.
|
|
997
996
|
|
|
998
997
|
## Crawler managed controls (0.7.0+)
|
|
999
998
|
|
|
1000
|
-
`createCrawlerControlClient({ configuration, apiKey, site })` adds background policy polling; pass it as `controlClient` to `createCrawlerRuntime`. The dashboard manages crawler access and tighter request budgets within installed ceilings, with publish/rollback, runtime revision acknowledgments, optional bounded recent decision logs and opt-in alerts. It does not deploy customer infrastructure or change work concurrency. Static runtimes are unchanged. See [Dashboard controls](./CRAWLER-PROTECTION.md#
|
|
999
|
+
`createCrawlerControlClient({ configuration, apiKey, site })` adds background policy polling; pass it as `controlClient` to `createCrawlerRuntime`. The dashboard manages crawler access and tighter request budgets within installed ceilings, with publish/rollback, runtime revision acknowledgments, optional bounded recent decision logs and opt-in alerts. It does not deploy customer infrastructure or change work concurrency. Static runtimes are unchanged. See [Dashboard controls](./CRAWLER-PROTECTION.md#managed-controls) for the setup, API endpoints, leases and retention limits.
|
|
@@ -12,7 +12,7 @@ For provider-backed identities, use the built-in identity middleware described i
|
|
|
12
12
|
|
|
13
13
|
New agents remain denied while their real sandbox evaluation is pending. Provisional simulations do not establish behavioral reputation.
|
|
14
14
|
|
|
15
|
-
## Hosted
|
|
15
|
+
## Hosted gates and proxy
|
|
16
16
|
|
|
17
17
|
SDK clients can provide a `signRequest({ method, url, body, chain })` callback in `ValironConfig`. It returns the proof headers for the actual URL and serialized body; signing finishes before the network timeout starts. The signer must create a new nonce and timestamp for each call.
|
|
18
18
|
|
|
@@ -31,7 +31,7 @@ nonce:<fresh-nonce>
|
|
|
31
31
|
|
|
32
32
|
The body hash covers `JSON.stringify` of the parsed JSON body, or the empty string for a request without a body. The server checks the current registry owner and atomically consumes the nonce. Send a newly signed request for each retry. Provider-identity middleware instead hashes exact raw body bytes; these are separate proof protocols.
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
Crawler Protection applies local rate and access decisions before monthly admission; monthly exhaustion still prevents origin work.
|
|
35
35
|
|
|
36
36
|
## Identity enrollment and endpoints
|
|
37
37
|
|
|
@@ -45,7 +45,7 @@ Operator usage analytics now require explicit `analytics: true`. Raw IP addresse
|
|
|
45
45
|
|
|
46
46
|
## Upgrade checklist
|
|
47
47
|
|
|
48
|
-
1. Configure application-owned verifiers for local gates
|
|
48
|
+
1. Configure application-owned verifiers for local gates. An invalid or absent verifier returns `AGENT_OWNERSHIP_REQUIRED` (401); failed trust checks return 403.
|
|
49
49
|
2. Configure hosted request signers and migrate provider identities to proof v2. Each payment retry also needs a new identity nonce.
|
|
50
50
|
3. Re-verify older World ID/Self links and re-register operator/chain-scoped webhook subscriptions. Expect cold reputation decisions to deny until a real evaluation completes.
|
|
51
51
|
4. Enable operator analytics only with explicit `analytics: true`; SDK diagnostic telemetry remains separately configured.
|
package/docs/llms.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Valiron
|
|
2
2
|
|
|
3
|
-
Valiron provides decision-time agent access control
|
|
3
|
+
Valiron provides decision-time agent access control and crawler protection. These documents describe the hardened source contract. Merging source, publishing npm packages and deploying production services are separate steps; confirm the installed version supports the verifier/signer and provider proof v2 contract before upgrading.
|
|
4
4
|
|
|
5
5
|
## Documentation
|
|
6
6
|
|
|
@@ -14,7 +14,6 @@ Valiron provides decision-time agent access control, crawler protection and a se
|
|
|
14
14
|
- Identity and enrollment: https://www.valiron.co/docs/agents/IDENTITY.md
|
|
15
15
|
- Key enrollment: https://www.valiron.co/auth.md
|
|
16
16
|
- Crawler protection: https://www.valiron.co/docs/agents/CRAWLER-PROTECTION.md
|
|
17
|
-
- Hosted wrappers: https://www.valiron.co/docs/agents/AGENT-READY-APIS.md
|
|
18
17
|
- Dashboard: https://www.valiron.co/docs/agents/DASHBOARD.md
|
|
19
18
|
- Trust model: https://www.valiron.co/docs/agents/TRUST-MODEL.md
|
|
20
19
|
- Errors: https://www.valiron.co/docs/agents/ERRORS.md
|
|
@@ -26,13 +25,13 @@ Create an operator account at https://www.valiron.co/dashboard. Password signup
|
|
|
26
25
|
|
|
27
26
|
Profile/status reads and trust operations require Authorization: Bearer val_op_.... Missing, invalid or revoked credentials return 401. Health and key-registration challenge/verify are intentionally accessible without an operator key. Key enrollment establishes possession of that key, not authority for later requests. The private Icebreaker view accepts a Pro operator key or a verified agent session scoped to its own address. Legacy global evaluation histories and platform statistics are administrator-only; use account-scoped dashboard analytics.
|
|
28
27
|
|
|
29
|
-
Profiles return allowlisted identity/trust summaries, not raw behavioral metrics, evidence-storage URLs, credential subjects or nullifiers. Social Graph (Icebreaker) is Pro; standard identity, World ID, Self
|
|
28
|
+
Profiles return allowlisted identity/trust summaries, not raw behavioral metrics, evidence-storage URLs, credential subjects or nullifiers. Social Graph (Icebreaker) is Pro; standard identity, World ID, Self and wallet signals are included with Free within limits. Crawler Protection needs Pro, and enforcement is a $29.99/month add-on.
|
|
30
29
|
|
|
31
30
|
## Fresh request verification
|
|
32
31
|
|
|
33
32
|
x-agent-id identifies an ERC-8004 token ID or Solana asset/indexed ID. x-agent-address identifies a persistent Ethereum-style key-based agent. Neither header proves the current caller controls that identity.
|
|
34
33
|
|
|
35
|
-
createValironGate, valironFastifyPlugin, createValironNextMiddleware
|
|
34
|
+
createValironGate, valironFastifyPlugin, createValironNextMiddleware require verifyRequest(request, identifier). valironGateCheck requires verifyRequest(identifier); capture the current request in that callback. The verifier is application-owned, not a header-presence test or an SDK stub. Verify cryptographic control, identity, method, full URL, body, freshness and atomic nonce replay protection. It runs before cached reputation. Missing/invalid proof returns AGENT_OWNERSHIP_REQUIRED (401). Profile lookup, prior key enrollment, human linkage and payment do not replace action authorization.
|
|
36
35
|
|
|
37
36
|
Cached decisions include signal selection and score threshold. Pending or provisional sandbox results deny production access. A real completed evaluation is required. Preserve the same identity and retry with a new proof after retryAfterMs.
|
|
38
37
|
|
|
@@ -76,20 +75,16 @@ Self session creation also requires operator and owner approval. Only new owner-
|
|
|
76
75
|
|
|
77
76
|
## Pricing, quotas and billing
|
|
78
77
|
|
|
79
|
-
Free: 10,000
|
|
78
|
+
Free: 10,000 Agent Access requests and a separate 10,000 Crawler Protection requests per UTC calendar month and five sandbox runs/day. Pro: $149/month, 100,000 requests per product and Social Graph. Enterprise: founders@valiron.co. Limits never auto-upgrade accounts. Additional calls for either product cost $0.001 each and require separate explicit opt-in.
|
|
80
79
|
|
|
81
|
-
|
|
80
|
+
Crawler local access/rate denials precede monthly admission. Database operations are not counted as additional monthly crawler requests. Storage failures fail closed.
|
|
82
81
|
|
|
83
82
|
Checkout/subscriptions are bound to the authenticated operator's customer identity, not a supplied checkout email. Promotion eligibility is handled by Stripe checkout. Successful password resets revoke existing operator sessions and API keys; sign in again and replace affected integration keys.
|
|
84
83
|
|
|
85
|
-
## Hosted API Scaffolding
|
|
86
|
-
|
|
87
|
-
Configure an existing public HTTPS upstream in Dashboard → API Scaffolding. Agents call /wrap/{operatorId}/{path}. Wrappers apply configured payment (x402 or MPP), trust, rate and forwarding policies. Protect origins against direct bypass using HMAC upstream authentication; x-valiron-* metadata is not an origin credential.
|
|
88
|
-
|
|
89
|
-
Trust-enabled wrappers require x-agent-id, x-chain matching the signed network, and the fresh owner-proof headers above. A payment proof alone is insufficient. A signed payment retry must use a new identity nonce. Only supported on-chain identities are accepted here; use your own SDK middleware for key-based agents. Disabling wrapper trust skips identity/trust policy, not rate, monthly quota or safe-forwarding controls.
|
|
90
|
-
|
|
91
84
|
## Crawler Protection
|
|
92
85
|
|
|
86
|
+
Observability (read-only, Pro and Enterprise): connect request logs to see verified crawlers, spoofed crawler claims, other declared automation and unclassified traffic by route, without installing the runtime or changing traffic. Sources: Cloudflare Logpush (HTTP destination), AWS WAF or CloudFront real-time logs through Amazon Data Firehose, file uploads (CloudFront, ALB, nginx/Apache/Caddy combined, Vercel, Cloudflare, WAF, Valiron NDJSON), any log shipper posting to POST /ingest/crawler/logs/:connectionId with a per-connection vcl_ token, or createCrawlerRequestLog() from @valiron/crawler-protection for sites without log access. Query strings, cookies and headers other than User-Agent are discarded; client IPs are stored only as keyed hashes. Unclassified traffic is never labeled human. Guide: https://www.valiron.co/docs/crawler-protection/observability. Policy simulator and edge protection: replay a policy against observed traffic (exact block matches, rate limits estimated with Cloudflare or AWS WAF counting), then, with the Crawler Protection add-on ($29.99/month on top of Pro), deploy it as Valiron-managed Cloudflare or AWS WAF rules. The dashboard shows Protecting only after provider read-back; turning off removes only Valiron rules. Guide: https://www.valiron.co/docs/crawler-protection/edge-protection
|
|
87
|
+
|
|
93
88
|
Install @valiron/crawler-protection@^0.6.0 separately. The standalone Node.js 22+ HTTP gateway fronts origins regardless of backend language; in-process Node/Nuxt adapters and a private authenticated work API/Python client are available. Python/SQLite and Node/Nuxt/MariaDB are tested. Wrap every expensive operation and release capacity only after confirmed settlement/cancellation. Gateway-only limits do not instrument database drivers or protect a bypassed origin.
|
|
94
89
|
|
|
95
90
|
Supported source evidence uses reviewed official CIDRs, Bing DNS or authenticated verified WAF evidence. Crawler SDK 0.4.0 adds opt-in WebBotAuthVerifier fallback for operator-pinned signing keys; only explicitly promoted valid signers receive verified budgets, and existing trusted/IP/DNS verification takes precedence. Signature validity proves key control, not good intent or authorization. User-agent alone grants no verification; generic browser tokens cannot override failed official crawler evidence. In 0.6.0, feed-backed directory approvals pin identity metadata and recipes while allowing validated CIDRs to refresh. Static recipes pin their resolved ranges too. Regenerate old approval hashes when upgrading, and review changed identity metadata or static ranges. Invalid/broad range sets disable only the affected entry; structurally invalid catalogs still reject atomically. Bare addresses normalize to host ranges. Provenance is separate from human identity, reputation or intent.
|
|
@@ -98,7 +93,7 @@ SDK 0.6.0 verifies OpenAI oai-searchbot/chatgpt-user/gptbot; Anthropic claude-se
|
|
|
98
93
|
|
|
99
94
|
Set crawlerAccessDefault to deny and configure explicit budget rules by provider/class/group to deny other verified crawlers. Omitted defaults retain budget behavior. unverifiedAccess budget keeps unknown traffic under conservative limits; deny blocks unknown/failed/expired identity checks, including anonymous humans. Verified customer grants retain independent shopper/checkout lanes. Access rules remain subject to configured rates and workload ceilings. Observation reports proposed blocks rather than enforcing access denials. Changes require customer-side deployment; dashboard filters are not policy controls. See https://www.valiron.co/docs/crawler-protection/policies#allow-selected-ai-services.
|
|
100
95
|
|
|
101
|
-
Use a server-side
|
|
96
|
+
Use a server-side operator key (Pro with the Crawler Protection add-on, or Enterprise) and account-scoped tenant with activateCrawlerProtection(). Leases refresh in the background; protected requests require hosted monthly admission. Expiry/revocation stops new work while confirmed release/recovery remains available. Activation can target an explicitly configured trusted HTTPS service and rejects redirects. Existing public older versions are not retroactively gated.
|
|
102
97
|
|
|
103
98
|
Uncertain acquisitions use deadlines/cancellation to avoid unstarted holds. Started operations retain conservative holds until confirmed stopped. Recovery pauses admission and reconciles exact IDs with drain evidence; timeout alone does not prove a query stopped. The dashboard validates/exports configuration and shows optional origin-reported telemetry; it does not deploy protection or certify rollout.
|
|
104
99
|
|
|
@@ -106,10 +101,10 @@ Crawler SDK 0.4.0 also includes optional returning-browser recognition: a server
|
|
|
106
101
|
|
|
107
102
|
## Reporting and errors
|
|
108
103
|
|
|
109
|
-
SDK diagnostic telemetry remains separately configurable with telemetry.enabled (default true); disable with telemetry: {enabled:false}.
|
|
104
|
+
SDK diagnostic telemetry remains separately configurable with telemetry.enabled (default true); disable with telemetry: {enabled:false}. It sends authenticated decision/identity labels, method, status, price and latency while omitting/redacting raw IP addresses, user agents, paths/query strings and arbitrary error messages.
|
|
110
105
|
|
|
111
106
|
Handle codes: MISSING_AGENT_IDENTITY (401), AGENT_OWNERSHIP_REQUIRED (401), TRUST_GATE_DENIED (403), AGENT_EVALUATION_PENDING (403; honor retryAfterMs), TRUST_GATE_UNAVAILABLE (503). Ownership failures may contain only code/error; recovery fields are optional. Never fail open or bypass a proof check because a profile was cached.
|
|
112
107
|
|
|
113
|
-
Usage billing: website signup and a server-side operator API key are required. Free includes 10,000 requests per product per UTC month; Pro includes 100,000 per product. An active paid Pro subscriber can separately enable additional
|
|
108
|
+
Usage billing: website signup and a server-side operator API key are required. Free includes 10,000 requests per product per UTC month; Pro includes 100,000 per product. An active paid Pro subscriber can separately enable additional Crawler Protection or Agent Access calls at $0.001 each. Each product has its own allowance, meter and opt-in. Without opt-in, that product stops at 100,000; Free must upgrade after 10,000. Billing uses durable hosted admission counters, not optional telemetry or every local SDK function call. SDK 0.5.0 also requires account activation for returning-browser recognition.
|
|
114
109
|
|
|
115
110
|
Dashboard Usage: https://www.valiron.co/dashboard/usage — per-product monthly admitted requests, remaining allowance and accrued request-overage estimates; refreshes every 15 seconds while visible. Billing counters are separate from optional crawler traffic telemetry.
|
package/package.json
CHANGED
package/docs/AGENT-READY-APIS.md
DELETED
|
@@ -1,294 +0,0 @@
|
|
|
1
|
-
# API Scaffolding
|
|
2
|
-
|
|
3
|
-
API Scaffolding is a separate Valiron product for exposing existing HTTPS APIs through hosted, agent-facing URLs. It can add x402 or MPP payment handling, optional Valiron trust checks, rate limits, upstream forwarding, and usage logs without requiring immediate SDK middleware integration.
|
|
4
|
-
|
|
5
|
-
Use this flow when Valiron should host the payment and optional trust layer for an existing HTTPS API:
|
|
6
|
-
|
|
7
|
-
```text
|
|
8
|
-
Agent or client
|
|
9
|
-
-> Valiron-hosted wrapper URL
|
|
10
|
-
-> x402 or MPP payment check
|
|
11
|
-
-> optional Valiron trust check
|
|
12
|
-
-> provider's existing API
|
|
13
|
-
-> response returned through Valiron
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
> **Important: protect the origin.** A hosted wrapper evaluates and logs only
|
|
17
|
-
> requests sent to its Valiron URL. It is not a network firewall in front of a
|
|
18
|
-
> separately public API origin. If callers can reach your origin directly, they
|
|
19
|
-
> can bypass the wrapper's payment, trust, rate-limit, and analytics path.
|
|
20
|
-
> Publish the generated wrapper URL as the agent-facing URL and configure your
|
|
21
|
-
> origin to accept only authenticated requests from Valiron.
|
|
22
|
-
|
|
23
|
-
The wrapper is intentionally narrow: Valiron forwards valid HTTP requests to an existing upstream API. It does not need direct database access, internal service access, or provider infrastructure credentials beyond the optional upstream auth secret needed to call the API.
|
|
24
|
-
|
|
25
|
-
## When To Use This
|
|
26
|
-
|
|
27
|
-
Use API Scaffolding when:
|
|
28
|
-
|
|
29
|
-
- You already have an HTTPS API and want to sell per-call access to agents.
|
|
30
|
-
- You want x402 or MPP payment challenges without implementing those protocols yourself.
|
|
31
|
-
- You want Valiron trust checks before paid traffic reaches your API.
|
|
32
|
-
- You need a no-code or low-code path from an existing API to an agent-compatible endpoint.
|
|
33
|
-
|
|
34
|
-
Use the SDK middleware instead when:
|
|
35
|
-
|
|
36
|
-
- You want payments to be handled entirely by your own server.
|
|
37
|
-
- You need custom payment terms, subscriptions, account billing, or business-specific authorization.
|
|
38
|
-
- Valiron should run directly in the API backend as the primary trust and policy enforcement layer.
|
|
39
|
-
|
|
40
|
-
## Provider Setup
|
|
41
|
-
|
|
42
|
-
Providers configure one wrapper per public endpoint.
|
|
43
|
-
|
|
44
|
-
| Field | Required | Description |
|
|
45
|
-
|-------|----------|-------------|
|
|
46
|
-
| Public path | Yes | Path callers use on Valiron, for example `/weather`. |
|
|
47
|
-
| HTTP method | Yes | `GET`, `POST`, `PUT`, `PATCH`, `DELETE`, or `HEAD`. |
|
|
48
|
-
| Upstream base URL | Yes | Existing HTTPS API base URL, for example `https://api.example.com`. |
|
|
49
|
-
| Price per call | Yes | USD amount charged for paid requests. Use `0` for a free wrapper. |
|
|
50
|
-
| Payment protocol | Yes | `x402` or `MPP`. |
|
|
51
|
-
| Payment network | Yes | x402: `eip155:8453` or `eip155:84532`; MPP: `tempo:4217` or `tempo:42431`. |
|
|
52
|
-
| Payout wallet | Paid only | EVM address receiving payment. |
|
|
53
|
-
| Upstream auth | Required to prevent origin bypass | Auth Valiron adds when forwarding to your upstream. Use `hmac` for a public origin. |
|
|
54
|
-
| Rate limit | No | Max requests per minute per client. |
|
|
55
|
-
| Trust check | No | Whether callers must pass Valiron agent trust evaluation before forwarding. |
|
|
56
|
-
|
|
57
|
-
Example existing API:
|
|
58
|
-
|
|
59
|
-
```text
|
|
60
|
-
GET https://api.example.com/weather
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
Example Valiron URL:
|
|
64
|
-
|
|
65
|
-
```text
|
|
66
|
-
GET https://valiron-edge-proxy.onrender.com/wrap/{operatorId}/weather
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
Valiron preserves query strings and appends the public wrapper path to the upstream base URL. If your upstream base URL is `https://api.example.com/v1` and your public path is `/weather`, Valiron forwards to:
|
|
70
|
-
|
|
71
|
-
```text
|
|
72
|
-
https://api.example.com/v1/weather
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
## Dashboard Flow
|
|
76
|
-
|
|
77
|
-
1. Open [valiron.co/dashboard](https://www.valiron.co/dashboard).
|
|
78
|
-
2. Choose **API Scaffolding → Endpoints & testing**.
|
|
79
|
-
3. Click **Make API Agent-Ready**.
|
|
80
|
-
4. Enter the upstream URL, public path, method, price, protocol, network, and payout wallet.
|
|
81
|
-
5. Choose whether Valiron trust checks are required.
|
|
82
|
-
6. Configure upstream authentication. For a public origin, choose `hmac` and
|
|
83
|
-
store the same secret in your origin's verification middleware.
|
|
84
|
-
7. Create the wrapper.
|
|
85
|
-
8. Distribute only the generated Valiron URL to agent clients or API customers.
|
|
86
|
-
9. Verify that a direct request to your origin is rejected and a request to the
|
|
87
|
-
wrapper is recorded in Valiron call logs.
|
|
88
|
-
|
|
89
|
-
Create, list, and deactivate wrappers in the dashboard.
|
|
90
|
-
|
|
91
|
-
## Calling A Wrapper
|
|
92
|
-
|
|
93
|
-
Call the generated URL directly:
|
|
94
|
-
|
|
95
|
-
```bash
|
|
96
|
-
curl -i https://valiron-edge-proxy.onrender.com/wrap/{operatorId}/weather
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
For a free wrapper, Valiron forwards immediately and returns the upstream response with Valiron wrapper headers:
|
|
100
|
-
|
|
101
|
-
```text
|
|
102
|
-
x-valiron-wrapper-id: ...
|
|
103
|
-
x-valiron-payment-protocol: free
|
|
104
|
-
x-valiron-trust-enabled: false
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
For a paid x402 wrapper without payment, Valiron returns `402` and an x402 payment challenge:
|
|
108
|
-
|
|
109
|
-
```text
|
|
110
|
-
HTTP/1.1 402 Payment Required
|
|
111
|
-
x-payment-required: ...
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
For a paid MPP wrapper without payment, Valiron returns `402` and an MPP challenge:
|
|
115
|
-
|
|
116
|
-
```text
|
|
117
|
-
HTTP/1.1 402 Payment Required
|
|
118
|
-
WWW-Authenticate: Payment ...
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
## x402 Paid Client
|
|
122
|
-
|
|
123
|
-
Use an x402-capable client to retry with payment. The example below uses:
|
|
124
|
-
|
|
125
|
-
- `@x402/fetch`
|
|
126
|
-
- `@x402/core/client`
|
|
127
|
-
- `@x402/evm/exact/client`
|
|
128
|
-
- `viem/accounts`
|
|
129
|
-
|
|
130
|
-
Minimal client shape:
|
|
131
|
-
|
|
132
|
-
```typescript
|
|
133
|
-
import { wrapFetchWithPayment } from "@x402/fetch";
|
|
134
|
-
import { x402Client } from "@x402/core/client";
|
|
135
|
-
import { ExactEvmScheme } from "@x402/evm/exact/client";
|
|
136
|
-
import { privateKeyToAccount } from "viem/accounts";
|
|
137
|
-
|
|
138
|
-
const account = privateKeyToAccount(process.env.BUYER_PRIVATE_KEY as `0x${string}`);
|
|
139
|
-
|
|
140
|
-
const client = new x402Client();
|
|
141
|
-
client.register("eip155:*", new ExactEvmScheme(account));
|
|
142
|
-
|
|
143
|
-
const fetchWithPayment = wrapFetchWithPayment(fetch, client);
|
|
144
|
-
|
|
145
|
-
const response = await fetchWithPayment(
|
|
146
|
-
"https://valiron-edge-proxy.onrender.com/wrap/{operatorId}/weather",
|
|
147
|
-
{ method: "GET", headers: { "x-agent-id": "25459" } }
|
|
148
|
-
);
|
|
149
|
-
|
|
150
|
-
console.log(response.status);
|
|
151
|
-
console.log(await response.text());
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
The buyer wallet must hold the required token on the selected x402 network. For Base mainnet, the default production path expects USDC on Base.
|
|
155
|
-
|
|
156
|
-
## MPP Paid Client
|
|
157
|
-
|
|
158
|
-
Valiron MPP support uses the official `mppx` SDK with the Tempo `charge` intent.
|
|
159
|
-
|
|
160
|
-
Server behavior:
|
|
161
|
-
|
|
162
|
-
- Unpaid request returns `402`.
|
|
163
|
-
- Response includes `WWW-Authenticate: Payment ...`.
|
|
164
|
-
- Paid request includes `Authorization: Payment ...`.
|
|
165
|
-
- Successful paid response includes `Payment-Receipt`.
|
|
166
|
-
|
|
167
|
-
Recommended testnet client flow:
|
|
168
|
-
|
|
169
|
-
```bash
|
|
170
|
-
pnpm exec mppx account create
|
|
171
|
-
pnpm exec mppx https://valiron-edge-proxy.onrender.com/wrap/{operatorId}/research
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
Use `tempo:42431` for Tempo testnet and `tempo:4217` for Tempo mainnet.
|
|
175
|
-
|
|
176
|
-
Default Tempo currencies from `mppx`:
|
|
177
|
-
|
|
178
|
-
| Network | Chain ID | Default currency |
|
|
179
|
-
|---------|----------|------------------|
|
|
180
|
-
| Tempo mainnet | `4217` | USDC (`0x20C000000000000000000000b9537d11c60E8b50`) |
|
|
181
|
-
| Tempo testnet | `42431` | pathUSD (`0x20c0000000000000000000000000000000000000`) |
|
|
182
|
-
|
|
183
|
-
## Optional Trust Checks
|
|
184
|
-
|
|
185
|
-
When `trustEnabled` is `false`, Valiron only handles payment, rate limiting, upstream auth, and forwarding.
|
|
186
|
-
|
|
187
|
-
When `trustEnabled` is `true`, callers must identify the agent:
|
|
188
|
-
|
|
189
|
-
```text
|
|
190
|
-
x-agent-id: 25459
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
Valiron evaluates the agent before forwarding. If the agent is denied, the upstream API is not called.
|
|
194
|
-
|
|
195
|
-
Use trust checks when:
|
|
196
|
-
|
|
197
|
-
- You want to block risky agents even if they can pay.
|
|
198
|
-
- You want route decisions and call logs tied to agent IDs.
|
|
199
|
-
- You plan to vary pricing, limits, or access based on trust tiers.
|
|
200
|
-
|
|
201
|
-
Use payment-only wrappers when:
|
|
202
|
-
|
|
203
|
-
- You want the lowest-friction paid endpoint.
|
|
204
|
-
- You do not need agent identity yet.
|
|
205
|
-
- You are testing x402 or MPP integration.
|
|
206
|
-
|
|
207
|
-
## Upstream Auth
|
|
208
|
-
|
|
209
|
-
Valiron stores the configured secret encrypted and injects or derives it only
|
|
210
|
-
when forwarding a request that has reached the wrapper. This is how your origin
|
|
211
|
-
distinguishes an authenticated wrapper request from a direct public request.
|
|
212
|
-
|
|
213
|
-
For a public API origin, configure upstream authentication before announcing or
|
|
214
|
-
indexing the wrapper. Otherwise, a caller can send traffic directly to the
|
|
215
|
-
origin and bypass Valiron entirely. `none` is appropriate only when the origin
|
|
216
|
-
is already inaccessible to untrusted callers or bypass is intentionally
|
|
217
|
-
acceptable.
|
|
218
|
-
|
|
219
|
-
Supported auth modes:
|
|
220
|
-
|
|
221
|
-
| Mode | Behavior |
|
|
222
|
-
|------|----------|
|
|
223
|
-
| `none` | No upstream auth is added. |
|
|
224
|
-
| `bearer` | Adds `Authorization: Bearer <secret>`. |
|
|
225
|
-
| `api_key` | Adds the secret to the configured header name. |
|
|
226
|
-
| `hmac` | Signs the request using the secret and adds signature headers. |
|
|
227
|
-
|
|
228
|
-
The calling agent never sees your upstream secret.
|
|
229
|
-
|
|
230
|
-
### Recommended production pattern: HMAC origin verification
|
|
231
|
-
|
|
232
|
-
Choose `hmac` for an origin that is publicly reachable. Valiron sends:
|
|
233
|
-
|
|
234
|
-
```text
|
|
235
|
-
x-valiron-signature: sha256=<hex HMAC>
|
|
236
|
-
x-valiron-timestamp: <Unix seconds>
|
|
237
|
-
```
|
|
238
|
-
|
|
239
|
-
Your origin must reject requests when the signature is missing, invalid, or too
|
|
240
|
-
old. Verify the signature against the request method, public wrapper path, raw
|
|
241
|
-
body SHA-256, and timestamp with the shared secret configured on the wrapper.
|
|
242
|
-
Use constant-time signature comparison and a short timestamp window to reduce
|
|
243
|
-
replay risk.
|
|
244
|
-
|
|
245
|
-
Do **not** treat headers such as `x-valiron-wrapper-id`,
|
|
246
|
-
`x-valiron-payment-protocol`, or `x-valiron-trust-enabled` as proof that a
|
|
247
|
-
request came through Valiron. They are request metadata, not a credential, and
|
|
248
|
-
can be forged by a caller that reaches your origin directly.
|
|
249
|
-
|
|
250
|
-
### Origin-lockdown checklist
|
|
251
|
-
|
|
252
|
-
Before production:
|
|
253
|
-
|
|
254
|
-
1. Set `upstreamAuthType` to `hmac` and configure a unique secret.
|
|
255
|
-
2. Deploy origin middleware that verifies the HMAC and timestamp before the API
|
|
256
|
-
handler runs.
|
|
257
|
-
3. Make the Valiron `/wrap/{operatorId}/{path}` URL the only public URL in
|
|
258
|
-
agent discovery metadata, examples, and client configuration.
|
|
259
|
-
4. Send a direct request to the origin without the signature and confirm a
|
|
260
|
-
`401` or `403` response.
|
|
261
|
-
5. Send a request through the wrapper and confirm the expected payment/trust
|
|
262
|
-
result and a corresponding Valiron call-log entry.
|
|
263
|
-
|
|
264
|
-
## Security Defaults
|
|
265
|
-
|
|
266
|
-
In production, Valiron wrappers:
|
|
267
|
-
|
|
268
|
-
- Require HTTPS upstream URLs.
|
|
269
|
-
- Block localhost, private IP ranges, link-local IPs, metadata hosts, and internal hostnames.
|
|
270
|
-
- Resolve upstream DNS and block private resolved IPs.
|
|
271
|
-
- Strip hop-by-hop and sensitive inbound headers before forwarding.
|
|
272
|
-
- Do not forward inbound `Authorization`, `Cookie`, `x-payment`, or `payment-signature` headers to the upstream.
|
|
273
|
-
- Add Valiron wrapper metadata headers to forwarded requests.
|
|
274
|
-
- Apply per-endpoint rate limits.
|
|
275
|
-
- Enforce request body size limits.
|
|
276
|
-
- Time out slow upstream calls.
|
|
277
|
-
|
|
278
|
-
## Current Limits
|
|
279
|
-
|
|
280
|
-
The first wrapper release supports:
|
|
281
|
-
|
|
282
|
-
- Per-call x402 payments.
|
|
283
|
-
- Per-call MPP Tempo charge payments.
|
|
284
|
-
- Free wrappers.
|
|
285
|
-
- Optional trust checks.
|
|
286
|
-
- Optional upstream auth injection.
|
|
287
|
-
- Per-endpoint rate limits.
|
|
288
|
-
|
|
289
|
-
It does not yet support:
|
|
290
|
-
|
|
291
|
-
- MPP sessions or subscriptions.
|
|
292
|
-
- Multi-upstream routing.
|
|
293
|
-
- Cross-protocol fallback on a single endpoint.
|
|
294
|
-
- Non-HTTPS production upstreams.
|