How does the cf 1.0 RC let an AI agent preview a JSON request before calling the Cloudflare API? On 17 November 2026 sensitive fields are redacted
On 17 November 2026, cf reached 1.0.0-rc.1. An AI agent calls the Cloudflare API by handing the CLI a request, reading the JSON --dry-run would send, then running the command without that flag. The preview redacts fields the API schema marks as sensitive, including nested values and JSON passed with --body, and it needs no credentials. The result is on standard output only. The model fills JSON. cf sends the request.
Before you read
| Object | Public fact on 17 Nov 2026 | What automation does with it |
|---|---|---|
| 1.0.0-rc.1 | Release candidate on 17 November. cloudflare.config.ts, Build Output, and init / dev / build / deploy are expected to stay through 1.0. A few uncommon API command paths may still change | Install cf@latest. cf --version prints only the version number |
| --dry-run | Every command can preview. Generated commands redact schema-marked sensitive body fields, including nested values and --body. A dry run needs no credentials | Do not copy a redacted field into the next request |
| stdout | Off a terminal, stdout is the result only, and JSON stays indented. Progress, the selected zone, and errors go to stderr. A change with no payload prints nothing | Parse stdout only. Empty output is not automatically a failure |
| Delete without a terminal | The 17 November agents page: without --force, stderr prints Aborted., nothing changes, and the exit status is 1. cf workers secrets bulk is now bulk-edit, with no alias | Search the command name again before you allow --force |
orders.example.test, rec_demo_1042, and order A-1042 are fictional. Do not commit a token; the placeholder is sk_demo_not_real. The JSON below shows fields. It is not a captured production response.
How does an agent call the Cloudflare API with the cf 1.0 RC?
One call is three JSON values. Do not fold them into one chat turn. In the late-September open beta, an agent could already find a command with cf cli search and read fields with cf schema. The 17 November candidate adds the request preview you check before a write, and a set of renames that make old scripts fail. Install with npm install --global cf@latest. Inside a project that depends on cf, the global command runs that project's copy.
- The request you hand over. Simple fields are flags. A nested object becomes a kebab-case flag, so
read_replication.modeis--read-replication-mode. If the field list is incomplete, pass the whole object with--body. Files use a prefix such as@./_worker.js. Do not paste file bytes into the prompt. - The preview.
--dry-runprints the request on stdout. It does not send it, and it does not sign in. Fields the API schema marks as sensitive are redacted. An array larger than the API allows is rejected, not split across requests.--bodyis checked before login or a confirmation prompt. - The result. Stdout is indented JSON, or empty, or raw bytes. An R2 object, a model image, and protobuf are not JSON objects. Redirect them to a file.
cf observability tailis one JSON value per line, not one array.
The search array and the schema keys are in search and schema from the open-beta article. This piece is the request, the preview, and the response after the release candidate. Tools listed on a web page are a different product: how WebMCP lists tools on the current page.
The agent fills the body. Field names come from schema
Path and query parameters use API names, such as account_id and zone_id. requestBodyFields uses option names and includes required. Some body lists are empty or incomplete. An empty list does not mean the call has no body. This is a body you would pass with --body. The hostname is fictional. The keys you actually send come from that command's cf schema:
{
"type": "TXT",
"name": "orders.example.test",
"content": "demo-pass",
"comment": "order A-1042"
}
Required fields are a gate, not a sentence that says please print JSON. See why a schema is a gate. This is not RFC 6902. A coding agent patches local JSON with how a coding agent uses JSON Patch; the tool is the JSON Patch tool. Against Cloudflare, the agent sends this call's body or flags. Objects and maps can be inline JSON or @path/to/file.json. The candidate also accepts arrays of objects and file uploads, for example cf pages deployments create --worker-js @./_worker.js. The dry-run command in the docs is:
cf d1 create --name orders-demo --dry-run
cf deploy --dry-run is not that request preview. It shows the project setup changes it would make, and it does not make them. A generated API command previews the HTTP request. Hand-written commands keep their own previews. Read the command name before you parse. Do not read deploy output with a D1 request shape. Build Output now lives in .cloudflare/output/v1/. The first cf deploy builds again in that location.
The response is one page of JSON. Docs search is another array of at most five
A list command prints one page as a JSON array. Paging flags differ by command. Read --help. A change that returns no data prints nothing on stdout. Failure is a non-zero exit status. The error text is on stderr and can name the missing parameter. This page is a fictional record, so you can see the first check: it is an array.
[
{
"id": "rec_demo_1042",
"type": "TXT",
"name": "orders.example.test",
"content": "demo-pass"
}
]
Field names change with the command. Before a JSONPath such as $[0].id, confirm this result actually has id. Do not assume a success wrapper. cf docs search is a different command. It searches documentation, not API operations. It needs a network and no login. Quote the whole query. You get at most five objects, each with title, description, and url. The object below only shows those three keys. The URL is the fetch example from the 17 November docs, not a ranked hit:
[
{
"title": "Proxy a DNS record",
"description": "Field sketch only. Read the page with Accept: text/markdown.",
"url": "https://developers.cloudflare.com/learning-paths/prevent-ddos-attacks/baseline/proxy-dns-records/"
}
]
After you pick one, fetch that URL with Accept: text/markdown. The search card is not the page. cf cli search still runs locally and returns command plus summary. Keep both searches free of account ids, domains, email addresses, and tokens. The candidate reranks cf deploy and secret-related phrasing. A first hit you saved in September needs another search in November.
The preview, the result, stderr, and the exit code do different jobs
A script usually collapses these six into one success:
| What you see | What it means |
|---|---|
| --dry-run on an API command | The request JSON that would be sent, on stdout. Sensitive fields are redacted. Nothing is sent, and no credentials are required. Do not copy a redacted value back into --body. |
| stdout after a real run | One indented JSON page, or nothing, or raw bytes. Empty stdout can be a successful change that returned no body. |
| Aborted. on stderr | The 17 November agents page: a non-interactive destructive command without --force changes nothing and exits 1. The September docs allowed exit 0. That reading is out of date. |
| cf auth whoami | A terminal gets a short summary. CI, non-interactive runs, and agents get full JSON. Choose with --json or --no-json. Do not scrape the human table. |
| cf observability tail | Newline-delimited JSON. Select a scope with --worker, --zone, or --all. --filters takes inline JSON or @filters.json. Event fields are in --help. This article does not invent a sample event. |
| cf deploy --dry-run | Which project setup changes would be made, not a DNS or D1 request. Those changes are not applied. --no-provision fails when a binding has no resource id, instead of creating one. |
cf no longer remembers the account you picked. Set accountId in cloudflare.config.ts, or set CLOUDFLARE_ACCOUNT_ID. Otherwise a non-interactive agent stops on a prompt that was written to stderr. Unattended runs use CLOUDFLARE_API_TOKEN. It wins over a saved login. The token does not belong in command JSON. How keys show up in config and logs: how keys leak from config and logs. Custom request headers are the env var CLOUDFLARE_API_HEADERS, and the value is one JSON object. Header values outside the diagnostic allowlist stay redacted.
Six steps before an agent changes a live resource
Do not start by pasting a token into the prompt:
- Match the version.
cf --versionprints only the version. Confirm1.0.0-rc.1or newer before you trust the renames. A project dependency overrides the global install. - A person runs cf auth login. Set
CLOUDFLARE_API_TOKENonly for unattended runs, and setCLOUDFLARE_ACCOUNT_ID. Do not use a real token in an example. - Search again, with quotes.
cf workers secrets bulkis nowcf workers secrets bulk-edit, with no alias. The release notes also renamecf email-routing addresses updatetoedit. A few API paths can still change before 1.0. - Run cf schema, then pass --body. Read
required. If the list is incomplete, pass the whole object.cfchecks that JSON before login or confirm. An oversized array is rejected. - --dry-run first. Read stdout only. Do not write a redacted field into the next call. Check that paths and names are demo values such as
orders.example.test, then drop the flag. - Parse stdout only. If stdout is empty, read the exit code. For a destructive command, look for
Aborted.on stderr. Split a log stream by line. If the repo haswrangler.jsoncand nocloudflare.config.ts, do not runcf dev,cf build, orcf deploy.
Preview a migration with cf migrate --dry-run. The build fails until every TODO(@cloudflare) in the generated cloudflare.config.ts is resolved. A redeploy no longer removes secrets you added outside that file. On some commands --force is also an API parameter. cf workers delete --force deletes a Worker that other Workers still reference.
Line up four JSON values before a write
A failed call is usually a September command name, a preview copied back into the body, or an empty stdout read as a crash.
- Format the
--bodyand the schema, then use Schema validator to check that everyrequestBodyFieldsentry withrequired: trueis present. - Use JSONPath for
$[0].id,$.title, and$.url. First decide whether this JSON is a list page or a docs-search result. - Use JSON Diff on the body you meant to send and the
--dry-runpreview. Sensitive fields are supposed to differ. If an ordinary field differs, fix the body. - Run redaction before a preview lands in a log. The CLI redacts only fields the schema marks as sensitive. An unmarked key can still carry a token. Do not paste a zone, an account, or a token into a formatter that uploads. JSONSort runs in the browser.
- Split
cf observability tailstdout with NDJSON converter. Do notJSON.parsethe whole stream as one value.
When the four values agree, the call is an API request, not a command string saved in September. Indentation is not an error.
Common traps
- Reading Aborted. with the September exit code. The 13 October article recorded the docs of that day: the exit code could stay 0. The 17 November agents page says exit status 1, and no change. The candidate notes say the command exits with an error.
- Memorizing September command names.
bulkdoes not alias tobulk-edit. Earlier in the beta, camelCase commands became kebab-case.getCreditsbecameget-credits. - Parsing the whoami terminal summary as JSON. The human summary sanitizes control characters. Scripts and agents read the full JSON on stdout, or pass
--json. - Copying a redacted preview back into --body. An unredacted field is not safe to log either. Only schema-marked sensitive fields are redacted. Keep the token in the environment.
- Running cf deploy in a repo that only has wrangler.jsonc. It can write a new config, or it can fail. Start with
cf migrate --dry-run. Do not parsecf deploy --dry-runas an API request. - Treating tail output as one JSON array. It is one object per line. Worker events also require Workers Logs on that Worker.
--localcovers only a few local resources.cf d1 queryhas no local equivalent. It errors instead of calling the live API.
FAQ
Does an agent still add --json to every cf command?
Not for result commands. Stdout is JSON by default. cf auth whoami is a short summary in a terminal and full JSON when non-interactive. Pin it with --json or --no-json. cf --version prints only the version number, with no JSON wrapper.
Does --dry-run send the request or ask for a token?
A generated command's dry run does not send the request and does not need credentials. It redacts schema-marked sensitive fields, including nested values and --body. cf deploy --dry-run previews project setup changes and does not apply them. Do not parse the two previews with the same fields.
If stdout is empty, did the call fail?
Not always. A change with no response body prints nothing. Failure is a non-zero status and text on stderr. A non-interactive destructive command without --force prints Aborted. on stderr, exits 1, and changes nothing.
Why did cf workers secrets bulk stop working after 17 November?
The candidate renamed it to cf workers secrets bulk-edit, with no compatibility alias. Some email-routing commands also moved from update to edit. Run cf cli search again. Before 1.0, a few less-used API command paths may still change.
How do I hand live logs to an agent without one giant array?
Use cf observability tail. It writes one JSON value per line. Scope it with --worker, --zone, or --all. Pass filters as inline JSON to --filters, or as @filters.json. The field shape is in that command's --help. Worker events need Workers Logs turned on. A long run refreshes an expired OAuth login instead of failing.
Conclusion
The cf 1.0 RC fixes how an AI agent calls the Cloudflare API: hand over request JSON, read a redacted --dry-run, then parse stdout only. The model fills fields. The CLI sends the request.
Search September command names again. A delete without a terminal is exit code 1 plus Aborted. Leave redacted preview values in the preview. Do not write them into the next --body.
Further reading
- Search and schema from the cf open beta The command array and requestBodyFields. For the exit code, use the 17 November docs in this article
- Cloudflare WebMCP Tools on the current page, not this CLI
- Coding agents and API keys Keep the token in the environment and in config, not in the prompt
- JSON Patch for a coding agent Local JSON uses RFC 6902. cf sends an API body
- The JSONSort local toolbox Format, validate, Diff, JSONPath. In the browser, nothing uploaded
- All articles More notes on JSON and AI development
Checked . Sources: the Cloudflare cf 1.0 RC changelog of 17 November 2026, and Use cf with coding agents as updated the same day.