---
title: AI Security
---

[Skip to content](#_top)

[API Reference](https://developers.cloudflare.com/api/python)

Copy Markdown

Open in **Claude**Open in **ChatGPT**Open in **Cursor**

---

**Copy Markdown****View as Markdown**

# AI Security

##### [Get the AI Security for Apps status for a zone.](https://developers.cloudflare.com/api/python/resources/ai_security/methods/get)

ai\_security.get(AISecurityGetParams\*\*kwargs) -> [AISecurityGetResponse](<https://developers.cloudflare.com/api/python/resources/ai_security#(resource)%20ai_security%20%3E%20(model)%20ai_security_get_response%20%3E%20(schema)>)

GET/zones/{zone\_id}/ai-security/settings

##### [Update the AI Security for Apps status for a zone.](https://developers.cloudflare.com/api/python/resources/ai_security/methods/update)

ai\_security.update(AISecurityUpdateParams\*\*kwargs) -> [AISecurityUpdateResponse](<https://developers.cloudflare.com/api/python/resources/ai_security#(resource)%20ai_security%20%3E%20(model)%20ai_security_update_response%20%3E%20(schema)>)

PUT/zones/{zone\_id}/ai-security/settings

##### ModelsExpand Collapse

<details>

<summary>

class AISecurityGetResponse: …

AI Security for Apps enablement status for a zone.

</summary>

enabled: Optional\[bool]

Whether AI Security for Apps is enabled on the zone.

<a href="#(resource)%20ai_security%20%3E%20(model)%20ai_security_get_response%20%3E%20(schema)%20%3E%20(property)%20enabled">Link to this property</a>

</details>

[Link to this property](<#(resource)%20ai_security%20%3E%20(model)%20ai_security_get_response%20%3E%20(schema)>)

<details>

<summary>

class AISecurityUpdateResponse: …

AI Security for Apps enablement status for a zone.

</summary>

enabled: Optional\[bool]

Whether AI Security for Apps is enabled on the zone.

<a href="#(resource)%20ai_security%20%3E%20(model)%20ai_security_update_response%20%3E%20(schema)%20%3E%20(property)%20enabled">Link to this property</a>

</details>

[Link to this property](<#(resource)%20ai_security%20%3E%20(model)%20ai_security_update_response%20%3E%20(schema)>)

#### AI SecurityCustom Topics

##### [Get the AI Security for Apps custom topics of a zone.](https://developers.cloudflare.com/api/python/resources/ai_security/subresources/custom_topics/methods/get)

ai\_security.custom\_topics.get(CustomTopicGetParams\*\*kwargs) -> [CustomTopicGetResponse](<https://developers.cloudflare.com/api/python/resources/ai_security#(resource)%20ai_security.custom_topics%20%3E%20(model)%20custom_topic_get_response%20%3E%20(schema)>)

GET/zones/{zone\_id}/ai-security/custom-topics

##### [Update the AI Security for Apps custom topics of a zone.](https://developers.cloudflare.com/api/python/resources/ai_security/subresources/custom_topics/methods/update)

ai\_security.custom\_topics.update(CustomTopicUpdateParams\*\*kwargs) -> [CustomTopicUpdateResponse](<https://developers.cloudflare.com/api/python/resources/ai_security#(resource)%20ai_security.custom_topics%20%3E%20(model)%20custom_topic_update_response%20%3E%20(schema)>)

PUT/zones/{zone\_id}/ai-security/custom-topics

##### ModelsExpand Collapse

<details>

<summary>

class CustomTopicGetResponse: …

</summary>

<details>

<summary>

topics: Optional\[List\[Topic]]

Custom topic categories for AI Security for Apps content detection.

</summary>

label: str

Unique label identifier. Must contain only lowercase letters (a–z), digits (0–9), and hyphens.

maxLength20

minLength2

<a href="#(resource)%20ai_security.custom_topics%20%3E%20(model)%20custom_topic_get_response%20%3E%20(schema)%20%3E%20(property)%20topics%20%3E%20(items)%20%3E%20(property)%20label">Link to this property</a>

topic: str

Description of the topic category. Must contain only printable ASCII characters.

maxLength50

minLength2

<a href="#(resource)%20ai_security.custom_topics%20%3E%20(model)%20custom_topic_get_response%20%3E%20(schema)%20%3E%20(property)%20topics%20%3E%20(items)%20%3E%20(property)%20topic">Link to this property</a>

</details>

<a href="#(resource)%20ai_security.custom_topics%20%3E%20(model)%20custom_topic_get_response%20%3E%20(schema)%20%3E%20(property)%20topics">Link to this property</a>

</details>

[Link to this property](<#(resource)%20ai_security.custom_topics%20%3E%20(model)%20custom_topic_get_response%20%3E%20(schema)>)

<details>

<summary>

class CustomTopicUpdateResponse: …

</summary>

<details>

<summary>

topics: Optional\[List\[Topic]]

Custom topic categories for AI Security for Apps content detection.

</summary>

label: str

Unique label identifier. Must contain only lowercase letters (a–z), digits (0–9), and hyphens.

maxLength20

minLength2

<a href="#(resource)%20ai_security.custom_topics%20%3E%20(model)%20custom_topic_update_response%20%3E%20(schema)%20%3E%20(property)%20topics%20%3E%20(items)%20%3E%20(property)%20label">Link to this property</a>

topic: str

Description of the topic category. Must contain only printable ASCII characters.

maxLength50

minLength2

<a href="#(resource)%20ai_security.custom_topics%20%3E%20(model)%20custom_topic_update_response%20%3E%20(schema)%20%3E%20(property)%20topics%20%3E%20(items)%20%3E%20(property)%20topic">Link to this property</a>

</details>

<a href="#(resource)%20ai_security.custom_topics%20%3E%20(model)%20custom_topic_update_response%20%3E%20(schema)%20%3E%20(property)%20topics">Link to this property</a>

</details>

[Link to this property](<#(resource)%20ai_security.custom_topics%20%3E%20(model)%20custom_topic_update_response%20%3E%20(schema)>)