Respond kit for Cloudflare: one gate for every change, with a person's approval
Status: in development. Nothing here is released or deployed.
The Respond kit is the only kit that changes your Cloudflare account. Every change passes through one gate, and in the first release a person approves each one. There is no automatic setting.
Purpose
An action goes through a fixed sequence: it is proposed, a person approves exactly what was proposed, the gate checks everything again, the action is applied, its result is verified, and it is removed when its time limit ends. The gate fails closed: if it cannot read a fact, such as the stop switch or the zone's level, it refuses.
The first and only action is one WAF custom rule that matches a single hostname. WAF is Cloudflare's web application firewall. The rule is written in log mode when the zone is at enforce-log and in block mode at enforce-block.
What it deploys on Cloudflare
- A Worker, declared in Alchemy's plain-module form (see How kits join), with an HTTP interface and a plain approval page at
/approvals. - A D1 database for decisions, approvals, counters and an audit trail that refuses edits and deletes.
- A scheduled job, every five minutes, that removes rules whose time has run out.
- A Cloudflare API token narrowed to WAF custom rules on the zones you configure.
Capability entrypoints
RespondProposeis for a peer Worker such as Enrichment:propose,statusandrequestUndo. A peer sees only decisions proposed through this capability. The audit actor iscapability:RespondPropose.RespondOperatoris for a console:listDecisions,getDecision,answer,undo,stopActions,proposeActionResume,confirmActionResumeandsetSetting. Every write carries the raw Access assertion, which Respond verifies. A service token may read and can never approve, deny, undo, stop, resume or change a setting.
The default entrypoint has no such methods, and no route or method named execute exists.
HTTP routes
Behind Cloudflare Access apart from health. A POST must be same-origin JSON of at most 1 KB with strict fields.
GET /healthand the approval pageGET /approvals.GET /v1/decisionsandGET /v1/decisions/{id}.POST /v1/decisions/{id}/answerwith the digest the API returned and approve or deny, andPOST /v1/decisions/{id}/undo.POST /v1/controls/stop,/v1/controls/resume/proposeand/v1/controls/resume/confirm.POST /v1/settings/{class}and/v1/settings/{class}/confirm.
How a person approves things
A person with the approver role opens the approval page, reads the host, zone, mode and time limit, and approves or denies. What they approve is bound by a digest of exactly those fields, so a change after the proposal voids the approval. The gate then re-reads the stop switch, the setting, the zone's recorded level and the counters before it writes anything. Nothing applies without this step.
Stop switches
- The controls stop switch ships stopped. Pulling it is immediate for any operator (
POST /v1/controls/stop). Releasing it is two steps by one administrator, 60 to 600 seconds apart. - Each action class has a setting,
offorask. Lowering tooffis immediate. Raising toaskis two steps. A new deployment starts atoff. - Undo does not read the stop switch, because it only reduces what is in force.
Peers
All optional. Respond reads the effective level of a zone from Detect through AdmissionRead, or from its own static list when Detect is absent. It accepts proposals from Enrichment, and without Enrichment a person can still propose through the capability. A binding to Detect that is present but unusable fails closed.