# How it works

> The proposed publisher pilot: understand signed agent requests, define access terms, and review decisions before enforcement.

Source: https://tollgenic.com/how-it-works

Publisher applications are open. Gateway onboarding is in development; payment enforcement and production rollout are not part of this launch.

## The proposed request path

An agent asks for an article, listing or catalog action. The gateway is designed to connect the signed identity to your access terms and record a decision. In the proposed observe-only pilot, requests continue through; paid access is a separate later decision.

### 01 A request arrives, signed

Agents that follow Web Bot Auth attach three headers: Signature-Input (what was signed, when, and until when), Signature (the Ed25519 signature), and Signature-Agent (the origin that publishes the operator's keys). Unsigned traffic still flows; it is simply unverified.

### 02 Verify the identity

The key directory at /.well-known/http-message-signatures-directory is fetched over a hardened client (no private addresses, no redirects to new hosts, bounded size), cached per operator, and matched by JWK thumbprint. The signature must cover the authority, method, path and Signature-Agent, be inside its validity window, and not be a replay.

### 03 Load your contract

A publisher describes what agents may do in a small JSON-LD document: fetch_article, search_catalog, get_item, check_availability, and what each costs or requires. The compiler canonicalizes it (RFC 8785), signs it (detached EdDSA JWS), publishes it at /.well-known/tollgentic.json, and the gateway loads the active version by policy_version.

### 04 Decide

decide() is deterministic: identity state, operator tier, route group and contract in; one action out. Routes you mark never-touch (checkout, login, account, form posts) are always allow. In observe mode the decision is recorded as would_action while action_taken stays allow, so you see exactly what enforcement would have done before switching it on.

### 05 Meter, settle, record

For allow_metered the gateway answers 402 with a PAYMENT-REQUIRED header carrying x402 v2 terms. The agent retries with PAYMENT-SIGNATURE, a facilitator settles on-chain, and the ledger records a balanced entry in integer micro-USD. The payment state machine keeps every step durable, so a lost response never means a lost or doubled charge.

## Rollout

1. **Observe** (14 days minimum): decisions recorded as would_action, action_taken always allow.
2. **Canary** (7 days, one route group): challenge signed-but-unknown operators with a control cohort and written rollback thresholds.
3. **Enforce** (route group by route group): meter priced actions; never-touch routes stay pass-through.

The proposed integration requires three rails before onboarding: the never-touch route group, the TOLLGENTIC_MODE=bypass kill switch, and route-level rollback independent of the Worker.

## Getting started

1. Apply with one Cloudflare site you control. Agree the read-only routes, data handling, protected visitor journeys and rollback plan once onboarding and safety checks are ready.
2. Write the contract from a template; mark pass-through routes. Price nothing at first if you like.
3. Review at least fourteen days of observe-mode evidence together. Unsigned traffic remains unverified; potential priced requests are not collected revenue. Decide separately whether to test a canary or paid access.
