@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
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Valiron Crawler Protection
|
|
2
2
|
|
|
3
|
-
Website guide: [Valiron Crawler Protection documentation](https://www.valiron.co/docs/crawler-protection). Browse the [quickstart](https://www.valiron.co/docs/crawler-protection/quickstart), [integration](https://www.valiron.co/docs/crawler-protection/integration), [bot verification](https://www.valiron.co/docs/crawler-protection/bot-verification), [policies](https://www.valiron.co/docs/crawler-protection/policies), [analytics](https://www.valiron.co/docs/crawler-protection/analytics),
|
|
3
|
+
Website guide: [Valiron Crawler Protection documentation](https://www.valiron.co/docs/crawler-protection). Browse the [traffic insights](https://www.valiron.co/docs/crawler-protection/observability), [edge rules](https://www.valiron.co/docs/crawler-protection/edge-protection), [quickstart](https://www.valiron.co/docs/crawler-protection/quickstart), [integration](https://www.valiron.co/docs/crawler-protection/integration), [bot verification](https://www.valiron.co/docs/crawler-protection/bot-verification), [policies](https://www.valiron.co/docs/crawler-protection/policies), [analytics](https://www.valiron.co/docs/crawler-protection/analytics), [recovery](https://www.valiron.co/docs/crawler-protection/operations), and [plans and usage](https://www.valiron.co/docs/crawler-protection/plans-and-usage) guides.
|
|
4
4
|
|
|
5
|
-
**Plans
|
|
5
|
+
**Plans.** Traffic insights and the edge rules simulator are included with Pro. Blocking traffic, with edge rules at Cloudflare or AWS WAF or with the self-hosted gateway or SDK, needs the **Crawler Protection add-on ($29.99/month on top of Pro)**, or Enterprise. Allowances and usage billing are in [Plans & usage](#what-each-plan-includes).
|
|
6
6
|
|
|
7
7
|
Install `@valiron/crawler-protection` from npm with Node.js 22 or later:
|
|
8
8
|
|
|
@@ -12,35 +12,342 @@ npm install @valiron/crawler-protection
|
|
|
12
12
|
|
|
13
13
|
The package contains the standalone gateway, Node/Nuxt adapters, private work API contract and Python helper. It is separate from `@valiron/sdk`; installing the SDK does not install crawler verification or shared workload admission. Follow the deployment guide after installation.
|
|
14
14
|
|
|
15
|
+
**Traffic insights** (Pro) need no installation: connect existing request logs (Cloudflare, AWS WAF, CloudFront, load balancer or web server) or a passive request logger to see verified crawler traffic without changing how it is handled. See [How traffic insights work](#how-traffic-insights-work). The [simulator](#simulator) replays edge rules against that traffic, and [edge protection](#edge-protection) deploys them to Cloudflare or AWS WAF.
|
|
16
|
+
|
|
15
17
|
The guard combines source verification, weighted route budgets and concurrency controls before protected server work. Crawlers do not need a Valiron account, agent key, wallet or blockchain identity.
|
|
16
18
|
|
|
17
19
|
## Website setup
|
|
18
20
|
|
|
19
|
-
|
|
21
|
+
Self-hosted setup lives in **Dashboard → Crawler Protection → Setup** (`/dashboard/crawler-protection/setup`, Pro and Enterprise). It has three steps:
|
|
22
|
+
|
|
23
|
+
1. **Install the package and create a server-side API key.** **Give this to your coding agent** copies a complete setup prompt.
|
|
24
|
+
2. **Validate your site configuration.** Paste your schema-v1 configuration, optionally with a measured baseline, then download the validated file. **Load example** fills in an illustrative configuration; replace every limit and route before you deploy it.
|
|
25
|
+
3. **Connect your runtime.** Once the gateway or SDK reports, Setup shows it as connected. A report must be less than two minutes old to count.
|
|
26
|
+
|
|
27
|
+
Validating and exporting a configuration does not deploy it or turn protection on. Your team installs the runtime in its own infrastructure. After that, **Self-hosted → Controls** can publish crawler access and tighter budgets within the installed limits. A passing check is not proof of production capacity.
|
|
28
|
+
|
|
29
|
+
## What each plan includes
|
|
30
|
+
|
|
31
|
+
| | Free | Pro | Pro + Crawler Protection add-on | Enterprise |
|
|
32
|
+
| --- | --- | --- | --- | --- |
|
|
33
|
+
| Traffic insights and the edge rules simulator | | ✓ | ✓ | ✓ |
|
|
34
|
+
| Edge protection at Cloudflare or AWS WAF | | | ✓ | ✓ |
|
|
35
|
+
| Self-hosted gateway or SDK | | | ✓ | ✓ |
|
|
36
|
+
|
|
37
|
+
The add-on is $29.99/month on top of Pro ($149/month). Free accounts can view the product but cannot connect traffic, simulate or enforce. Like Agent Access, Crawler Protection includes 10,000 requests a month on Free and 100,000 on Pro, then $0.001 per additional request once enabled. Traffic insights never count toward the allowance.
|
|
38
|
+
|
|
39
|
+
### Allowance and additional requests
|
|
40
|
+
|
|
41
|
+
Each request the self-hosted runtime admits counts as one Crawler Protection request. Agent Access has its own, separate allowance. Allowances reset at the start of each UTC calendar month.
|
|
42
|
+
|
|
43
|
+
At 100,000 requests, Pro stops admitting new protected requests (`429`) unless the account owner has enabled additional calls on an active paid subscription. Each additional request then costs $0.001 and appears on the subscription invoice. Canceled, unpaid or expired billing never authorizes additional requests. Requests denied locally before hosted admission, bypassed routes and operations that are only settling do not count. Once a request is admitted it counts, even if a later capacity check fails. For Enterprise volumes, email founders@valiron.co.
|
|
44
|
+
|
|
45
|
+
### Where to see usage
|
|
46
|
+
|
|
47
|
+
**Dashboard → Usage** (`/dashboard/usage`) shows Crawler Protection and Agent Access requests separately: used, included, remaining, additional calls, estimated charges and the next reset. Counts refresh every 15 seconds. They count hosted admissions only, so CDN cache hits and bypassed routes are not included.
|
|
48
|
+
|
|
49
|
+
To allow requests past the allowance, a Pro owner chooses **Enable additional calls** and accepts the displayed rate. Each product is enabled separately, and installing or upgrading a package never enables charges. Additional usage is recorded before the request is admitted and billed in batches; a billing delivery problem pauses additional calls for review.
|
|
50
|
+
|
|
51
|
+
## How traffic insights work
|
|
52
|
+
|
|
53
|
+
Traffic insights show the automated traffic reaching your website before you change how that traffic is handled. They are included with Pro and Enterprise; Free accounts see an upgrade prompt. You either connect copies of the request logs your CDN, WAF, load balancer or web server already produces, or add a passive request logger to your application. Valiron verifies crawler identities and reports what reaches your pages.
|
|
54
|
+
|
|
55
|
+
Traffic insights are read-only:
|
|
56
|
+
|
|
57
|
+
- It never blocks, challenges, delays or rate-limits a request. It does not change your CDN, WAF, DNS, routing or origin configuration.
|
|
58
|
+
- It does not require the Crawler Protection runtime, Redis, an operator API key or account activation, and it does not consume Crawler Protection request allowances.
|
|
59
|
+
- Your website never depends on Valiron being available. Log sources deliver copies asynchronously; if Valiron's ingestion is unavailable, senders retry and your traffic is unaffected.
|
|
60
|
+
|
|
61
|
+
The self-hosted runtime's **dry run** mode (`observe` in configuration) is a different feature: it evaluates your installed runtime policy in the request path and logs what it would block. Traffic insights only read request records after the fact.
|
|
62
|
+
|
|
63
|
+
### Traffic classes
|
|
64
|
+
|
|
65
|
+
Every observed request is placed in exactly one class. Valiron never labels traffic as human.
|
|
66
|
+
|
|
67
|
+
| Class | Meaning |
|
|
68
|
+
|---|---|
|
|
69
|
+
| Verified crawlers | The client address matched the provider's official published IP ranges, or forward-confirmed reverse DNS (Bing). The same reviewed feeds as the runtime are used; see [Identification and signals](#identification-and-signals). |
|
|
70
|
+
| Claimed, not verified | The User-Agent claims a verifiable crawler, but the address did not match (`claim_mismatch`, typically spoofing) or evidence was unavailable (`verification_unavailable`, for example when the source omits client IPs). |
|
|
71
|
+
| Other declared automation | The User-Agent declares automation that cannot be verified: AI crawlers without a published feed (such as CCBot, Bytespider, Amazonbot, meta-externalagent), other search engines, SEO tools, social previews, uptime monitors, HTTP libraries, headless browsers, and any other User-Agent that does not look like a browser. These are claims only. |
|
|
72
|
+
| Unclassified | Browser-like or missing User-Agents. This includes people and any bot that does not identify itself. |
|
|
73
|
+
|
|
74
|
+
Verification is evaluated against the provider evidence that is current when Valiron processes the record, and the evidence version is stored with each verified request. Edge signals reported by your provider, such as Cloudflare `VerifiedBotCategory` or AWS WAF Bot Control labels, are shown separately (for example `cf:ai-crawler` or `aws:verified:ai`). They are never mapped to a specific provider or treated as Valiron verification.
|
|
75
|
+
|
|
76
|
+
### Data handling and retention
|
|
77
|
+
|
|
78
|
+
Valiron stores only normalized request metadata: request time, host, method, path, normalized route, status, response bytes and timing, cache result, edge action, edge bot signal, country, User-Agent (up to 512 characters), traffic class and verification evidence.
|
|
79
|
+
|
|
80
|
+
- Query strings, fragments, cookies, authorization headers, other headers and request bodies are discarded during parsing and never stored. Configure your source not to send them where possible.
|
|
81
|
+
- Client IP addresses are used during processing for verification only. Valiron stores a keyed, non-reversible hash (scoped to your account) and the /24 (IPv4) or /48 (IPv6) network, never the raw address.
|
|
82
|
+
- Paths are grouped into routes for analytics. Numeric IDs, UUIDs, email addresses, long hex values and token-like segments become `:id`, `:uuid`, `:email`, `:hash` and `:token`.
|
|
83
|
+
- An uploaded or pushed payload is held until it is processed, then deleted. A payload that fails processing five times is kept with a `failed` status for investigation.
|
|
84
|
+
- **Sensitive paths:** list up to 20 path prefixes per website (`PATCH /operator/crawlers/sites/:siteId` with `{ "excludedPaths": ["/account"] }`). Matching requests are still counted, but are stored under the prefix (for example `/account/*`); the requested path is never stored.
|
|
85
|
+
- Observed requests, their hourly and daily summaries, policies and their revisions, simulations, edge deployments and the protection audit trail are retained permanently. They are kept when you change plans, remove the Crawler Protection add-on or close your account.
|
|
86
|
+
- **Removing a website** in **Log sources** hides it from your dashboard and revokes its connections, so no new deliveries are accepted. Data already observed for it is kept. Turn Protection off first: a website with Valiron rules deployed at your edge cannot be removed (`409 disable_protection_first`). You can add the same hostname again later; it starts a new history.
|
|
87
|
+
|
|
88
|
+
### Allowance and coverage
|
|
89
|
+
|
|
90
|
+
Each account has a monthly allowance of stored events: 50,000,000 on Pro. Enterprise has no default limit. Records beyond the allowance are still stored and shown, and are flagged as over allowance; the dashboard then says the month's allowance was exceeded. Delivery to Valiron is never refused because of the allowance, and your traffic is never affected.
|
|
91
|
+
|
|
92
|
+
Every delivery reports how many records were stored, ignored as duplicates, unreadable, or over the allowance. Duplicates are detected by provider request ID (Cloudflare `RayID`, CloudFront `x-edge-request-id`, AWS WAF `requestId`, Vercel request ID, or `request_id` in the Valiron format), so re-sent or overlapping files are not double counted. Formats without a request ID, such as nginx combined logs, are deduplicated by exact line; identical lines within the same second are counted once.
|
|
93
|
+
|
|
94
|
+
Your log provider may charge for log delivery. Cloudflare Logpush availability for HTTP request logs depends on your Cloudflare plan. AWS charges for WAF logging, CloudFront real-time logs, Kinesis and Firehose. Traffic insights are included with Pro.
|
|
95
|
+
|
|
96
|
+
## Connect traffic sources
|
|
97
|
+
|
|
98
|
+
Open **Dashboard → Crawler Protection → Traffic → Log sources** (`/dashboard/crawler-protection/sources`) and add your website hostname. Then choose a source. Each continuous source receives its own connection: a push endpoint `https://valiron-edge-proxy.onrender.com/ingest/crawler/logs/<connection-id>` and a token beginning `vcl_`.
|
|
99
|
+
|
|
100
|
+
The token is shown once. Store it as a secret. It can only append request records to that website; it cannot read analytics, change settings or call any other Valiron API. Revoke a connection in **Log sources** to stop it immediately; data already collected is kept. Create a new connection to rotate a token.
|
|
101
|
+
|
|
102
|
+
| Source | Delivery | Format |
|
|
103
|
+
|---|---|---|
|
|
104
|
+
| Cloudflare | Logpush HTTP destination, or file upload | `cloudflare` (HTTP requests dataset, NDJSON) |
|
|
105
|
+
| AWS WAF | Amazon Data Firehose HTTP endpoint, or file upload | `aws_waf` |
|
|
106
|
+
| Amazon CloudFront real-time logs | Kinesis Data Streams → Firehose HTTP endpoint | `cloudfront_realtime` |
|
|
107
|
+
| Amazon CloudFront standard logs | File upload | `cloudfront` (W3C or JSON) |
|
|
108
|
+
| AWS Application Load Balancer | File upload | `aws_alb` |
|
|
109
|
+
| nginx, Apache, Caddy | File upload, or push with Vector or Fluent Bit | `combined` (optional leading virtual host and trailing request time) |
|
|
110
|
+
| Vercel | Vercel Drains (logs), or file upload of exported NDJSON | `vercel` |
|
|
111
|
+
| Fastly, Akamai, Netlify, Fly.io, custom | Push or upload after mapping to the Valiron format | `valiron` |
|
|
112
|
+
| Your application, when logs are unavailable | Valiron SDK request log | `valiron` |
|
|
113
|
+
|
|
114
|
+
### Cloudflare Logpush
|
|
115
|
+
|
|
116
|
+
1. In Cloudflare, open the zone → **Analytics & Logs → Logpush → Create a Logpush job** and choose **HTTP destination**.
|
|
117
|
+
2. Use this destination. Cloudflare sends `header_` parameters as request headers.
|
|
118
|
+
|
|
119
|
+
```text
|
|
120
|
+
https://valiron-edge-proxy.onrender.com/ingest/crawler/logs/<connection-id>?header_Authorization=Bearer%20<vcl_token>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
3. Select the **HTTP requests** dataset with these fields, and keep the default RFC 3339 timestamp format:
|
|
124
|
+
|
|
125
|
+
```text
|
|
126
|
+
RayID,EdgeStartTimestamp,ClientRequestHost,ClientRequestMethod,ClientRequestPath,ClientRequestUserAgent,ClientIP,EdgeResponseStatus,EdgeResponseBytes,CacheCacheStatus,EdgeTimeToFirstByteMs,ClientCountry,SecurityAction,VerifiedBotCategory
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Do not include request headers, cookies or query-string fields. `ClientRequestURI` is accepted, but its query string is discarded. Keep each Logpush upload at 16 MB or less (`max_upload_bytes`).
|
|
130
|
+
|
|
131
|
+
### AWS WAF
|
|
132
|
+
|
|
133
|
+
1. Create an Amazon Data Firehose stream with source **Direct PUT** and destination **HTTP endpoint**. AWS WAF requires the stream name to start with `aws-waf-logs-`.
|
|
134
|
+
2. Set the endpoint URL to your connection endpoint, the access key to the `vcl_` token, and content encoding to **GZIP**. Keep the buffer size at 16 MiB or less (the default 5 MiB works); larger deliveries are rejected. Configure an S3 backup bucket for failed records.
|
|
135
|
+
3. In AWS WAF, open the web ACL → **Logging and metrics** and send logs to the stream. Redact the `cookie` and `authorization` fields in WAF logging; Valiron discards them in any case.
|
|
136
|
+
|
|
137
|
+
Valiron answers Firehose with the required `requestId` and `timestamp` response. WAF records contain no response status, so status-based analytics are empty for this source. WAF actions (`allow`, `block`, `count`, `challenge`) appear as edge actions. They are actions of your own WAF rules, not Valiron.
|
|
138
|
+
|
|
139
|
+
### CloudFront real-time logs
|
|
140
|
+
|
|
141
|
+
1. Create a Kinesis data stream and a CloudFront real-time log configuration. Recommended fields, in this order: `timestamp, c-ip, sc-status, cs-method, cs-host, cs-uri-stem, cs-user-agent, x-edge-result-type, x-edge-request-id, time-taken, sc-bytes, x-host-header`.
|
|
142
|
+
2. When creating the connection, enter the same field list in the same order. Real-time records have no header, so the order must match exactly.
|
|
143
|
+
3. Create a Firehose stream from the Kinesis stream to the HTTP endpoint with the connection URL and token, and attach the real-time log configuration to your cache behaviors.
|
|
144
|
+
|
|
145
|
+
### File uploads
|
|
146
|
+
|
|
147
|
+
Upload plain or gzip-compressed files in **Log sources**, up to 16 MB compressed (64 MB uncompressed) and 500,000 records per file, and up to 50 files at a time. Formats are detected automatically: CloudFront files from S3 (`.gz`, W3C with `#Fields`, or JSON), ALB logs, combined logs, Cloudflare, AWS WAF, Vercel and Valiron NDJSON, and JSON arrays of records. Split larger files.
|
|
148
|
+
|
|
149
|
+
Drag and drop files onto the upload area, or use **Choose files**. **Uploaded files** lists each upload with its file name, size, detected format, stored, duplicate and unreadable records, and the request time range. **View requests** shows the most recent requests stored from that file. **Remove** takes an upload and the requests it stored out of your dashboard and analytics (totals, charts, routes, live traffic and the simulator). Valiron keeps the data, and uploading the same file again restores it. An upload can be removed once it has finished processing. A request that appeared in two files belongs to the upload that stored it first.
|
|
150
|
+
|
|
151
|
+
### Vercel Drains
|
|
152
|
+
|
|
153
|
+
Vercel Drains stream every request your Vercel project serves, including cached and static responses, with the final status code, cache result and client address. Drains require a Vercel Pro or Enterprise team; Vercel bills them per GB delivered.
|
|
154
|
+
|
|
155
|
+
1. In **Log sources**, choose **Vercel Drains** and create a push endpoint. Copy the endpoint and token.
|
|
156
|
+
2. In Vercel, open **Team Settings → Drains**, add a **Logs** drain for the project, and select the request sources (static, functions, middleware, external). JSON or NDJSON encoding both work.
|
|
157
|
+
3. Set the endpoint and add the custom header `Authorization: Bearer <token>`.
|
|
158
|
+
|
|
159
|
+
Entries without request metadata, such as function output and build logs, are skipped and not counted as unreadable. Requests are deduplicated by Vercel request ID. The proxy logs Vercel delivers contain client IP addresses and paths with query strings; Valiron applies the same handling as for every source (query strings removed, IP addresses hashed).
|
|
160
|
+
|
|
161
|
+
### Push from any log shipper
|
|
162
|
+
|
|
163
|
+
Any sender can `POST` newline-delimited records in a source's native format, or in the Valiron format, to the connection endpoint:
|
|
20
164
|
|
|
21
|
-
|
|
165
|
+
```sh
|
|
166
|
+
gzip -c access.log | curl --fail -X POST "https://valiron-edge-proxy.onrender.com/ingest/crawler/logs/<connection-id>" \
|
|
167
|
+
-H "Authorization: Bearer <vcl_token>" -H "Content-Encoding: gzip" --data-binary @-
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
The Valiron format is one JSON object per line. Only `timestamp` (RFC 3339 or Unix seconds/milliseconds) and `path` are required:
|
|
171
|
+
|
|
172
|
+
```json
|
|
173
|
+
{"timestamp":"2026-11-20T10:00:00Z","host":"www.example.com","method":"GET","path":"/products/42","status":200,"user_agent":"Mozilla/5.0 …","client_ip":"203.0.113.7","duration_ms":38,"bytes":5120,"cache":"miss","request_id":"abc123"}
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
Include `client_ip` to allow crawler verification; without it, crawler claims are reported as evidence unavailable. To ship nginx logs continuously with Vector:
|
|
177
|
+
|
|
178
|
+
```toml
|
|
179
|
+
[sources.access]
|
|
180
|
+
type = "file"
|
|
181
|
+
include = ["/var/log/nginx/access.log"]
|
|
182
|
+
|
|
183
|
+
[sinks.valiron]
|
|
184
|
+
type = "http"
|
|
185
|
+
inputs = ["access"]
|
|
186
|
+
uri = "https://valiron-edge-proxy.onrender.com/ingest/crawler/logs/<connection-id>"
|
|
187
|
+
encoding.codec = "text"
|
|
188
|
+
framing.method = "newline_delimited"
|
|
189
|
+
compression = "gzip"
|
|
190
|
+
request.headers.Authorization = "Bearer ${VALIRON_LOG_TOKEN}"
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### Ingestion endpoint reference
|
|
194
|
+
|
|
195
|
+
`POST /ingest/crawler/logs/:connectionId`
|
|
196
|
+
|
|
197
|
+
- Authentication: `Authorization: Bearer <vcl_token>`, or `X-Amz-Firehose-Access-Key` for Firehose. Dashboard sessions and operator API keys are not accepted. Upload-only connections cannot be used as push endpoints.
|
|
198
|
+
- Body: any content type, up to 16 MB per request (larger requests receive `413`, or the connection is closed before the upload completes; split them), plain or gzip (`Content-Encoding: gzip`, or detected from the gzip header). Decompressed content is limited to 64 MB and 500,000 records. Requests with `X-Amz-Firehose-Request-Id` are read as Firehose envelopes.
|
|
199
|
+
- Response: `200 {"accepted":true,"duplicate":false,"batch":"<id>"}`. An identical payload sent again on the same connection returns `duplicate: true` and is not reprocessed. Firehose requests receive `{"requestId","timestamp"}`, with `errorMessage` on failure.
|
|
200
|
+
- Processing is asynchronous. Records normally appear within seconds of acceptance; see **Recent deliveries** for results.
|
|
201
|
+
- Errors: `401 authentication_required` (missing, invalid or revoked token), `400 empty_payload | invalid_gzip | invalid_firehose_payload`, `413` (body over 16 MB, or `payload_too_large` after decompression), `415 unsupported_encoding`, `429 too_many_batches` (more than 240 deliveries per minute per connection), `503 ingestion_unavailable`. Retry 429 and 503 with backoff.
|
|
202
|
+
- Unreadable lines do not fail a delivery. They are counted as unreadable in that delivery's results.
|
|
203
|
+
|
|
204
|
+
## Request log for sites without log access
|
|
205
|
+
|
|
206
|
+
If you cannot share CDN, WAF or server logs, add the passive request logger from `@valiron/crawler-protection` 0.8.0+ (Node.js 22+). Import it from `@valiron/crawler-protection/request-log` to load only the logger. It records each request after the response finishes and uploads in the background. It does not need Redis, an operator API key or activation, and it never blocks, delays or changes a request. Create an **SDK request log** connection in **Log sources** for the endpoint and token.
|
|
207
|
+
|
|
208
|
+
```typescript
|
|
209
|
+
import express from 'express';
|
|
210
|
+
import { createCrawlerRequestLog } from '@valiron/crawler-protection';
|
|
211
|
+
|
|
212
|
+
const requestLog = createCrawlerRequestLog({
|
|
213
|
+
endpoint: process.env.VALIRON_REQUEST_LOG_URL!, // https://…/ingest/crawler/logs/<connection-id>
|
|
214
|
+
token: process.env.VALIRON_REQUEST_LOG_TOKEN!, // vcl_…
|
|
215
|
+
// Return the real client address for your proxy topology. Never trust raw X-Forwarded-For.
|
|
216
|
+
clientIp: (req) => req.socket.remoteAddress,
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
const app = express();
|
|
220
|
+
app.use(requestLog.middleware());
|
|
221
|
+
// On shutdown: await requestLog.stop();
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
Options and methods:
|
|
225
|
+
|
|
226
|
+
- `endpoint` must be HTTPS (HTTP only for loopback) and exactly `/ingest/crawler/logs/<connection-id>`, without credentials, query or fragment. `token` must be a `vcl_` connection token. Invalid values throw at construction.
|
|
227
|
+
- `clientIp(request)` selects the trusted client address. Use `createCloudFrontClientIpResolver` or your proxy's equivalent. Without it, client IPs are not sent and crawler claims cannot be verified.
|
|
228
|
+
- `sampleRate` (0–1, default 1), `flushIntervalMs` (1,000–300,000, default 10,000), `maxBuffer` (100–200,000 records, default 20,000), `fetch` and `onError` are optional.
|
|
229
|
+
- `middleware()` returns Express/Connect/Node middleware that calls `next()` immediately and records method, path (query removed), host, status, User-Agent, client IP, duration and `Content-Length`.
|
|
230
|
+
- `recordFetch(request, response, { ip, startedAt })` records requests in fetch-style runtimes such as Next.js middleware and Hono. `record(entry)` records any request manually.
|
|
231
|
+
- `flush()` uploads up to 5,000 buffered records as gzip NDJSON. `stats()` returns `{ buffered, dropped }`. `stop()` stops the timer and attempts a final upload.
|
|
232
|
+
|
|
233
|
+
Records are kept in memory only. Failed uploads (network errors, `429` and `5xx`) are retried on the next flush within `maxBuffer`; records beyond the buffer are dropped and counted. Records still buffered when the process exits are lost. Other `4xx` responses are reported to `onError` and not retried. Query strings, cookies and headers other than User-Agent are never collected. Client IPs are sent over HTTPS so Valiron can verify crawlers; Valiron stores only a keyed hash. Sampled traffic is currently counted as received and is not scaled up.
|
|
234
|
+
|
|
235
|
+
## Traffic dashboard
|
|
236
|
+
|
|
237
|
+
**Dashboard → Crawler Protection → Traffic** shows every connected website. The status line shows the website, whether logs are arriving, connected sources, last delivery and the provider-confirmed protection state, with **Enable protection** when it is off. Analytics views have a period control (24h, 7d, 30d, 90d, 12 months). Analytics are grouped by request time in UTC, not delivery time.
|
|
238
|
+
|
|
239
|
+
- **Overview** shows observed requests by traffic class; a stacked requests-per-hour (or day) chart with a per-class breakdown on hover or with the arrow keys; **Verified crawlers by source**, with spoofed claims counted separately; top identified crawlers and routes; declared automation by type; response status classes; edge cache results; and edge actions reported by your provider. Coverage shows stored, duplicate, unreadable and over-allowance records. **Export** downloads the current data as JSON. If a self-hosted runtime has reported, its analytics appear below as **Runtime telemetry**.
|
|
240
|
+
- **Live** lists the most recently delivered requests (request time in UTC, source, verification state and method, request, status, timing and cache) with a histogram of the loaded requests. Filter chips for traffic class, verification state, response status and edge action show 24-hour counts; select a chip to hide that kind of request. Filter by path prefix too. Select a request to open its detail: claimed and verified identity, verification state, method and evidence version, a plain-language explanation, and request metadata. It refreshes every 15 seconds. Because logs arrive in batches, this is a near-live feed.
|
|
241
|
+
- **Bots & crawlers** lists each crawler by provider and class, with request counts by verification state, errors, a daily trend and its most requested routes. A claim mismatch is shown separately from verified traffic.
|
|
242
|
+
- **Pages & routes** lists the top 200 normalized routes with requests per traffic class, errors and mean response time, at daily granularity. Search routes, filter by class, and export CSV.
|
|
243
|
+
- **Log sources** manages websites, connections, uploads, recent deliveries and website removal.
|
|
244
|
+
|
|
245
|
+
These views are tabs on the **Traffic** page. The sidebar adds **Edge rules** (Simulator, Edge protection) and **Self-hosted** (Setup, plus Controls, Decision logs and Alerts once a runtime has reported).
|
|
246
|
+
|
|
247
|
+
Status is **Waiting for the first logs** until data arrives. It becomes **Processing** while deliveries are queued, shows failures when processing fails, and becomes stale after six hours without a delivery from a continuous source. The status line also shows the website's provider-confirmed edge protection state. Edge actions in observed traffic are attributed to Valiron only when the provider rule ID belongs to a Valiron-managed rule; everything else belongs to your own CDN or WAF rules.
|
|
248
|
+
|
|
249
|
+
Dashboard APIs (operator dashboard session only; operator API keys and `vcl_` tokens are rejected; responses use `Cache-Control: private, no-store`):
|
|
250
|
+
|
|
251
|
+
- `GET|POST /operator/crawlers/sites`; `PATCH /operator/crawlers/sites/:siteId` (`excludedPaths`); `DELETE /operator/crawlers/sites/:siteId?confirm=<hostname>` removes the website from the dashboard and returns `{ "removed": true, "retained": true }`.
|
|
252
|
+
- `GET|POST /operator/crawlers/sites/:siteId/connections` (`{ "kind": "push", "format": "<format>|auto" }`, `{ "kind": "sdk" }`, or `cloudfront_realtime` with `"fields": [...]`); `DELETE /operator/crawlers/connections/:connectionId`.
|
|
253
|
+
- `POST /operator/crawlers/sites/:siteId/uploads?format=auto&name=<file name>` (raw file body); `GET /operator/crawlers/sites/:siteId/batches` (`uploads=1` lists file uploads only); `DELETE /operator/crawlers/sites/:siteId/uploads/:batchId` removes an upload from analytics and returns `{ "removed": true, "retained": true, "requests": <n> }`.
|
|
254
|
+
- `GET /operator/crawlers/traffic/overview|timeseries|providers|pages?site=<id>&from=<ms|ISO>&to=<ms|ISO>`, and `GET /operator/crawlers/traffic/events?site=<id>&limit=1-200&before=<cursor>&audience=&verification=&status=&edge=&provider=&path=` (`audience`, `verification`, `status` and `edge` accept comma-separated lists; `batch=<uploadId>` returns requests stored by one upload).
|
|
22
255
|
|
|
23
|
-
|
|
256
|
+
Another account's website returns `404 site_not_found`. Up to 25 websites per account and 20 active connections per website are supported.
|
|
24
257
|
|
|
25
|
-
|
|
258
|
+
## Simulator
|
|
26
259
|
|
|
27
|
-
|
|
260
|
+
**Dashboard → Crawler Protection → Simulator** (`/dashboard/crawler-protection/simulator`, Pro) replays candidate edge rules against the requests Valiron has observed for a website. Simulation is read-only: it never deploys rules or changes traffic.
|
|
28
261
|
|
|
29
|
-
|
|
262
|
+
### Edge rules
|
|
263
|
+
|
|
264
|
+
A set of edge rules is an ordered list of up to 20 rules. Each rule has an ID, name, enabled flag, action and match:
|
|
265
|
+
|
|
266
|
+
| Field | Values |
|
|
267
|
+
|---|---|
|
|
268
|
+
| `action` | `block`, or `rate_limit` with `rate: { requests: 1–1000000, periodSeconds: 10 \| 60 \| 120 \| 300 \| 600 }` counted per client IP |
|
|
269
|
+
| `who` | `{ "kind": "everyone" }`; `{ "kind": "declared", "agents": [...], "categories": [...] }` (self-declared User-Agent, case-insensitive); `{ "kind": "verified", "crawlers": [...] }` (claim plus the crawler's official IP ranges); `{ "kind": "claimed_unverified", "crawlers": [...] }` (spoofed claims) |
|
|
270
|
+
| `paths` | Up to 10 raw request paths, case-sensitive. `*` matches any characters including `/`. Empty means every path. |
|
|
271
|
+
| `methods` | `GET`, `HEAD`, `POST`, `PUT`, `PATCH`, `DELETE`, `OPTIONS`. Empty means every method. |
|
|
272
|
+
|
|
273
|
+
Agent IDs come from `GET /operator/crawlers/catalog`. Verified and spoofed rules accept only crawlers with official evidence, and are never converted into User-Agent-only rules. A block rule that matches every path, method and client is refused. Saving a changed policy creates a new immutable revision (`POST /operator/crawlers/policy?site=<id>`); saving an unchanged policy returns the existing revision.
|
|
274
|
+
|
|
275
|
+
### Results
|
|
276
|
+
|
|
277
|
+
Choose a period (24 hours, 7 or 30 days; at most 31 days) and the target edge. Results show:
|
|
278
|
+
|
|
279
|
+
- **Observed requests** in the window; **Evaluated requests** and coverage; **Excluded requests** that lack a field a rule needs (User-Agent, method, or client identity for rate limits); and **Unknown outcomes** where crawler evidence was unavailable at processing time.
|
|
280
|
+
- **Simulated policy matches** for block rules. Rules apply in order and the first matching block rule takes the request. Block rules are evaluated over every stored event, so these counts are exact for the stored data.
|
|
281
|
+
- **Estimated rate-limited** requests. Rate rules replay events in time order per hashed client IP, using the target's counting: Cloudflare's sliding window with a one-period mitigation, or AWS WAF's trailing window evaluated in 10-second steps. Results are always labeled estimates, because Cloudflare counts per data center and AWS evaluates rates periodically. Without client identities (`CRAWLER_LOG_HASH_SECRET` unset when the events were stored) the result is **Insufficient evidence**. Replay stops after 2,000,000 events and is then marked partial.
|
|
282
|
+
- Per rule: matches, undetermined requests, top routes and agents, and its **enforceability** at the target: `enforceable`, `requires_upgrade` (Valiron add-on or your Cloudflare plan), `requires_integration`, `unsupported` or `insufficient_evidence`, with the reason.
|
|
283
|
+
- **Enforceable policy coverage**: the share of simulated matches that come from rules the target can enforce today.
|
|
284
|
+
|
|
285
|
+
Matches are counts of observed requests. They are not verified savings or prevented server work. Runs with the same policy, window, target and evidence return the stored result. APIs: `POST /operator/crawlers/simulations` (`{ site, policy | policyId, target, range | from/to }`), `GET /operator/crawlers/simulations?site=<id>`, `GET /operator/crawlers/simulations/:id`.
|
|
286
|
+
|
|
287
|
+
## Edge protection
|
|
288
|
+
|
|
289
|
+
**Dashboard → Crawler Protection → Edge protection** (`/dashboard/crawler-protection/protection`) deploys a saved policy as Valiron-managed rules in your own Cloudflare zone or AWS WAF web ACL. It requires the **Crawler Protection add-on** ($29.99/month on top of an active Pro subscription; included with Enterprise). Adding the add-on and turning Protection on are separate steps: paying deploys nothing.
|
|
290
|
+
|
|
291
|
+
1. **Add-on.** Pro owners add it from the page; the price is shown before purchase and prorated on the Pro subscription. Entitlement follows the Stripe subscription.
|
|
292
|
+
2. **Connect your edge.**
|
|
293
|
+
- **Cloudflare:** an API token scoped to the zone with *Zone → Zone: Read* and *Zone → Zone WAF: Edit*. Add *Account → Account Filter Lists: Edit* to enforce verified-crawler and spoofed-crawler rules, which use IP lists of the official ranges. Provide the zone ID.
|
|
294
|
+
- **AWS WAF:** an IAM role in the account that owns the web ACL. Its trust policy allows Valiron's AWS principal with the per-site external ID shown on the page. Its permissions policy lets Valiron manage only `valiron-<site>` rule groups and IP sets, and update the web ACL. Provide the role ARN and web ACL ARN (CloudFront or regional). Web ACLs managed by AWS Firewall Manager are not supported.
|
|
295
|
+
|
|
296
|
+
Credentials are encrypted (AES-256-GCM) and never returned. Log-ingestion tokens cannot change rules, and WAF credentials cannot ingest logs. Connecting runs a permission check. It may create and immediately delete a disabled, non-matching Cloudflare rule, or an empty unattached AWS IP set; it never changes how traffic is handled.
|
|
297
|
+
3. **Policy.** Every enabled rule must be enforceable at the connected edge. Unsupported rules are never deployed: disable or change them first.
|
|
298
|
+
4. **Turn Protection on.** Valiron deploys the rules, reads them back from the provider, and shows **Protecting** only when the provider state matches the deployed revision.
|
|
299
|
+
|
|
300
|
+
### What Valiron changes at the edge
|
|
301
|
+
|
|
302
|
+
All rules are scoped to the website's hostname (`http.host`, or the `host` header on AWS).
|
|
303
|
+
|
|
304
|
+
| Edge | Valiron-owned objects | Customer configuration |
|
|
305
|
+
|---|---|---|
|
|
306
|
+
| Cloudflare | Custom rules and rate limiting rules with `ref` `valiron_<site>_<rule>`, appended to the zone entry point rulesets; IP lists `valiron_<site>_<crawler>` | Other rules are never edited, reordered or removed |
|
|
307
|
+
| AWS WAF | One rule group (`valiron-<site>-…`) with block rules before rate-based rules, IPv4/IPv6 IP sets per verified crawler, and one rule `Valiron-Managed-<site>` appended after your rules in the web ACL | Every other web ACL rule and setting is preserved on update |
|
|
308
|
+
|
|
309
|
+
Plan limits are checked before deployment. Cloudflare custom rules: 5 (Free), 20 (Pro), 100 (Business), 1,000 (Enterprise). Rate limiting rules: 1, 2, 5 and 100. Rate periods: 10 s on Free, up to 60 s on Pro, up to 600 s on Business and Enterprise. Counting is per IP and per data center, and the mitigation lasts one period. Valiron counts your own rules against these limits. AWS WAF rate rules need a 60, 120, 300 or 600 second window and at least 10 requests. Verified Bing rules are not enforceable at either edge, because Bing is verified by reverse DNS.
|
|
310
|
+
|
|
311
|
+
### States
|
|
312
|
+
|
|
313
|
+
| State | Meaning |
|
|
314
|
+
|---|---|
|
|
315
|
+
| `upgrade_required` | The account does not have the add-on (or Enterprise). |
|
|
316
|
+
| `permissions_required` | No edge is connected, or its permission check did not pass. |
|
|
317
|
+
| `observing` | Connected, but no saved policy whose enabled rules are all enforceable. |
|
|
318
|
+
| `enforcement_ready` | Ready to deploy. |
|
|
319
|
+
| `enabling` / `disabling` | A deployment is running. |
|
|
320
|
+
| `protecting` | Valiron rules are deployed and confirmed by provider read-back. |
|
|
321
|
+
| `deployment_failed` | A first activation failed and anything partial was removed. |
|
|
322
|
+
| `rollback_required` | The provider state does not match: an update or disable failed, or Valiron rules were changed outside Valiron (drift). Re-apply the deployed revision or turn Protection off. |
|
|
323
|
+
|
|
324
|
+
**Turning Protection off** removes only Valiron-owned rules, lists, groups and IP sets, keeps traffic insights and simulation running, and preserves the audit trail. The toggle shows off only after the provider confirms removal; a failed disable stays `rollback_required`. Turning off is always allowed, even after the add-on ends. Changing or disconnecting the integration requires Protection to be off.
|
|
325
|
+
|
|
326
|
+
**Revisions and rollback.** Each deployment records the policy revision, outcome and provider read-back. Deploy the latest revision or roll back to any previously deployed one from **Deployment history**.
|
|
327
|
+
|
|
328
|
+
**Drift and evidence refresh.** Every 10 minutes Valiron reads each protected site's Valiron-owned rules. A mismatch moves the site to `rollback_required` and is recorded. When a crawler's official IP ranges change, the same policy is re-applied with the new ranges.
|
|
329
|
+
|
|
330
|
+
**Add-on ends.** Rules stay deployed for a 7-day grace period, then Valiron turns Protection off.
|
|
331
|
+
|
|
332
|
+
### Actual enforcement
|
|
333
|
+
|
|
334
|
+
**Actual enforcement** shows blocks and rate limits by Valiron-managed rules, by rule and policy revision, route and source, from your connected Cloudflare or AWS WAF logs. A request counts only when the provider rule ID in the log (Cloudflare `SecurityRuleIDs`, AWS WAF `terminatingRuleId` or rule-group rule) belongs to a Valiron-managed rule. A 403 or 429 response, or a block by one of your own rules, is never counted as a Valiron action. Keep log delivery connected to see enforcement.
|
|
335
|
+
|
|
336
|
+
APIs (dashboard session): `GET /operator/crawlers/protection/entitlement`; `GET /operator/crawlers/edge/status|capabilities|history|actions?site=<id>`; `GET /operator/crawlers/edge/aws-setup?site=<id>`; `POST|DELETE /operator/crawlers/edge/integration?site=<id>`; `POST /operator/crawlers/edge/preflight|enable|rollback|reapply|disable?site=<id>`. Enable and rollback accept `{ "policyId": "<revision id>" }`. Errors: `protection_upgrade_required` (403), `integration_required`, `permissions_required`, `rules_not_enforceable` (with `details`), `deployment_in_progress`, `disable_protection_first` (409).
|
|
30
337
|
|
|
31
338
|
## Start here
|
|
32
339
|
|
|
33
|
-
1. Sign up and create an operator API key in **Dashboard → API Keys**. Choose **Crawler Protection** in the dashboard Product switcher and install `@valiron/crawler-protection@^0.
|
|
340
|
+
1. Sign up and create an operator API key in **Dashboard → API Keys**. Choose **Crawler Protection** in the dashboard Product switcher and install `@valiron/crawler-protection@^0.8.0`. Keep the key in the server environment as `VALIRON_API_KEY`; never put it in browser code or the site configuration JSON.
|
|
34
341
|
2. Choose the standalone gateway for an HTTP website, or an in-process adapter for a Node application. Inventory the pages, APIs and expensive operations you need to protect.
|
|
35
342
|
3. Validate and export your configuration, then deploy the gateway/runtime with shared Redis in your infrastructure. Route protected traffic through it and prevent direct-origin bypass.
|
|
36
343
|
4. For query-level protection, wrap every protected database operation with the private work API or in-process admission. Start work only after admission succeeds; release capacity only after the operation actually stops.
|
|
37
|
-
5. Test
|
|
344
|
+
5. Test dry run, hard workload caps, application authorization and recovery on your own environment before enabling broader crawler access.
|
|
38
345
|
|
|
39
346
|
### Account API-key activation (SDK 0.3.0+)
|
|
40
347
|
|
|
41
|
-
The standalone gateway requires `VALIRON_API_KEY`. In-process integrations call `await activateCrawlerProtection({ apiKey, tenant })`, then pass the returned `activation` to `createCrawlerRuntime()` or `CrawlerGuard`. Use the `operator_<account ID>` tenant from the dashboard export. Missing credentials, an invalid/revoked key or a foreign tenant cannot activate the supported runtime.
|
|
348
|
+
The standalone gateway requires `VALIRON_API_KEY`. In-process integrations call `await activateCrawlerProtection({ apiKey, tenant })`, then pass the returned `activation` to `createCrawlerRuntime()` or `CrawlerGuard`. Use the `operator_<account ID>` tenant from the dashboard export. Missing credentials, an invalid/revoked key or a foreign tenant cannot activate the supported runtime. Pro accounts with the Crawler Protection add-on, and Enterprise accounts, can activate it; Pro alone and Free receive `403 upgrade_required`.
|
|
42
349
|
|
|
43
|
-
Startup checks the current account through `POST /operator/crawlers/activation`. A valid lease lasts at most five minutes and refreshes every minute in the background. Lease checks use local memory. Each protected HTTP request also calls `POST /operator/crawlers/usage` with its server-side operator key and account tenant before origin work.
|
|
350
|
+
Startup checks the current account through `POST /operator/crawlers/activation`. A valid lease lasts at most five minutes and refreshes every minute in the background. Lease checks use local memory. Each protected HTTP request also calls `POST /operator/crawlers/usage` with its server-side operator key and account tenant before origin work. This counts it toward the [monthly allowance](#what-each-plan-includes). An exhausted allowance returns 429; usage storage or network failure stops new protected requests with 503. A 401/403 refresh response invalidates the lease immediately; temporary network/5xx/429 failures preserve only its remaining lifetime. After expiry, new protected requests and operations fail closed with 503/errors. Existing operations may settle and release capacity; private release/recovery tools and explicitly bypassed static routes remain usable. Call `activation.stop()` on shutdown. `--check` validates configuration/credential syntax offline; it does not verify live account access.
|
|
44
351
|
|
|
45
352
|
The account API must be deployed before upgrading to the requiring SDK. Startup needs network connectivity; keys and leases are not written to disk. Activation is independent of optional analytics reporting. Public SDK checks can be bypassed in modified code, and 0.1.0 cannot be retroactively gated; hosted endpoints enforce account authentication, tenant scope and applicable quotas server-side.
|
|
46
353
|
|
|
@@ -243,7 +550,7 @@ Bing indexing, Googlebot and Meta previews/ad crawlers are separate classes: exp
|
|
|
243
550
|
|
|
244
551
|
Add matching provider/class rates under `policy.providers`; an access rule does not create a rate allowance. `unverifiedAccess: "budget"` preserves conservative access for anonymous shoppers and unverified traffic, including failed crawler claims. This is not a promise to block all other automation. For a strictly private machine-only route, use `unverifiedAccess: "deny"`: all unverified, mismatched or unavailable identities are blocked, including anonymous humans. Authenticated customer grants remain in their independently reserved lanes. Never infer a customer grant from a browser user agent.
|
|
245
552
|
|
|
246
|
-
Defaults apply across the configuration’s protected groups; explicit class rules are group-specific. Inventory bypasses remain bypasses. In
|
|
553
|
+
Defaults apply across the configuration’s protected groups; explicit class rules are group-specific. Inventory bypasses remain bypasses. In dry run, access denials are reported as proposed blocks and requests can pass within safety/work limits; they become actual blocks only on enforced groups. Actual policy denials return 403 with `crawler_policy_denied`. A verified crawler without explicit access is not automatically malicious.
|
|
247
554
|
|
|
248
555
|
Anthropic’s hosted browser `Claude-Agent` is separate from its crawler/user-fetch identities. It can use the reviewed directory entry `claude-agent` with provider `directory-claude-agent`, class `claude-agent`, plus an explicit rate/access rule. Review the addresses against Anthropic’s [hosted browser guide](https://support.claude.com/en/articles/18234133) and its linked SAIL publication before approving. The current directory recipe uses pinned static addresses: address changes require review, and this release does not automatically fetch SAIL. Do not grant a broad cloud-network allowance.
|
|
249
556
|
|
|
@@ -396,14 +703,16 @@ A real Python HTTP origin executing SQLite queries is tested behind gateway/brok
|
|
|
396
703
|
|
|
397
704
|
Local tests cover spoof rejection, source parsing, middleware, shared Redis contention, operation bounds, dependency failure and retention of capacity after disconnect. An isolated Nuxt 4.1.3/Nitro Vue SSR → Node → MariaDB 10.11.8 fixture additionally covers physical checkout pools, actual SQL timeout/disconnect/process-death recovery, cache storms, replay/fanout and Redis outages. A controlled live website test exercised custom crawler requests, source-claim rejection, shared execution counters and refill around a real public-document read. The website test alone does not establish real crawler acceptance, search visibility or Meta previews. Local database results do not establish customer-scale capacity.
|
|
398
705
|
|
|
706
|
+
Valiron.co's first-party deployment uses managed controls on assessment requests and a separate bot-only QA endpoint. Each reports its own site and configuration identity. Marketing pages served by the CDN and account/billing routes are outside that admission path. Its telemetry reports request admission only, with work capacity marked not instrumented; dashboard acknowledgment is not proof of database protection.
|
|
707
|
+
|
|
399
708
|
Validate every rendering/API/background path, cache behavior, actual query cancellation, store recovery and shopper latency under representative peak load before opening access broadly.
|
|
400
709
|
|
|
401
710
|
Related: [Quickstart](./QUICKSTART.md), [SDK reference](./SDK-REFERENCE.md), [Agent identity](./IDENTITY.md), [Errors](./ERRORS.md).
|
|
402
711
|
|
|
403
712
|
|
|
404
|
-
##
|
|
713
|
+
## Runtime telemetry
|
|
405
714
|
|
|
406
|
-
|
|
715
|
+
Once a self-hosted runtime reports, **Dashboard → Crawler Protection** shows its analytics below the traffic overview, and **Self-hosted → Setup** always shows them. They include reported decisions by provider, verification state, route group and actual/proposed action; a 24-hour traffic timeline; gateway/work/cache metrics; shared database, render and gateway hold counts; reporting instances, configuration versions and modes; monitoring alerts; and a JSON export. Before any runtime reports, the overview shows traffic insights only, and Setup shows connection guidance with export disabled. Empty, stale or unavailable telemetry never redirects you. The **Runtime telemetry** panel on the Overview shows actual Allowed, Limited, Blocked and Unavailable totals, a provider breakdown with verified-request counts, and plain-language decision reasons. Filters for site, provider, route group and actual decision narrow those summaries; clicking a provider also filters the view. Clear filters restores the selected site’s totals. Dry-run proposed denials remain separate from actual denials. The hourly chart always covers all providers, route groups and decisions for the selected site; light bars show total requests and solid bars show denied requests. Advanced diagnostics contains raw metric series and reporting instances. Capacity meters show reserved slots per work pool, not database utilization. Metric definitions are available under **How to read these metrics**; stale/unavailable state and dry-run proposals remain visible. It refreshes every 30 seconds. JSON export includes the complete response across all sites and filters, rather than only the current view. Other / unidentified includes both people and unverified bots; this is aggregate source analytics, not individual visitor tracking. Empty, stale and unavailable telemetry states are explicit. Configuration export alone does not connect or activate a deployment.
|
|
407
716
|
|
|
408
717
|
For a standalone gateway, set these **server-side** variables alongside your deployment configuration:
|
|
409
718
|
|
|
@@ -441,24 +750,26 @@ The displayed window groups deltas by **server report receipt time**, not indivi
|
|
|
441
750
|
|
|
442
751
|
Capacity is the latest shared admission ledger reading, counted once rather than added across replicas. Database, render and gateway pools have separate limits. Retained holds include uncertain work awaiting confirmed recovery; a hold is not proof that a query is currently executing. A short spike between reports can be missed. After two minutes without a report, capacity is hidden and status becomes stale; after retention expires, the site no longer appears. A reporting instance proves telemetry connectivity, not correct ingress placement, complete DB integration or genuine crawler acceptance.
|
|
443
752
|
|
|
444
|
-
Monitoring alerts are displayed in the dashboard for stale reports, unavailable admission storage, paused admission, policy/configuration mismatch, open/probe catalog circuits, full work pools, long-held work, reporting overflow, and reported admission/origin failures. These in-dashboard alerts do not automatically change policy or reclaim holds. Optional outbound email/webhook notifications for stale runtime reports and denied-traffic thresholds are configured separately under
|
|
753
|
+
Monitoring alerts are displayed in the dashboard for stale reports, unavailable admission storage, paused admission, policy/configuration mismatch, open/probe catalog circuits, full work pools, long-held work, reporting overflow, and reported admission/origin failures. These in-dashboard alerts do not automatically change policy or reclaim holds. Optional outbound email/webhook notifications for stale runtime reports and denied-traffic thresholds are configured separately under Self-hosted controls; Slack is not included. Keep existing infrastructure alarms for unattended incident paging.
|
|
445
754
|
|
|
446
755
|
Hosted endpoints (separate from the private per-deployment work API):
|
|
447
756
|
|
|
448
|
-
- `POST /operator/crawlers/activation`: server-side operator API key and current
|
|
757
|
+
- `POST /operator/crawlers/activation`: server-side operator API key and a current Pro plan with the Crawler Protection add-on, or Enterprise; `{ tenant }` must match its owner. Returns a five-minute feature/tenant/plan lease, without issuing or deploying policy.
|
|
449
758
|
- `POST /operator/crawlers/telemetry`: server-side operator API-key authentication; bounded cumulative snapshots with account-bound tenant, site/instance identity, increasing sequence, configuration/mode, metric series and capacity.
|
|
450
759
|
- `GET /operator/crawlers/billing`: authenticated account usage, included allowance, additional-call count, accepted price and billing status.
|
|
451
760
|
- `GET /operator/crawlers/analytics`: operator dashboard session authentication; account-scoped rolling metrics and alerts. Responses use `Cache-Control: private, no-store`; unavailable storage returns 503 rather than fabricated zero traffic.
|
|
452
761
|
|
|
453
|
-
Monthly bot quotas require Crawler SDK 0.3.0 or later. Upgrade existing 0.2.x deployments to use
|
|
762
|
+
Monthly bot quotas require Crawler SDK 0.3.0 or later. Upgrade existing 0.2.x deployments to use hosted per-request quota admission. Earlier public SDK versions are not retroactively metered.
|
|
454
763
|
|
|
455
764
|
|
|
456
765
|
SDK 0.5.0 adds activation to browser recognition. Upgrade 0.4.x recognition integrations and supply the activation handle. Older public packages cannot be retroactively restricted; public source can be modified, while hosted account admission is enforced on Valiron’s servers. Inventory the recognition endpoint as a bypass of outer request admission when its own `recognize()` call performs the account admission, so the same HTTP request is not admitted twice.
|
|
457
766
|
|
|
458
|
-
##
|
|
767
|
+
## Managed controls
|
|
459
768
|
|
|
460
769
|
Managed controls require Crawler Protection SDK/gateway **0.7.0+**, the management backend and its database migration. Existing static runtimes and aggregate telemetry do not automatically enable this feature. The dashboard does not install software, deploy infrastructure or increase database capacity.
|
|
461
770
|
|
|
771
|
+
When no site has been selected, controls and analytics prefer a site with a current runtime report. Selecting an older site keeps that choice during refresh so its history remains inspectable.
|
|
772
|
+
|
|
462
773
|
### Connect a gateway
|
|
463
774
|
|
|
464
775
|
Keep the existing validated installation configuration, Redis and operator API key. Add these server-side variables and restart your gateway:
|
|
@@ -469,7 +780,7 @@ CRAWLER_SITE_ID=storefront
|
|
|
469
780
|
CRAWLER_MANAGED_CONTROLS=true
|
|
470
781
|
```
|
|
471
782
|
|
|
472
|
-
Use the same site ID for controls and telemetry. Continue `CRAWLER_TELEMETRY_URL` reporting for aggregate analytics and traffic alerts. On first successful control report, the installation registers with its current crawler access and mode, preserving a partial `enforceGroups` rollout. Selecting a new mode in
|
|
783
|
+
Use the same site ID for controls and telemetry. Continue `CRAWLER_TELEMETRY_URL` reporting for aggregate analytics and traffic alerts. On first successful control report, the installation registers with its current crawler access and mode, preserving a partial `enforceGroups` rollout. Selecting a new mode in Controls applies that mode to all configured route groups. Decision logging and outbound alerts start disabled. All instances sharing a site must use the same base configuration. Managed registration accepts at most 64 KiB of compact configuration JSON, 16 sites per account and 64 runtime instances per site in 24 hours.
|
|
473
784
|
|
|
474
785
|
### Connect Node middleware
|
|
475
786
|
|
|
@@ -496,7 +807,7 @@ The control client uses its fixed hosted endpoint by default. An optional `endpo
|
|
|
496
807
|
|
|
497
808
|
### Choose access and budgets
|
|
498
809
|
|
|
499
|
-
Open **Crawler Protection →
|
|
810
|
+
Open **Crawler Protection → Self-hosted → Controls**, select a registered site, edit and **Publish changes**:
|
|
500
811
|
|
|
501
812
|
- Choose **Allow within limits** or **Block** for each installed crawler class and route group. Search, user fetches and training are separate identities. Allowing a class still requires its configured verifier and available budget; it does not grant every browser identifying itself as that service access.
|
|
502
813
|
- Set the fallback for other verified crawlers. Unverified traffic has a separate control: it includes ordinary anonymous visitors, so blocking it can block people. Independently authenticated shopper/checkout grants retain their own lanes.
|
|
@@ -511,13 +822,17 @@ Runtimes poll every 30 seconds and report their previously applied revision befo
|
|
|
511
822
|
|
|
512
823
|
Control fetching runs in the background; it adds no hosted network call to the per-request control decision. It does not remove the existing hosted monthly quota admission call. Transient update failures retain the current policy only to its original expiry, at most five minutes. Authentication/configuration rejection invalidates the local policy immediately. Without a valid managed policy, new catalog admissions fail closed; authenticated customer grants remain independent. Already running work must still settle and release normally.
|
|
513
824
|
|
|
514
|
-
Changing routes, source candidates, work ceilings or the base configuration requires a planned installation update. Stop the old deployment, validate a replacement in Setup, use **Version history → Replace the installed configuration**, and deploy that exact file. Adoption resets access to the new installation defaults in
|
|
825
|
+
Changing routes, source candidates, work ceilings or the base configuration requires a planned installation update. Stop the old deployment, validate a replacement in Setup, use **Version history → Replace the installed configuration**, and deploy that exact file. Adoption resets access to the new installation defaults in dry run, disables decision logging, clears logs and replaces version history. Old configuration fingerprints are rejected. This can interrupt traffic; use a maintenance window. A runtime API key cannot silently overwrite the site's installed configuration.
|
|
515
826
|
|
|
516
827
|
### Inspect recent decisions
|
|
517
828
|
|
|
518
|
-
**
|
|
829
|
+
**Source-rule preview** in Controls compares the published policy with your unsaved draft against up to 1,000 retained decision records from the last 24 hours. It shows source/class/route matches, the rule and mode before and after, and records matching a different rule or mode. Opening it is read-only; publishing remains a separate action. Logs are fetched only while preview is open and refresh with controls. Enable decision logging and generate traffic if the sample is empty. Unverified records can include people. Records for routes no longer installed are excluded. This is not a full backtest: logs omit customer-lane context, request-bucket state and work concurrency. Rate-only changes do not affect these matches, and a block-rule match does not prove the historical request would have been blocked. Safety and work limits remain active. The preview does not estimate infrastructure savings.
|
|
830
|
+
|
|
831
|
+
**Integration health** in Controls shows current runtime reports, exact revision/configuration acknowledgments and reported dropped-log counts. A report is current for less than five minutes; the runtime list covers the last 24 hours. Stale instances may have been intentionally stopped or replaced. Dropped counts are runtime-reported, not lifetime totals. Acknowledgment proves control connectivity only; validate route coverage, origin bypass prevention and work instrumentation separately. Use Analytics → Advanced diagnostics for telemetry and capacity diagnostics.
|
|
832
|
+
|
|
833
|
+
**Decision logs** is separately enabled in Controls. The dashboard shows up to 1,000 decisions per site from the last 24 hours; every received decision is stored by Valiron and kept. Each decision has source/class, route group, action, reason, verification state, runtime time, server receipt time and generated event ID. No raw IPs, URLs, user agents, credentials or caller-supplied request identifiers are collected by this log buffer. These coarse dimensions can still be business-sensitive; access is account scoped. Expand a reason in Decision logs for a plain-language explanation and a suggested investigation. Explanations distinguish admission from subsequent work limits; request-budget logs do not identify which bucket was exhausted. They describe the historical record, not the current policy.
|
|
519
834
|
|
|
520
|
-
Each process buffers up to 1,000 events, uploads at most 100 per control report, and drops new events when full. Retry event IDs are deduplicated in storage. This is a bounded recent sample, not a complete audit archive. The dashboard shows runtime drop indications; aggregate
|
|
835
|
+
Each process buffers up to 1,000 events, uploads at most 100 per control report, and drops new events when full. Retry event IDs are deduplicated in storage. This is a bounded recent sample, not a complete audit archive. The dashboard shows runtime drop indications; aggregate runtime telemetry remains the source of reported totals. Filter by source, route or decision and export the matching rows. Disabling logging stops collection and clears runtime buffers once runtimes receive the update; decisions already received are kept but no longer shown. Runtime clocks can differ; server receipt time controls the 24-hour view.
|
|
521
836
|
|
|
522
837
|
### Configure notifications
|
|
523
838
|
|