
Cloudflare API Key
Use Cloudflare API Tokens with granular permissions instead of a full-access Global Key. Your AI agent manages DNS records, configures rulesets, enables DNSSEC, and creates zone lockdown rules while accessing only what each token permits. Security-first infrastructure automation.




From DNS edits to WAF rulesets and DNSSEC configuration, your agent handles Cloudflare security operations using scoped API tokens that limit access to exactly what is needed.
Cloudflare API Key
Explore how teams use Cloudflare API Tokens with AI agents to perform precise infrastructure changes without exposing full account access.
Your security policy requires the admin portal locked to office IPs outside business hours. Your AI Agent creates a Zone Lockdown rule scoping /admin/* to your corporate CIDR range, activates it at 6 PM, and pauses it at 9 AM. No engineer needs to toggle firewall settings manually, and the lockdown rule uses wildcard URL patterns to cover all admin subpaths.
Compliance requires DNSSEC on every production domain. Your AI Agent iterates through each zone using the List Zones endpoint, enables DNSSEC with the Update DNSSEC Status action, and reports back which zones are now signed and which DS records still need registrar configuration. A multi-zone DNSSEC rollout completed in one conversation.
After a traffic anomaly, your team needs a custom WAF ruleset deployed to the http_request_firewall_custom phase. The agent creates the ruleset, adds rate-limiting rules with specific expressions, and confirms the new version is active. Your site is protected within minutes of the first alert, not hours.

Cloudflare API Key
FAQs
The standard Cloudflare integration uses the Global API Key with your account email, granting full account access. This integration uses scoped API Tokens that you create with specific permissions per zone, account, or resource type. It follows the principle of least privilege, recommended by Cloudflare for production use.
In your Cloudflare dashboard, go to My Profile, then API Tokens, and click Create Token. Select the resources (specific zones or all zones) and permissions (DNS edit, Firewall edit, Zone read) the agent needs. Copy the generated token and paste it into the Tars tool configuration.
Yes. Every ruleset operation accepts an accounts_or_zones scope parameter. The agent creates, updates, or deletes rulesets at whichever level your token permits. Account-level rulesets apply across all zones, while zone-level rulesets target a single domain.
Cloudflare returns a 403 Forbidden error, and the agent reports to the user that the token lacks the required permission. No partial changes occur. You can then update the token's permissions in your Cloudflare dashboard and retry the action.
Yes. The Update DNSSEC Status endpoint supports dnssec_multi_signer and dnssec_presigned flags. The agent can enable DNSSEC with multi-signer mode so multiple DNS providers can serve your signed zone simultaneously, useful for redundant DNS architectures.
No. Every query hits Cloudflare's API in real time. DNS records, ruleset versions, zone details, and lockdown rules are fetched live during conversations. Tars does not store a shadow copy of your infrastructure configuration.
Absolutely. Create an API Token with only read permissions (Zone Read, DNS Read, Firewall Read). The agent will be able to list and inspect resources but cannot create, update, or delete anything. This is ideal for audit and reporting workflows.
Zone Lockdown restricts URL access to a whitelist of IPs or CIDR ranges, blocking all other traffic. WAF custom rules offer more complex matching using expressions, rate limits, and multiple action types. The agent can manage both, but lockdown rules are simpler for pure IP-based access control.
Don't limit your AI Agent to basic conversations. Watch how to configure and add powerful tools making your agent smarter and more functional.

Privacy & Security
At Tars, we take privacy and security very seriously. We are compliant with GDPR, ISO, SOC 2, and HIPAA.