Access policies
Decide whether a caller has to pay, and from what.
Public Beta · early access
Policies run in order for each request. The first applicable decision wins; if a reserve decision cannot reserve enough balance, core releases that attempt and continues to the next policy.
| Decision | Meaning | Built-in |
|---|---|---|
grant | Let the caller through with no charge | subscriber({ active }) |
reserve | Pay from a balance: reserve, then commit or release | credits({ balance }) |
pay | Require a payment on a rail | payPerCall() |
skip | Let the next policy decide | — |
toll.price("$0.01", {
access: [subscriber({ active }), credits({ balance }), payPerCall()],
});- Omit
accessto require payment from everyone. - If
accessis set and nothing grants, reserves, or asks for payment, the request is denied with403. - Policies receive the normalized context — the Web
Request, the authenticatedprincipal, and MCP details — never a framework object.
Tollstile evaluates the pricing and access policy you define; it does not decide what your service should cost.
Credits participate in Idempotency using the policy account as payer. Subscriber grants create no charge and do not deduplicate the handler.