Skip to content

Commit ade9303

Browse files
maxvpranbel
andauthored
[Gateway] ChatGPT tenant headers (#25463)
Co-authored-by: ranbel <[email protected]>
1 parent f739052 commit ade9303

File tree

2 files changed

+62
-25
lines changed

2 files changed

+62
-25
lines changed

src/content/docs/cloudflare-one/policies/gateway/http-policies/tenant-control.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,18 @@ For more information, refer to the [Slack documentation](https://slack.com/help/
8585

8686
For more information, refer to the [Dropbox documentation](https://help.dropbox.com/security/network-control).
8787

88+
### ChatGPT
89+
90+
| Selector | Operator | Value | Action | Untrusted certificate action |
91+
| ----------- | -------- | --------- | ------ | ---------------------------- |
92+
| Application | in | _ChatGPT_ | Allow | Block |
93+
94+
| Custom header name | Custom header value |
95+
| ------------------------------ | -------------------------------- |
96+
| `Chatgpt-Allowed-Workspace-Id` | Your organization's workspace ID |
97+
98+
For more information, refer to the [OpenAI documentation](https://help.openai.com/articles/8798594-what-is-a-workspace-how-do-i-access-my-chatgpt-business-workspace).
99+
88100
## Exempt users in Cloudflare WAF
89101

90102
You can include custom headers in an HTTP policy to allow your users through [Cloudflare WAF](/waf/). This is useful for allowing only WARP users through your WAF.

src/content/docs/learning-paths/holistic-ai-security/build-security-policies/set-policy-approval.mdx

Lines changed: 50 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ If you use specific AI tools within your organization, you may want to create po
1515
3. Name the policy.
1616
4. Under **Traffic**, build a logical expression that defines the traffic you want to allow for AI at your organization.
1717

18-
| Selector | Operator | Value |
19-
| -------- | -------- | ----- |
20-
| Application | in | *Artificial Intelligence* |
18+
| Selector | Operator | Value |
19+
| ----------- | -------- | ------------------------- |
20+
| Application | in | _Artificial Intelligence_ |
2121

2222
5. For **Action**, select **Allow**.
2323
6. Select **Create policy**.
@@ -39,9 +39,9 @@ Cloudflare Workers are an easy method to stand up custom user coaching pages. Th
3939
3. Name the policy.
4040
4. Under **Traffic**, build a logical expression that defines the traffic you want to allow for AI at your organization.
4141

42-
| Selector | Operator | Value |
43-
| -------- | -------- | ----- |
44-
| Application | in | *Artificial Intelligence* |
42+
| Selector | Operator | Value |
43+
| ----------- | -------- | ------------------------- |
44+
| Application | in | _Artificial Intelligence_ |
4545

4646
5. For **Action**, select **Block**.
4747
6. To **Modify the Gateway block behavior**, determine how you want to redirect your users.
@@ -64,19 +64,44 @@ You can build policies that enable Prompt Capture for AI applications in specifi
6464
3. Name the policy.
6565
4. Under **Traffic**, build a logical expression that defines the traffic you want to allow for AI at your organization.
6666

67-
| Selector | Operator | Value |
68-
| -------- | -------- | ----- |
69-
| Application | in | *Artificial Intelligence* |
67+
| Selector | Operator | Value |
68+
| ----------- | -------- | ------------------------- |
69+
| Application | in | _Artificial Intelligence_ |
7070

7171
5. Under **Identity**, build a logical express that defines the user identity you want to capture and log their prompts to review for data loss prevention.
7272

73-
| Selector | Operator | API Value |
74-
| -------- | -------- | ----- |
75-
| Application | in | `any(identity.groups.name[*] in {\"contractors\" \"cohort-224\"})`|
73+
| Selector | Operator | API Value |
74+
| ----------- | -------- | ------------------------------------------------------------------ |
75+
| Application | in | `any(identity.groups.name[*] in {\"contractors\" \"cohort-224\"})` |
7676

7777
6. For **Action**, select **Allow**.
7878
7. Select **Create policy**.
7979

80+
## Configure Gateway to use ChatGPT workspace header
81+
82+
If your organization uses [ChatGPT Business](https://chatgpt.com/business/), you can configure a Gateway policy to enforce the use of your organization's workspace ID, ensuring all traffic to ChatGPT is correctly associated with your account. This will implement Gateway [tenant control](/cloudflare-one/policies/gateway/http-policies/tenant-control/), which lets you manage how users interact with specific applications.
83+
84+
To create this policy, you will add a custom HTTP header to your Gateway policy. This header, `Chatgpt-Allowed-Workspace-Id`, ensures that only requests with your organization's unique workspace ID are permitted.
85+
86+
1. In [Zero Trust](https://one.dash.cloudflare.com), go to **Gateway** > **Firewall policies**.
87+
2. In the **HTTP** tab, select **Add a policy**.
88+
3. Name the policy.
89+
4. Under **Traffic**, build a logical expression that defines the traffic you want to allow.
90+
91+
| Selector | Operator | Value |
92+
| ----------- | -------- | --------- |
93+
| Application | in | _ChatGPT_ |
94+
95+
5. In **Action**, choose _Allow_.
96+
6. In **Untrusted certificate action**, choose _Block_.
97+
7. Under **Add headers to matched requests**, select **Add a header**.
98+
8. Add the following values to each field:
99+
- **Custom header name**: `Chatgpt-Allowed-Workspace-Id`
100+
- **Custom header value**: Your organization's workspace ID
101+
9. Select **Create policy**.
102+
103+
For more information, refer to the [OpenAI documentation](https://help.openai.com/articles/8798594-what-is-a-workspace-how-do-i-access-my-chatgpt-business-workspace).
104+
80105
## Order your policies for specific inspection and enforcement
81106

82107
In most scenarios, Gateway evaluates HTTP policies in [top-down order](/learning-paths/secure-internet-traffic/understand-policies/order-of-enforcement/).
@@ -86,27 +111,27 @@ For example, if you want to prevent sensitive data being shared with AI but want
86111

87112
1. The policy that blocks sensitive data being shared would need to be ordered first in this policy group. This will allow it to be enforced before the next policy in the policy group.
88113

89-
| Operator | Selector | Operator | Value | Action |
90-
| -------- | -------- | -------- | ----- | ------ |
91-
| | Application | in | *Artificial Intelligence* | |
92-
| And | DLP Profile | in | *my-sensitive-data* | Block |
114+
| Operator | Selector | Operator | Value | Action |
115+
| -------- | ----------- | -------- | ------------------------- | ------ |
116+
| | Application | in | _Artificial Intelligence_ | |
117+
| And | DLP Profile | in | _my-sensitive-data_ | Block |
93118

94119
2. Next, create the policy that allows the use of AI and specifies the prompt capture for specific user groups.
95120

96-
| Selector | Operator | Value |
97-
| -------- | -------- | ----- |
98-
| Application | in | *Artificial Intelligence*|
121+
| Selector | Operator | Value |
122+
| ----------- | -------- | ------------------------- |
123+
| Application | in | _Artificial Intelligence_ |
99124

100125
3. Under **Traffic**:
101126

102-
| Selector | Operator | Value|
103-
| -------- | -------- | ------ |
104-
| Application | in | *Artificial Intelligence*|
127+
| Selector | Operator | Value |
128+
| ----------- | -------- | ------------------------- |
129+
| Application | in | _Artificial Intelligence_ |
105130

106131
4. Under **Identity**:
107132

108-
| Selector | Operator| API Value | Action |
109-
| -------- | -------- | -------- | ------ |
110-
| User Group Names | in | `any(identity.groups.name[*] in {\"contractors\" \"cohort-224\"})`| Allow |
133+
| Selector | Operator | API Value | Action |
134+
| ---------------- | -------- | ------------------------------------------------------------------ | ------ |
135+
| User Group Names | in | `any(identity.groups.name[*] in {\"contractors\" \"cohort-224\"})` | Allow |
111136

112137
By structuring your policies in this way, you ensure that any instance of sensitive data is blocked from AI applications, no matter which user group is involved. If Cloudflare does not detect sensitive data, it will allow the prompt while capturing it for the targeted user groups – in this case, users belonging to the `contractors` and `cohort-224` groups. If that same user group were to then use sensitive data in a prompt, it would be detected and blocked.

0 commit comments

Comments
 (0)