---
title: Precursor
---

[Skip to content](#%5Ftop) 

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

Copy Markdown

Open in **Claude**

Open in **ChatGPT**

Open in **Cursor**

---

**Copy Markdown**

**View as Markdown**

# Precursor

##### [Get Zone Precursor Config](https://developers.cloudflare.com/api/python/resources/precursor/methods/get)

precursor.get(PrecursorGetParams\*\*kwargs)  \-> [PrecursorConfig](https://developers.cloudflare.com/api/python/resources/precursor#%28resource%29%20precursor%20%3E%20%28model%29%20precursor%5Fconfig%20%3E%20%28schema%29)

GET/zones/{zone\_id}/precursor

##### [Update Zone Precursor Config](https://developers.cloudflare.com/api/python/resources/precursor/methods/update)

precursor.update(PrecursorUpdateParams\*\*kwargs)  \-> [PrecursorConfig](https://developers.cloudflare.com/api/python/resources/precursor#%28resource%29%20precursor%20%3E%20%28model%29%20precursor%5Fconfig%20%3E%20%28schema%29)

PUT/zones/{zone\_id}/precursor

##### ModelsExpand Collapse 

class EnforcementRule: …

expression: str

The filter expression that determines which requests the rule matches.

maxLength4000

mode: Literal\["min-friction", "max-security"\]

The override mode Precursor applies to requests matching an enforcement rule. Unlike `default_mode`, this cannot be `off`.

One of the following:

"min-friction"

"max-security"

id: Optional\[str\]

The read-only identifier that Cloudflare assigns to the rule.

description: Optional\[str\]

An informative description of the rule.

enabled: Optional\[bool\]

Whether the rule is active.

class PrecursorConfig: …

Deprecateddefault\_mode: Optional\[Literal\["off", "min-friction", "max-security"\]\]

The zone-level Precursor enforcement mode applied to requests that do not match a more specific enforcement rule.

One of the following:

"off"

"min-friction"

"max-security"

Deprecatedenforcement\_rules: Optional\[List\[[EnforcementRule](https://developers.cloudflare.com/api/python/resources/precursor#%28resource%29%20precursor%20%3E%20%28model%29%20enforcement%5Frule%20%3E%20%28schema%29)\]\]

The ordered list of enforcement rules for the zone.

expression: str

The filter expression that determines which requests the rule matches.

maxLength4000

mode: Literal\["min-friction", "max-security"\]

The override mode Precursor applies to requests matching an enforcement rule. Unlike `default_mode`, this cannot be `off`.

One of the following:

"min-friction"

"max-security"

id: Optional\[str\]

The read-only identifier that Cloudflare assigns to the rule.

description: Optional\[str\]

An informative description of the rule.

enabled: Optional\[bool\]

Whether the rule is active.