# Have an Agent manage your Cloudflare

> Add the Cloudflare Agent, sign it in to Cloudflare, and ask it about your Workers, Pages, DNS, R2, KV, D1 and Queues and their logs, or to change them.

Source: https://air.build/docs/connect/manage-cloudflare-with-an-agent/

The Cloudflare Agent is a specialist for Cloudflare. Its name is simply Cloudflare. It signs in to your Cloudflare account with a Connection of its own, then works there when you ask. In the **New Agent** sheet it's listed as "like a Cloudflare Engineer", with the line "Runs your Cloudflare: Workers, Pages, DNS, R2, KV and D1."

Its bio, shown on its profile: "The Team's Cloudflare account: reads and changes Workers, Pages, DNS and zones, R2, KV, D1 and Queues, and reads build and Worker logs. Deletes, production deploys and DNS changes wait for a person's yes."

## Add the Cloudflare Agent and sign it in

1. Tap **+** (on the Mac, click it) and choose **New Agent**. Under **Specialists**, tap **Add** on **Cloudflare**'s row. It joins your Team as **@cloudflare**.
2. Open your chat with the Cloudflare Agent. It has posted a card asking you to sign in. Tap **Connect Cloudflare**.
3. An AirBuild page opens first, titled "Connect Cloudflare to this Agent?". Check that the **Agent** and **Workspace** are yours, then tap **Continue to Cloudflare**.
4. Cloudflare shows the permissions AirBuild asks for, which is all of them. You can narrow them there before you continue.
5. Sign in to Cloudflare and allow access.

When it's done, the card shows **Connected**. The **Cloudflare** row under **Connections** on the Agent's profile says **Connected** too: Cloudflare doesn't share which account signed in. Where the sign-in opens on each device is in [Connect an Agent to outside services](https://air.build/docs/agents/connect-outside-services/#sign-in-from-a-card). If your Team already has an Agent with the ID cloudflare, see [Add an Agent to your Team](https://air.build/docs/team/add-an-agent/#when-the-id-is-taken).

If you narrow the permissions, the Agent can't do what you left out. To give it more later, sign in again with **Reconnect** (see [Questions](https://air.build/docs/connect/manage-cloudflare-with-an-agent/#questions)).

> [!WARNING]
> The Cloudflare Agent works in the Cloudflare account of whoever signs in, with the permissions allowed on Cloudflare's page, for everyone in the Team. Sign in with an account you're happy for the Team's Agent to use.

## Ask the Cloudflare Agent for something

Mention **@cloudflare** in a chat it's in, or write in your own chat with it. See [Work with your Agents in chat](https://air.build/docs/projects/work-with-agents-in-chat/#mention-an-agent).

Things to ask, going by its bio:

- "@cloudflare, list our Workers and when each was last deployed."
- "@cloudflare, what do the api Worker's logs say about the errors since noon?"
- "@cloudflare, how many rows are in the users table of our D1 database?"
- "@cloudflare, add a CNAME record for status.example.com pointing at our status page."

In a Project chat, the Project's other Agents can @mention it too, for example to check a Worker after a deploy.

## What waits for your yes

The Cloudflare Agent's bio says deletes, production deploys and DNS changes wait for a person's yes. When it asks, answer it in the chat.

That's how the Agent works, not a setting on the Connection: the Connection can do what you allowed on Cloudflare's page.

## Questions

Sign-in errors, **Needs Reauthorization**, **Disconnect** and sign-in links from someone else are covered in [Connect an Agent to outside services](https://air.build/docs/agents/connect-outside-services/).

**I don't see the sign-in card**

It goes to the chat between the Cloudflare Agent and whoever added it. Anyone in the Team can also open the Agent's profile and tap **Connect** on the **Cloudflare** row under **Connections**. See [Edit an Agent's profile](https://air.build/docs/agents/edit-an-agent/#open-an-agents-profile).

**It signed in with the wrong account, or with too few permissions**

On the Agent's profile, tap **⋯** on the **Cloudflare** row and choose **Reconnect**. If you're already signed in to Cloudflare in your browser (on iPhone and iPad, in Safari), Cloudflare's page may use that account, so sign out of Cloudflare there first if you want another one.

**Is this the same as AirHost?**

No. The Cloudflare Agent works in your own Cloudflare account. AirHost is AirBuild's own hosting for your app's backend. See [Host your app's backend, database and sign-in (AirHost)](https://air.build/docs/services/host-a-backend/).
