Tutorial Tutorial Tutorial Cloudflare One Cloudflare One Cloudflare One ~40 phút ~40 min ~40 នាទី Đồng bộ 2026-06-10 Synced 2026-06-10 ធ្វើសមកាល 2026-06-10

Tạo và bảo mật một agent wrapper AI bằng cách sử dụng AI Gateway và Zero Trust Create and secure an AI agent wrapper using AI Gateway and Zero Trust ការបង្កើតនិងការសុវត្ថិភាព agent wrapper AI ដោយប្រើ AI Gateway និង Zero Trust

Hướng dẫn chi tiết đồng bộ từ docs Cloudflare — mỗi section có backlink tới đúng vị trí trên trang gốc. Detailed guide synced from Cloudflare docs — each section links to the matching anchor on the official page. មគ្គុទ្ទេសក៍លម្អិតធ្វើសមកាលពី docs Cloudflare — ផ្នែកនីមួយៗមានតំណទៅទីតាំងត្រូវគ្នានៅទំព័រផ្លូវការ។

← Danh mục ← Catalog ← បញ្ជី

Giải thích nhanh Quick context បរិបទរហ័ស

Thuộc Cloudflare One — Zero Trust, truy cập an toàn và kiểm soát traffic người dùng/thiết bị. Tutorial «Tạo và secure AI agent wrapper using AI Gateway và Zero Trust» giúp bạn làm quen luồng triển khai thật — phù hợp đọc trước khi mở tài liệu gốc tiếng Anh. Docs gốc chia khoảng 5 bước chính; bản tóm tắt dưới đây giúp bạn nắm khung trước khi làm theo từng lệnh.

This tutorial explains how to use Cloudflare AI Gateway and Zero Trust to create a functional and secure website wrapper for an AI agent.

វគ្គបណ្តុះបណ្តាលនេះបង្ហាញពីរបៀបដើម្បីប្រើ Cloudflare AI Gateway និង Zero Trust ដើម្បីបង្កើតវគ្គបណ្តុះបណ្តាលគេហទំព័រដែលមានប្រសិទ្ធិភាពនិងសុវត្ថិភាពសម្រាប់អេក្រង់ AI ។

Lưu ý Note ចំណាំ

Lưu ý trước khi làm Notes before you start ចំណាំមុនពេលចាប់ផ្តើម

  • Đây là bản tóm tắt trên Orange Cloud Learning Hub — không thay thế tài liệu chính thức.
  • Luôn mở liên kết «Tài liệu gốc» bên dưới khi cần lệnh CLI, snippet code và ảnh minh họa đầy đủ.
  • Zero Trust thường cần quyền admin trên tenant Cloudflare One và IdP đã kết nối.
  • Docs Cloudflare cập nhật thường xuyên — đối chiếu ngày «Rà soát lần cuối» trên trang gốc khi triển khai production.
  • This is a summary on Orange Cloud Learning Hub — it does not replace the official documentation.
  • Open the Official docs link below for CLI commands, code snippets, and full screenshots.
  • Zero Trust typically requires Cloudflare One tenant admin access and a connected IdP.
  • Cloudflare docs change frequently — verify the Last reviewed date on the official page before production use.
  • នេះគឺជាការបញ្ជាក់អំពី Orange Cloud Learning Hub — វាគឺជាការផ្លាស់ប្តូរនៃឯកសារផ្លូវការ។
  • ចុចតំណភ្ជាប់ Docs Official នៅខាងក្រោមសម្រាប់ការបញ្ជា CLI, សៀវភៅកូដនិងរូបថតពេញលេញ។
  • Zero Trust ជាទូទៅតម្រូវការ Cloudflare One អ្នកគ្រប់គ្រងហិរញ្ញវត្ថុ access និង IdP ។
  • Cloudflare បានផ្លាស់ប្តូរជាធម្មតានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅពេលវេលានៅ។

Tài liệu gốc — rà soát lần cuối: about 1 year ago Official docs — last reviewed: about 1 year ago ឯកសារផ្លូវការ — ពិនិត្យចុងក្រោយ: about 1 year ago

Overview Overview Overview

Tutorial này hướng dẫn cách use Cloudflare AI Gateway and Zero Trust to create a functional and secure website wrapper for an AI agent. Cloudflare Zero Trust administrators can protect access to the wrapper with Cloudflare Access . Additionally, you can enforce Gateway polic…

Read the "Overview" section below — open the official docs link for full screenshots and configuration tabs.

អានផ្នែក «Overview» ខាងក្រោម — បើកតំណ docs ផ្លូវការសម្រាប់រូបភាព និង tab កំណត់។

Mở section docs gốc ↗ Open source section ↗ បើកផ្នែក docs ផ្លូវការ ↗
Hướng dẫn này giải thích làm thế nào để sử dụng Cloudflare AI Gateway và Zero Trust để tạo ra một trang web đóng gói chức năng và an toàn cho một đại lý AI. Cloudflare Zero Trust quản trị viên có thể bảo vệ access để bao bì với Cloudflare Access. Ngoài ra, bạn có thể thực thi Gateway policies để kiểm soát cách người dùng của bạn tương tác với các đại lý AI, bao gồm thực hiện các đại lý AI trong một trình duyệt cô lập với Browser Isolation, thực thi các hồ sơ Data Loss Prevention để ngăn người dùng của bạn chia sẻ dữ liệu nhạy cảm, và quét nội dung để tránh các câu trả lời từ các đại lý AI vi phạm các hướng dẫn nội bộ của công ty. Tạo một đại lý AI wrapper cũng là một cách hiệu quả để thực thi kiểm soát người thuê nếu bạn có một kế hoạch doanh nghiệp cho một nhà cung cấp AI cụ thể, chẳng hạn như ChatGPT Enterprise.
This tutorial explains how to use Cloudflare AI Gateway and Zero Trust to create a functional and secure website wrapper for an AI agent. Cloudflare Zero Trust administrators can protect access to the wrapper with Cloudflare Access. Additionally, you can enforce Gateway policies to control how your users interact with AI agents, including executing AI agents in an isolated browser with Browser Isolation, enforcing Data Loss Prevention profiles to prevent your users from sharing sensitive data, and scanning content to avoid answers from AI agents that violate internal corporate guidelines. Creating an AI agent wrapper is also an effective way to enforce tenant control if you have an enterprise plan for a specific AI provider, such as ChatGPT Enterprise.
This tutorial explains how to use Cloudflare AI Gateway and Zero Trust to create a functional and secure website wrapper for an AI agent. Cloudflare Zero Trust administrators can protect access to the wrapper with Cloudflare Access. Additionally, you can enforce Gateway policies to control how your users interact with AI agents, including executing AI agents in an isolated browser with Browser Isolation, enforcing Data Loss Prevention profiles to prevent your users from sharing sensitive data, and scanning content to avoid answers from AI agents that violate internal corporate guidelines. Creating an AI agent wrapper is also an effective way to enforce tenant control if you have an enterprise plan for a specific AI provider, such as ChatGPT Enterprise.
Hướng dẫn này sử dụng ChatGPT như một ví dụ về đại lý AI.
This tutorial uses ChatGPT as an example AI agent.
វគ្គបណ្តុះបណ្តាលនេះប្រើ ChatGPT ជាឧទាហរណ៍អេក្រង់ AI ។

Liên kết liên quan (docs Cloudflare) Related links (Cloudflare docs) តំណពាក់ព័ន្ធ (docs Cloudflare)

Trước khi bạn bắt đầu Before you begin មុនពេលដែលអ្នកចាប់ផ្តើម

Phần «Before you begin» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.

Read the "Before you begin" section below — open the official docs link for full screenshots and configuration tabs.

អានផ្នែក «មុនពេលដែលអ្នកចាប់ផ្តើម» ខាងក្រោម — បើកតំណ docs ផ្លូវការសម្រាប់រូបភាព និង tab កំណត់។

Mở section docs gốc ↗ Open source section ↗ បើកផ្នែក docs ផ្លូវការ ↗
Hãy chắc chắn rằng bạn có:
Make sure you have:
សូមប្រាកដថាអ្នកមាន:
  • អាសយដ្ឋាន Cloudflare Zero Trust organization
  • គោលបំណង API សម្រាប់អ្នកផ្គត់ផ្គង់ AI ដែលអ្នកចង់បានដូចជាគោលបំណង OpenAI API key ↗ សម្រាប់ ChatGPT ។

Liên kết liên quan (docs Cloudflare) Related links (Cloudflare docs) តំណពាក់ព័ន្ធ (docs Cloudflare)

1.Điều Tạo một AI gateway 1. Create an AI gateway 1 ។ បានបង្កើត AI gateway

Phần «Tạo AI gateway» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.

Read the "1. Create an AI gateway" section below — open the official docs link for full screenshots and configuration tabs.

អានផ្នែក «1 ។ បានបង្កើត AI gateway» ខាងក្រោម — បើកតំណ docs ផ្លូវការសម្រាប់រូបភាព និង tab កំណត់។

Mở section docs gốc ↗ Open source section ↗ បើកផ្នែក docs ផ្លូវការ ↗
Đầu tiên, hãy tạo AI gateway để điều khiển ứng dụng AI của bạn.
First, create an AI gateway to control your AI app.
សូមបង្កើត AI gateway ដើម្បីគ្រប់គ្រងកម្មវិធី AI របស់អ្នក។
  1. Trong Cloudflare dashboard ↗, đi đến trang AI Gateway.
  1. In the Cloudflare dashboard ↗, go to the AI Gateway page.
  1. ក្នុង Cloudflare dashboard ↗ សូមចូលទៅក្នុងទំព័រ AI Gateway ។
  1. Chọn Create Gateway
  2. Hãy đặt tên gateway của bạn.
  3. Chọn Create
  4. Cài đặt các tùy chọn mong muốn của bạn cho gateway.
  5. Connect your AI provider để truy vấn proxy cho đại lý AI của bạn lựa chọn bằng cách sử dụng AI gateway của bạn.
  6. (Tùy chọn) Chọn Authenticated Gateway Tính năng Xác thực Gateway đảm bảo rằng AI gateway của bạn chỉ có thể được gọi an toàn bằng cách thực thi mã thông báo trong form của tiêu đề yêu cầu cf-aig-authorization.
  1. Select Create Gateway.
  2. Name your gateway.
  3. Select Create.
  4. Configure your desired options for the gateway.
  5. Connect your AI provider to proxy queries to your AI agent of choice using your AI gateway.
  6. (Optional) Turn on Authenticated Gateway. The Authenticated Gateway feature ensures your AI gateway can only be called securely by enforcing a token in the form of a request header cf-aig-authorization.
  1. សូមជ្រើស Create Gateway ។
  2. ឈ្មោះរបស់អ្នក gateway ។
  3. សូមជ្រើស Create ។
  4. សូមបញ្ជាក់ពីរបៀបដែលអ្នកចង់ gateway ។
  5. Connect your AI provider ដើម្បីបញ្ជាទិន្នន័យ proxy ទៅអេក្រង់ AI របស់អ្នកដែលអ្នកចង់ប្រើ AI gateway របស់អ្នក។
  6. (តម្រូវការ) ចុច Authenticated Gateway ។ ឧបករណ៍ Gateway ដែលធ្វើឱ្យប្រាកដថា AI gateway របស់អ្នកអាចត្រូវបានគេស្គាល់ដោយសុវត្ថិភាពតែដោយការអនុវត្ត token នៅលើ form នៃការបញ្ជាទម្រង់ cf-aig-authorization ។
1.Điều Đi đến AI \> AI Gateway. 2.Đối với Chọn AI gateway, sau đó đi đến Settings. 3 Cái Nhấn Authenticated Gateway rồi chọn Confirm. Bốn Chọn Create authentication token, rồi chọn Create an AI Gateway authentication token. 5 Cấu hình token của bạn và sao chép giá trị token. Khi tạo Worker của bạn, bạn sẽ cần phải thông qua mã thông báo này khi gọi AI gateway.
1. Go to AI \> AI Gateway. 2. Select your AI gateway, then go to Settings. 3. Turn on Authenticated Gateway, then choose Confirm. 4. Select Create authentication token, then select Create an AI Gateway authentication token. 5. Configure your token and copy the token value. When creating your Worker, you will need to pass this token when calling your AI gateway.
1 ។ ចុចទៅ AI \> AI Gateway ។ 2 ។ ជ្រើស AI gateway របស់អ្នកបន្ទាប់មកចូលទៅ Settings ។ 3 ។ ចុច Authenticated Gateway ហើយចុច Confirm ។ 4 ។ ចុច Create authentication token ហើយចុច Create an AI Gateway authentication token ។ 5 ។ ទាញយក token របស់អ្នកហើយចុចតម្លៃ token របស់អ្នក។ នៅពេលដែលអ្នកបង្កើតបុគ្គលិករបស់អ្នកអ្នកនឹងត្រូវដំណើរការ token នេះនៅពេលដែលអ្នកចុច AI gateway របស់អ្នក។
Để biết thêm thông tin, hãy tham khảo Getting started with AI Gateway.
For more information, refer to Getting started with AI Gateway.
សម្រាប់ព័ត៌មានបន្ថែមសូមមើល Getting started with AI Gateway ។

Liên kết liên quan (docs Cloudflare) Related links (Cloudflare docs) តំណពាក់ព័ន្ធ (docs Cloudflare)

2.Đối với (Tùy chọn) Sử dụng Guardrails để chặn nội dung không an toàn hoặc không phù hợp 2. (Optional) Use Guardrails to block unsafe or inappropriate content 2 ។ (តម្រូវការ) ប្រើ Guardrails ដើម្បីកាត់បន្ថយសម្ភារៈមិនសុវត្ថិភាពឬមិនត្រឹមត្រូវ

Phần «(Optional) Use Guardrails to block unsafe or inappropriate content» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.

Read the "2. (Optional) Use Guardrails to block unsafe or inappropriate content" section below — open the official docs link for full screenshots and configuration tabs.

អានផ្នែក «2 ។ (តម្រូវការ) ប្រើ Guardrails ដើម្បីកាត់បន្ថយសម្ភារៈមិនសុវត្ថិភាពឬមិនត្រឹមត្រូវ» ខាងក្រោម — បើកតំណ docs ផ្លូវការសម្រាប់រូបភាព និង tab កំណត់។

Mở section docs gốc ↗ Open source section ↗ បើកផ្នែក docs ផ្លូវការ ↗
Guardrails là một tính năng bảo mật tích hợp AI Gateway cho phép Cloudflare xác định nội dung không an toàn hoặc không phù hợp trong lời nhắc và phản hồi dựa trên các thể loại đã chọn.
Guardrails is an built-in AI Gateway security feature that allows Cloudflare to identify unsafe or inappropriate content in prompts and responses based on selected categories.
Guardrails គឺជាលក្ខណៈពិសេសសុវត្ថិភាព AI Gateway ដែលអនុញ្ញាតឱ្យ Cloudflare ដើម្បីរកឃើញសម្ភារៈដែលមិនសុវត្ថិភាពឬមិនត្រឹមត្រូវនៅក្នុងសំណួរនិងការឆ្លើយតបដោយផ្អែកលើប្រភេទដែលបានជ្រើសរើស។
  1. Trong bảng điều khiển Cloudflare, đi đến trang AI Gateway.
  1. In the Cloudflare dashboard, go to the AI Gateway page.
  1. ក្នុងប្រព័ន្ធប្រតិបត្តិការ Cloudflare សូមចូលទៅក្នុងទំព័រ AI Gateway ។
  1. Chọn AI gateway của bạn.
  2. Đi đến Guardrails
  3. Quay vào Guardrails.
  4. Chọn Change để cấu hình các thể loại mà bạn muốn lọc cho cả lời nhắc và phản hồi.
  1. Select your AI gateway.
  2. Go to Guardrails.
  3. Turn on Guardrails.
  4. Select Change to configure the categories you would like to filter for both prompts and responses.
  1. សូមជ្រើស AI gateway របស់អ្នក។
  2. សូមចូលទៅ Guardrails ។
  3. សូមផ្លាស់ប្តូរ Guardrails ។
  4. ចុច Change ដើម្បីកំណត់ប្រភេទដែលអ្នកចង់បម្រើសម្រាប់សំណួរនិងការឆ្លើយតបទាំងពីរ។

Liên kết liên quan (docs Cloudflare) Related links (Cloudflare docs) តំណពាក់ព័ន្ធ (docs Cloudflare)

1.Điều Tạo nhân viên 1. Create the Worker 1 ។ ការបង្កើតការងារ

Phần «Tạo Worker» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.

Read the "1. Create the Worker" section below — open the official docs link for full screenshots and configuration tabs.

អានផ្នែក «1 ។ ការបង្កើតការងារ» ខាងក្រោម — បើកតំណ docs ផ្លូវការសម្រាប់រូបភាព និង tab កំណត់។

Mở section docs gốc ↗ Open source section ↗ បើកផ្នែក docs ផ្លូវការ ↗
Để xây dựng Worker, bạn sẽ cần phải chọn nếu bạn muốn xây dựng nó cục bộ bằng cách sử dụng Wrangler hoặc từ xa bằng cách sử dụng dashboard ↗.
In order to build the Worker, you will need to choose if you want to build it locally using Wrangler or remotely using the dashboard ↗.
ដើម្បីបង្កើត Worker អ្នកនឹងត្រូវជ្រើសរើសប្រសិនបើអ្នកចង់បង្កើតវាដោយផ្ទាល់ដោយប្រើ Wrangler ឬដោយផ្ទាល់ដោយប្រើ dashboard ↗ ។
  1. Trong một thiết bị đầu cuối, hãy đăng nhập vào tài khoản Cloudflare của bạn:
  1. In a terminal, log in to your Cloudflare account:
  1. ក្នុងការបញ្ចប់បញ្ចប់, សូមចូលទៅក្នុងគណនីរបស់អ្នក Cloudflare:
Cửa sổ Terminal
Terminal window
បង្វិល Terminal
text
wrangler login
  1. Bắt đầu dự án tại địa phương:
  1. Initiate the project locally:
  1. ការចាប់ផ្តើមគម្រោងក្នុងស្រុក:
Cửa sổ Terminal
Terminal window
បង្វិល Terminal
text
mkdir ai-agent-wrapper  
cd ai-agent-wrapper  
wrangler init
  1. Tạo tệp cấu hình Wrangler:
  1. Create a Wrangler configuration file:
  1. ការបង្កើតឯកសារការកំណត់ Wrangler:
text
name = "ai-agent-wrapper"  
main = "src/index.js"  
compatibility_date = "2023-10-30"  
[vars]  
# Add any environment variables here
  1. Thêm phím API của nhà cung cấp AI của bạn dưới dạng secret:
  1. Add your AI provider's API key as a secret:
  1. បន្ថែមគោលបំណង API នៃអ្នកផ្គត់ផ្គង់ AI របស់អ្នកជា secret:
Cửa sổ Terminal
Terminal window
បង្វិល Terminal
text
wrangler secret put <OPENAI_API_KEY>
Bây giờ bạn có thể xây dựng Worker bằng cách sử dụng tệp index.js được tạo bởi Wrangler.
You can now build the Worker using the index.js file created by Wrangler.
អ្នកអាចបង្កើត Worker ដោយប្រើឯកសារ index.js ដែលបានបង្កើតដោយ Wrangler ។
  1. Trong bảng điều khiển Cloudflare, đi đến trang Workers & Pages.
  1. In the Cloudflare dashboard, go to the Workers & Pages page.
  1. ក្នុងប្រព័ន្ធប្រតិបត្តិការ Cloudflare សូមចូលទៅក្នុងទំព័រ Workers & Pages ។
  1. Chọn Create
  2. Trong Workers, chọn mẫu Hello world.
  3. Tên nhân viên của bạn, sau đó chọn Deploy.
  4. Chọn Công nhân của bạn, sau đó đi đến tab Settings.
  5. Đi đến Variables and Secrets, sau đó chọn Add.
  6. Chọn Secret làm kiểu, đặt tên bí mật của bạn (ví dụ, OPENAI<em>API</em>KEY), và nhập giá trị của khóa API của nhà cung cấp AI của bạn trong Value.
  1. Select Create.
  2. In Workers, choose the Hello world template.
  3. Name your worker, then select Deploy.
  4. Select your Worker, then go to the Settings tab.
  5. Go to Variables and Secrets, then select Add.
  6. Choose Secret as the type, name your secret (for example, OPENAI<em>API</em>KEY), and enter the value of your AI provider's API key in Value.
  1. សូមជ្រើស Create ។
  2. ក្នុង Workers, ជ្រើសគំរូ Hello world ។
  3. ឈ្មោះបុគ្គលិករបស់អ្នកបន្ទាប់មកចុច Deploy ។
  4. ជ្រើសរើសការងាររបស់អ្នកបន្ទាប់មកចូលទៅក្នុងប្រភេទ Settings ។
  5. ចុច Variables and Secrets ហើយចុច Add ។
  6. សូមជ្រើស Secret ដូចជាការប្រើសម្រាប់ឈ្មោះសិទ្ធិរបស់អ្នក (ដូចជា OPENAI<em>API</em>KEY) និងចុះតម្លៃនៃគោលបំណង API នៃអ្នកផ្គត់ផ្គង់ AI របស់អ្នកនៅក្នុង Value ។
Bây giờ bạn có thể xây dựng Worker bằng cách sử dụng trình soạn thảo mã trực tuyến bằng cách chọn Edit code trên trang Worker của bạn.
You can now build the Worker using the online code editor by selecting Edit code on your Worker page.
ឥឡូវនេះអ្នកអាចបង្កើត Worker ដោយប្រើកម្មវិធីកូដអ៊ីនធឺណិតដោយជ្រើស Edit code នៅលើទំព័រ Worker របស់អ្នក។

Liên kết liên quan (docs Cloudflare) Related links (Cloudflare docs) តំណពាក់ព័ន្ធ (docs Cloudflare)

2.Đối với Xây dựng công nhân 2. Build the Worker 2 ។ ការបង្កើតការងារ

Phần «Build Worker» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.

Read the "2. Build the Worker" section below — open the official docs link for full screenshots and configuration tabs.

អានផ្នែក «2 ។ ការបង្កើតការងារ» ខាងក្រោម — បើកតំណ docs ផ្លូវការសម្រាប់រូបភាព និង tab កំណត់។

Mở section docs gốc ↗ Open source section ↗ បើកផ្នែក docs ផ្លូវការ ↗
Sau đây là một ví dụ về Starter Worker phục vụ một front-end đơn giản để cho phép người dùng tương tác với một nhà cung cấp AI đằng sau AI Gateway. Ví dụ này sử dụng OpenAI như nhà cung cấp AI của nó:
The following is an example starter Worker that serves a simple front-end to allow a user to interact with an AI provider behind AI Gateway. This example uses OpenAI as its AI provider:
ខាងក្រោមនេះគឺជាឧទាហរណ៍ starter worker ដែលផ្តល់សេវាកម្ម front-end ដែលមានភាពងាយស្រួលដើម្បីអនុញ្ញាតឱ្យអ្នកប្រើប្រាស់ក្នុងការផ្លាស់ប្តូរជាមួយអ្នកផ្គត់ផ្គង់ AI បន្ទាប់ពី AI Gateway ។ គំរូនេះប្រើ OpenAI ជាអ្នកផ្គត់ផ្គង់ AI របស់ខ្លួន:
JavaScript Đánh giá
JavaScript
កុំព្យូទ័រ
text
export default {

  async fetch(request, env) {

    if (request.url.endsWith("/api/chat")) {

      if (request.method === "POST") {

        try {

          const { messages } = await request.json();


          const response = await fetch(

            "https://gateway.ai.cloudflare.com/v1/$ACCOUNT_ID/$GATEWAY_ID/openai/chat/completions",

            {

              method: "POST",

              headers: {

                "Content-Type": "application/json",

                Authorization: `Bearer ${env.OPENAI_API_KEY}`,

              },

              body: JSON.stringify({

                model: "gpt-4o-mini",

                messages: messages,

              }),

            },

          );


          if (!response.ok) {

            throw new Error(`AI Gateway Error: ${response.status}`);

          }


          const result = await response.json();

          return new Response(

            JSON.stringify({

              response: result.choices[0].message.content,

            }),

            {

              headers: { "Content-Type": "application/json" },

            },

          );

        } catch (error) {

          return new Response(JSON.stringify({ error: error.message }), {

            status: 500,

            headers: { "Content-Type": "application/json" },

          });

        }

      }

      return new Response("Method not allowed", { status: 405 });

    }


    return new Response(HTML, {

      headers: { "Content-Type": "text/html" },

    });

  },

};


const HTML = `<!DOCTYPE html>

  <html lang="en" data-theme="dark">

177 collapsed lines

  <head>

      <meta charset="UTF-8">

      <meta name="viewport" content="width=device-width, initial-scale=1.0">

      <title>ChatGPT Wrapper</title>

      <style>

          :root {

              --background-color: #1a1a1a;

              --chat-background: #2d2d2d;

              --text-color: #ffffff;

              --input-border: #404040;

              --message-ai-background: #404040;

              --message-ai-text: #ffffff;

          }


          body {

              font-family: system-ui, sans-serif;

              margin: 0;

              padding: 20px;

              background: var(--background-color);

              display: flex;

              flex-direction: column;

              align-items: center;

              gap: 20px;

              color: var(--text-color);

          }


          .chat-container {

              width: 100%;

              max-width: 800px;

              background: var(--chat-background);

              border-radius: 10px;

              box-shadow: 0 2px 10px rgba(0,0,0,0.1);

              height: 80vh;

              display: flex;

              flex-direction: column;

          }


          .chat-header {

              padding: 15px 20px;

              border-bottom: 1px solid var(--input-border);

              background: var(--chat-background);

              border-radius: 10px 10px 0 0;

              text-align: center;

          }


          .chat-messages {

              flex-grow: 1;

              overflow-y: auto;

              padding: 20px;

          }


          .message {

              margin-bottom: 20px;

              padding: 10px 15px;

              border-radius: 10px;

              max-width: 80%;

          }


          .user-message {

              background: #007AFF;

              color: white;

              margin-left: auto;

          }


          .ai-message {

              background: var(--message-ai-background);

              color: var(--message-ai-text);

          }


          .input-container {

              padding: 20px;

              border-top: 1px solid var(--input-border);

              display: flex;

              gap: 10px;

          }


          input {

              flex-grow: 1;

              padding: 10px;

              border: 1px solid var(--input-border);

              border-radius: 5px;
Lưu ý rằng ID tài khoản và gateway ID cần phải được thay thế trong điểm cuối AI Gateway. Bạn có thể thêm chúng dưới dạng environment variables hoặc secrets trong Workers. Nếu bạn chọn sử dụng Authenticated Gateway khi tạo AI gateway, hãy chắc chắn rằng bạn cũng thêm mã thông báo của mình làm bí mật và chuyển giá trị của nó sang AI gateway trong tiêu đề cf-aig-authorization.
Note that the account ID and gateway ID need to be replaced in the AI Gateway endpoint. You can add these as environment variables or secrets in Workers. If you chose to use Authenticated Gateway when creating your AI gateway, make sure to also add your token as a secret and pass its value to the AI gateway in the cf-aig-authorization header.
សូមពិនិត្យឡើងវិញថាតើអ៊ីនធឺណិតនិងអ៊ីនធឺណិត gateway មានតម្រូវការដើម្បីផ្លាស់ប្តូរនៅក្នុងអ៊ីនធឺណិត AI Gateway ។ អ្នកអាចបន្ថែមទាំងនេះជា environment variables ឬ secrets នៅក្នុង Workers ។ ប្រសិនបើអ្នកបានជ្រើសរើសការប្រើប្រាស់ Gateway នៅពេលដែលអ្នកបានបង្កើត AI gateway របស់អ្នក, សូមពិនិត្យឡើងវិញដើម្បីបន្ថែមបច្ចុប្បន្នរបស់អ្នកជាសាសនាចក្រនិងផ្ញើតម្លៃរបស់វាទៅ AI gateway នៅក្នុង cf-aig-authorization header ។

Liên kết liên quan (docs Cloudflare) Related links (Cloudflare docs) តំណពាក់ព័ន្ធ (docs Cloudflare)

3 Cái Xuất bản The Worker 3. Publish the Worker 3 ។ ការបោះពុម្ព អ្នកការងារ

Phần «Publish Worker» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.

Read the "3. Publish the Worker" section below — open the official docs link for full screenshots and configuration tabs.

អានផ្នែក «3 ។ ការបោះពុម្ព អ្នកការងារ» ខាងក្រោម — បើកតំណ docs ផ្លូវការសម្រាប់រូបភាព និង tab កំណត់។

Mở section docs gốc ↗ Open source section ↗ បើកផ្នែក docs ផ្លូវការ ↗
Sau khi mã Worker hoàn tất, bạn cần phải làm cho Worker có thể được địa chỉ bằng cách sử dụng tên máy chủ có thể điều khiển bằng Cloudflare Access.
Once the Worker code is complete, you need to make the Worker addressable using a hostname controllable by Cloudflare Access.
បន្ទាប់ពីកូដបុគ្គលិកត្រូវបានបញ្ចប់អ្នកត្រូវធ្វើឱ្យបុគ្គលិកអាចត្រូវបានអាសយដ្ឋានដោយប្រើឈ្មោះអាសយដ្ឋានដែលអាចគ្រប់គ្រងដោយ Cloudflare Access ។
Chỉnh sửa tệp cấu hình Wrangler và thêm thông tin sau để đảm bảo rằng Worker chỉ có thể truy cập bằng tên máy chủ tùy chỉnh:
Edit the Wrangler configuration file and add the following information to ensure that the Worker is only accessible using the custom hostname:
ការធ្វើតេស្តឯកសារកំណត់ Wrangler និងបន្ថែមទិន្នន័យដូចខាងក្រោមដើម្បីធានាថាអ្នកធ្វើតេស្តអាចរកបានតែដោយប្រើឈ្មោះក្រុមហ៊ុនផ្គត់ផ្គង់ផ្ទាល់ខ្លួន:
TOML
TOML
TOML
text
name = "ai-agent-wrapper"

main = "src/index.js"

compatibility_date = "2023-10-30"

workers_dev = false


# Replace with your custom domain

routes = [

  { pattern = "<YOUR_CUSTOM_DOMAIN>", custom_domain = true }

]


[vars]

# Add any environment variables here
Để xuất bản nhân viên, hãy chạy wrangler deploy.
To publish the worker, run wrangler deploy.
ប្រសិនបើអ្នកចង់ធ្វើការជាមួយអ្នកធ្វើការ wrangler deploy
Nếu bạn đã xây dựng Worker từ xa bằng cách sử dụng code editor có sẵn trong bảng điều khiển Cloudflare, bạn có thể triển khai nó bằng cách chọn Deploy.
If you built your Worker remotely using the code editor available in the Cloudflare dashboard, you can deploy it by selecting Deploy.
ប្រសិនបើអ្នកបានបង្កើត Worker របស់អ្នកដោយប្រើ code editor ដែលអាចរកបាននៅក្នុងប្រព័ន្ធប្រតិបត្តិការ Cloudflare អ្នកអាចដំឡើងវាដោយជ្រើស Deploy ។
Để đảm bảo rằng Công nhân chỉ có thể truy cập từ tên máy chủ tùy chỉnh:
To ensure that the Worker is only accessible from the custom hostname:
ដើម្បីធ្វើឱ្យប្រាកដថាបុគ្គលិកអាចរកបានតែពីឈ្មោះក្រុមហ៊ុនផ្គត់ផ្គង់ផ្ទាល់ខ្លួន:
  1. Trong bảng điều khiển Cloudflare, đi đến trang Workers & Pages.
  1. In the Cloudflare dashboard, go to the Workers & Pages page.
  1. ក្នុងប្រព័ន្ធប្រតិបត្តិការ Cloudflare សូមចូលទៅក្នុងទំព័រ Workers & Pages ។
  1. Chọn nhân viên của bạn
  2. Đi đến Settings
  3. Trong Domains & Routes, chọn Add.
  4. Chọn Custom domain
  5. Nhập tên miền tùy chỉnh mong muốn.
  6. Chọn Add domain
  1. Select your Worker.
  2. Go to Settings.
  3. Within Domains & Routes, select Add.
  4. Choose Custom domain.
  5. Enter your desired custom domain name.
  6. Select Add domain.
  1. ជ្រើសបុគ្គលិករបស់អ្នក
  2. សូមចូលទៅ Settings ។
  3. ក្នុងកំណត់ Domains & Routes ចុច Add ។
  4. សូមជ្រើស Custom domain ។
  5. ទាញយកឈ្មោះ domain របស់អ្នកដែលអ្នកចង់។
  6. សូមជ្រើស Add domain ។
Công nhân hiện đang đứng sau một tên máy chủ công cộng có thể truy cập. Đảm bảo tắt cả workers.dev và Preview URLs để Người lao động chỉ có thể truy cập với tên miền tùy chỉnh của mình.
The Worker is now behind an addressable public hostname. Make sure to turn off both workers.dev and Preview URLs so that the Worker can only be accessed with its custom domain.
ហ្វេសប៊ុកអ៊ីនធឺណិតនៅពេលនេះគឺនៅលើផ្ទៃខាងក្រោមនៃឈ្មោះអ៊ីនធឺណិតដែលអាចរកបាន។ សូមបញ្ជាក់ថាតើអ្នកអាចបញ្ចូលគ្នានេះដោយ workers.dev និង Preview URLs ដូច្នេះអ្នកអាចចូលគ្នានេះដោយប្រសិនបើអ្នកអាចចូលគ្នានេះដោយប្រសិនបើអ្នកអាចចូលគ្នានេះដោយប្រសិនបើអ្នកអាចចូលគ្នានេះដោយប្រសិទ្ធិភាព។

Liên kết liên quan (docs Cloudflare) Related links (Cloudflare docs) តំណពាក់ព័ន្ធ (docs Cloudflare)

Bốn Đảm bảo vòng bi với Access 4. Secure the wrapper with Access 4 ។ សូមបញ្ជាក់អំពី Access

Phần «Bảo mật wrapper với Access» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.

Read the "4. Secure the wrapper with Access" section below — open the official docs link for full screenshots and configuration tabs.

អានផ្នែក «4 ។ សូមបញ្ជាក់អំពី Access» ខាងក្រោម — បើកតំណ docs ផ្លូវការសម្រាប់រូបភាព និង tab កំណត់។

Mở section docs gốc ↗ Open source section ↗ បើកផ្នែក docs ផ្លូវការ ↗
Để đảm bảo rằng chỉ người dùng tin cậy mới có thể access nó:
To secure the AI agent wrapper to ensure that only trusted users can access it:
ដើម្បីសុវត្ថិភាពអេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់។
  1. Trong Cloudflare dashboard ↗, đi đến Zero Trust \> Access controls \> Applications.
  2. Chọn Create new application
  3. Chọn Self-hosted and private
  4. Chọn Add public hostname và nhập miền tùy chỉnh mà bạn đã thiết lập cho Worker của mình.
  5. Configure your Access application cho nhân viên của bạn.
  6. Thêm Access policies để kiểm soát ai có thể kết nối với ứng dụng của bạn.
  1. In the Cloudflare dashboard ↗, go to Zero Trust \> Access controls \> Applications.
  2. Select Create new application.
  3. Select Self-hosted and private.
  4. Select Add public hostname and enter the custom domain you set for your Worker.
  5. Configure your Access application for your Worker.
  6. Add Access policies to control who can connect to your application.
  1. ក្នុង Cloudflare dashboard ↗ សូមចូលទៅទៅ Zero Trust \> Access controls \> Applications ។
  2. សូមជ្រើស Create new application ។
  3. សូមជ្រើស Self-hosted and private ។
  4. សូមជ្រើស Add public hostname ហើយចូលទៅក្នុងឧបករណ៍ដែលអ្នកបានកំណត់សម្រាប់ Worker របស់អ្នក។
  5. Configure your Access application សម្រាប់ការងាររបស់អ្នក។
  6. បន្ថែម Access policies ដើម្បីត្រួតពិនិត្យអ្នកដែលអាចចូលទៅក្នុងកម្មវិធីរបស់អ្នក។
Bây giờ AI wrapper của bạn chỉ có thể được truy cập bởi người dùng của bạn thành công phù hợp với chính sách Access của bạn.
Now your AI wrapper can only be accessed by your users that successfully match your Access policies.
ឥឡូវនេះប្រព័ន្ធផ្សព្វផ្សាយពាណិជ្ជកម្ម AI របស់អ្នកអាចត្រូវបានចូលទៅក្នុងការប្រើប្រាស់របស់អ្នកដែលបានជួបប្រទះយ៉ាងល្អជាមួយគោលនយោបាយ Access របស់អ្នក។

Liên kết liên quan (docs Cloudflare) Related links (Cloudflare docs) តំណពាក់ព័ន្ធ (docs Cloudflare)

5 Block access đến các đại lý AI công cộng với Gateway 5. Block access to public AI agents with Gateway 5 ។ ប្លុក access ទៅអេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់ជាមួយ Gateway

Phần «Block access to public AI agents với Gateway» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.

Read the "5. Block access to public AI agents with Gateway" section below — open the official docs link for full screenshots and configuration tabs.

អានផ្នែក «5 ។ ប្លុក access ទៅអេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់ជាមួយ Gateway» ខាងក្រោម — បើកតំណ docs ផ្លូវការសម្រាប់រូបភាព និង tab កំណត់។

Mở section docs gốc ↗ Open source section ↗ បើកផ្នែក docs ផ្លូវការ ↗
Bây giờ bạn có thể chặn access cho tất cả các đại lý AI công cộng không được ủy quyền với một Gateway HTTP policy.
You can now block access to all unauthorized public AI agents with a Gateway HTTP policy.
You can now block access to all unauthorized public AI agents with a Gateway HTTP policy.
  1. Trong Cloudflare dashboard ↗, đi đến Zero Trust & > Traffic policies > Firewall policies > HTTP.
  2. Chọn Add a policy
  3. Thêm chính sách sau:
  1. In the Cloudflare dashboard ↗, go to Zero Trust \> Traffic policies \> Firewall policies \> HTTP.
  2. Select Add a policy.
  3. Add the following policy:
  1. ក្នុង Cloudflare dashboard ↗ សូមចូលទៅទៅ Zero Trust \> Traffic policies \> Firewall policies \> HTTP ។
  2. សូមជ្រើស Add a policy ។
  3. សូមបញ្ចូលគោលបំណងដូចខាងក្រោម:
| Selector | Operator | Value | Action | | ------------------ | -------- | ------------------------- | ------ | | Content Categories | in | Artificial Intelligence | Block |
| Selector | Operator | Value | Action | | ------------------ | -------- | ------------------------- | ------ | | Content Categories | in | Artificial Intelligence | Block |
| Selector | Operator | Value | Action | | ------------------ | -------- | ------------------------- | ------ | | Content Categories | in | Artificial Intelligence | Block |
  1. Chọn Create policy
  1. Select Create policy.
  1. សូមជ្រើស Create policy ។
Điều này đảm bảo rằng các đại lý AI công cộng không thể truy cập bằng cách sử dụng điểm cuối được quản lý.
This ensures that public AI agents are not accessible using a managed endpoint.
នេះធ្វើឱ្យប្រាកដថាអេឡិចត្រូនិអេឡិចត្រូនិអេឡិចត្រូនិអេឡិចត្រូនិអេឡិចត្រូនិអេឡិចត្រូនិអេឡិចត្រូនិអេឡិចត្រូនិអេឡិចត្រូនិអេឡិចត្រូនិអេឡិចត្រូនិអេឡិចត្រូនិអេឡិចត្រូនិអេឡិចត្រូនិអេឡិចត្រូនិអេឡិចត្រូនិអេឡិចត្រូនិអេឡិចត្រូនិអេឡិចត្រូនិអេឡិចត្រូនិអេឡិចត្រូនិអេឡិចត្រូនិអេឡិចត្រូនិ។
Ngoài ra, bạn có thể ngăn người dùng sử dụng các đại lý AI công cộng bằng cách hiển thị custom block message, redirect hoặc user notification hướng người dùng đến máy đóng gói đại lý AI.
Alternatively, you can prevent users from using public AI agents by displaying a custom block message, redirect, or a user notification directing users to the AI agent wrapper.
Alternatively, you can prevent users from using public AI agents by displaying a custom block message, redirect, or a user notification directing users to the AI agent wrapper.

Liên kết liên quan (docs Cloudflare) Related links (Cloudflare docs) តំណពាក់ព័ន្ធ (docs Cloudflare)

Sáu Enforce Data Loss Prevention và Clientless Browser Isolation 6. Enforce Data Loss Prevention and Clientless Browser Isolation 6 ។ ការពារការកាត់បន្ថយទិន្នន័យនិងការកាត់បន្ថយទិន្នន័យដោយគ្មានកុំព្យូទ័រ

Phần «Enforce Data Loss Prevention và Clientless Browser Isolation» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.

Read the "6. Enforce Data Loss Prevention and Clientless Browser Isolation" section below — open the official docs link for full screenshots and configuration tabs.

អានផ្នែក «6 ។ ការពារការកាត់បន្ថយទិន្នន័យនិងការកាត់បន្ថយទិន្នន័យដោយគ្មានកុំព្យូទ័រ» ខាងក្រោម — បើកតំណ docs ផ្លូវការសម្រាប់រូបភាព និង tab កំណត់។

Mở section docs gốc ↗ Open source section ↗ បើកផ្នែក docs ផ្លូវការ ↗
Bây giờ bạn có toàn quyền kiểm soát access cho máy đóng gói đại lý AI của mình, bạn có thể áp dụng các phương pháp bảo mật bổ sung như Phòng ngừa mất dữ liệu (DLP) và Tách web không khách hàng để bảo vệ và kiểm soát dữ liệu được chia sẻ với đại lý AI.
Now that you have full control over access to your AI agent wrapper, you can enforce extra security methods such as Data Loss Prevention (DLP) and Clientless Web Isolation to protect and control data shared with the AI agent.
ឥឡូវនេះអ្នកមានការត្រួតពិនិត្យពេញលេញអំពី access ទៅលើអេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់អេក្រង់។

Ứng dụng Profile Data Loss Prevention Apply Data Loss Prevention profiles ទាញយកឯកសារប្រឆាំងនឹងការកាត់បន្ថយទិន្នន័យ

Phần «Apply Data Loss Prevention profiles» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.

Read the "Apply Data Loss Prevention profiles" section below — open the official docs link for full screenshots and configuration tabs.

អានផ្នែក «ទាញយកឯកសារប្រឆាំងនឹងការកាត់បន្ថយទិន្នន័យ» ខាងក្រោម — បើកតំណ docs ផ្លូវការសម្រាប់រូបភាព និង tab កំណត់។

Mở section docs gốc ↗ Open source section ↗ បើកផ្នែក docs ផ្លូវការ ↗
Bạn có thể sử dụng Data Loss Prevention (DLP) để ngăn người dùng của bạn gửi dữ liệu nhạy cảm cho đại lý AI.
You can use Data Loss Prevention (DLP) to prevent your users from sending sensitive data to the AI agent.
អ្នកអាចប្រើ Data Loss Prevention (DLP) ដើម្បីកាត់បន្ថយអ្នកប្រើរបស់អ្នកពីផ្ញើទិន្នន័យដែលមានអារម្មណ៍ដល់អេក្រង់ AI ។
  1. Trong Cloudflare dashboard ↗, đi đến Zero Trust \> Data loss prevention \> Profiles.
  2. Đảm bảo rằng DLP profiles bạn muốn thực thi được cấu hình đúng.
  3. Thêm chính sách HTTP để thực thi hồ sơ DLP cho tên máy chủ cho wrapper của bạn. Ví dụ:
  1. In the Cloudflare dashboard ↗, go to Zero Trust \> Data loss prevention \> Profiles.
  2. Ensure that the DLP profiles you want to enforce are properly configured.
  3. Add an HTTP policy to enforce the DLP profile for the hostname for your wrapper. For example:
  1. ក្នុង Cloudflare dashboard ↗ សូមចូលទៅទៅ Zero Trust \> Data loss prevention \> Profiles ។
  2. សូមធានាថា DLP profiles ដែលអ្នកចង់អនុវត្តគឺមានកំណត់ត្រឹមត្រូវ។
  3. បន្ថែមគោលបំណង HTTP ដើម្បីអនុវត្តឯកសារ DLP សម្រាប់ឈ្មោះក្រុមហ៊ុនផ្គត់ផ្គង់របស់អ្នក។ ឧទាហរណ៍ :
| Selector | Operator | Value | Logic | Action | | ----------- | -------- | ---------------------- | ----- | ------ | | Host | is | ai-wrapper.example.com | And | Block | | DLP Profile | in | AI DLP profile | | |
| Selector | Operator | Value | Logic | Action | | ----------- | -------- | ---------------------- | ----- | ------ | | Host | is | ai-wrapper.example.com | And | Block | | DLP Profile | in | AI DLP profile | | |
| Selector | Operator | Value | Logic | Action | | ----------- | -------- | ---------------------- | ----- | ------ | | Host | is | ai-wrapper.example.com | And | Block | | DLP Profile | in | AI DLP profile | | |
  1. Chọn Create policy
  1. Select Create policy.
  1. សូមជ្រើស Create policy ។
Để biết thêm thông tin về cách tạo chính sách DLP, hãy xem Scan HTTP traffic.
For more information on creating DLP policies, refer to Scan HTTP traffic.
សម្រាប់ព័ត៌មានបន្ថែមអំពីការបង្កើតគោលការណ៍ DLP សូមមើល Scan HTTP traffic ។

Liên kết liên quan (docs Cloudflare) Related links (Cloudflare docs) តំណពាក់ព័ន្ធ (docs Cloudflare)

Chạy trong một trình duyệt không khách hàng cô lập Execute in a clientless isolated browser ការដំឡើងនៅក្នុងអ្នកដំឡើងដោយគ្មានកុំព្យូទ័រ

Phần «Execute in clientless isolated browser» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.

Read the "Execute in a clientless isolated browser" section below — open the official docs link for full screenshots and configuration tabs.

អានផ្នែក «ការដំឡើងនៅក្នុងអ្នកដំឡើងដោយគ្មានកុំព្យូទ័រ» ខាងក្រោម — បើកតំណ docs ផ្លូវការសម្រាប់រូបភាព និង tab កំណត់។

Mở section docs gốc ↗ Open source section ↗ បើកផ្នែក docs ផ្លូវការ ↗
Bởi vì bạn đã xuất bản wrapper của bạn như là một ứng dụng tự lưu trữ Access, bạn có thể chạy nó trong một isolated session cho người dùng của bạn bằng cách tạo một Access policy và cấu hình nó cho ứng dụng của bạn.
Because you published your wrapper as a self-hosted Access application, you can execute it in an isolated session for your users by creating an Access policy and configuring it for your application.
ប្រសិនបើអ្នកបានបោះពុម្ពវេជ្ជសាស្រ្តរបស់អ្នកជាកម្មវិធី Access ដោយខ្លួនឯង, អ្នកអាចអនុវត្តវេជ្ជសាស្រ្តរបស់អ្នកនៅក្នុង isolated session សម្រាប់អ្នកប្រើរបស់អ្នកដោយបង្កើត Access policy និងកំណត់វេជ្ជសាស្រ្តរបស់អ្នកសម្រាប់កម្មវិធីរបស់អ្នក។
  1. Trong Cloudflare One ↗, đi đến Browser isolation \> Browser isolation settings.
  2. Nhấp vào Allow users to open a remote browser without the device client
  3. Đi đến Access controls \> Policies.
  4. Chọn Add a policy
  5. Đặt Action thành Allow.
  6. Trong Add rules, thêm quy tắc nhận dạng để xác định ứng dụng nên được cô lập cho ai.
  7. Trong Additional settings (optional), hãy bật Isolate application.
  1. In Cloudflare One ↗, go to Browser isolation \> Browser isolation settings.
  2. Turn on Allow users to open a remote browser without the device client.
  3. Go to Access controls \> Policies.
  4. Select Add a policy.
  5. Set the Action to Allow.
  6. In Add rules, add identity rules to define who the application should be isolated for.
  7. In Additional settings (optional), turn on Isolate application.
  1. នៅ Cloudflare One ↗ សូមចូលទៅ Browser isolation \> Browser isolation settings ។
  2. សូមចុច Allow users to open a remote browser without the device client ។
  3. ចុចទៅ Access controls \> Policies ។
  4. សូមជ្រើស Add a policy ។
  5. ទាញយក Action ទៅ Allow ។
  6. ក្នុង Add rules, បន្ថែមច្បាប់សម្គាល់ដើម្បីបញ្ជាក់អ្នកដែលកម្មវិធីនេះគួរតែត្រូវបានកាត់បន្ថយសម្រាប់។
  7. នៅលើ Additional settings (optional) ចុច Isolate application ។
Một khi chính sách Access đã được tạo ra, bạn có thể đính kèm nó vào wrapper của bạn.
Once the Access policy has been created, you can attach it to your wrapper.
នៅពេលដែលគោលនយោបាយ Access ត្រូវបានបង្កើតបានអ្នកអាចបន្ថែមវាទៅនឹងការវេចខ្ចប់របស់អ្នក។
  1. Đi đến Access controls \> Applications.
  2. Chọn ứng dụng wrapper của bạn, sau đó chọn Configure.
  3. Trong Policies, hãy chọn Select existing policies.
  4. Chọn chính sách Access mà bạn đã tạo trước đó.
  5. Chọn Confirm, rồi chọn Save.
  1. Go to Access controls \> Applications.
  2. Choose your wrapper application, then select Configure.
  3. In Policies, select Select existing policies.
  4. Choose the Access policy you previously created.
  5. Select Confirm, then select Save.
  1. ចុចទៅ Access controls \> Applications ។
  2. សូមជ្រើសកម្មវិធី Wrapper របស់អ្នកបន្ទាប់មកជ្រើស Configure ។
  3. នៅលើ Policies ចុច Select existing policies ។
  4. ជ្រើសគោលបំណង Access ដែលអ្នកបានបង្កើតមុន។
  5. ចុច Confirm បន្ទាប់មកចុច Save ។
Bởi vì lưu lượng truy cập Web Isolation không khách hàng áp dụng chính sách Gateway HTTP của bạn, hồ sơ DLP được cấu hình của bạn sẽ áp dụng cho các phiên cô lập.
Because Clientless Web Isolation traffic applies your Gateway HTTP policies, your configured DLP profiles will apply to isolated sessions.
ដោយសារតែទិន្នន័យទិន្នន័យទិន្នន័យទិន្នន័យទិន្នន័យទិន្នន័យទិន្នន័យទិន្នន័យទិន្នន័យទិន្នន័យទិន្នន័យទិន្នន័យទិន្នន័យទិន្នន័យទិន្នន័យទិន្នន័យទិន្នន័យទិន្នន័យទិន្នន័យទិន្នន័យទិន្នន័យទិន្នន័យទិន្នន័យទិន្នន័យទិន្នន័យទិន្នន័យទិន្នន័យទិន្នន័យ។
Để biết thêm thông tin về cách ly một ứng dụng Access, hãy tham khảo Isolate self-hosted application.
For more information on isolating an Access application, refer to Isolate self-hosted application.
សម្រាប់ព័ត៌មានបន្ថែមអំពីការកាត់បន្ថយកម្មវិធី Access សូមមើល Isolate self-hosted application ។

Liên kết liên quan (docs Cloudflare) Related links (Cloudflare docs) តំណពាក់ព័ន្ធ (docs Cloudflare)

Lợi ích bổ sung Additional benefits លទ្ធផលបន្ថែមទៀត

Phần «Additional benefits» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.

Read the "Additional benefits" section below — open the official docs link for full screenshots and configuration tabs.

អានផ្នែក «លទ្ធផលបន្ថែមទៀត» ខាងក្រោម — បើកតំណ docs ផ្លូវការសម្រាប់រូបភាព និង tab កំណត់។

Mở section docs gốc ↗ Open source section ↗ បើកផ្នែក docs ផ្លូវការ ↗
Các tổ chức áp dụng Cloudflare để bảo mật access cho các đại lý AI sẽ được hưởng lợi từ khả năng hiển thị và cấu hình được cải thiện.
Organizations that adopt Cloudflare to secure access to AI agents will benefit from improved visibility and configurability.
រោងចក្រដែលទទួលបាន Cloudflare ដើម្បីធានា access ដើម្បីអេក្រង់ AI នឹងទទួលបានអត្ថប្រយោជន៍ពីការបង្កើនភាពងាយស្រួលនិងការកំណត់។

Tầm nhìn Visibility រូបភាព

Phần «Visibility» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.

Read the "Visibility" section below — open the official docs link for full screenshots and configuration tabs.

អានផ្នែក «រូបភាព» ខាងក្រោម — បើកតំណ docs ផ្លូវការសម្រាប់រូបភាព និង tab កំណត់។

Mở section docs gốc ↗ Open source section ↗ បើកផ្នែក docs ផ្លូវការ ↗
Zero Trust sẽ ghi lại tất cả Access events và DLP detections. Ngoài ra, AI Gateway cung cấp visibility vào lời nhắc của người dùng, phản hồi mô hình, sử dụng token và chi phí.
Zero Trust will log all Access events and DLP detections. In addition, AI Gateway provides visibility into user prompts, model response, token usage, and costs.
Zero Trust នឹងចុះឈ្មោះទាំងអស់ Access events និង DLP detections ។ លើសពីនេះទៀត, AI Gateway ផ្តល់ visibility ទៅក្នុងការអនុញ្ញាតឱ្យអ្នកប្រើ, ការឆ្លើយតបគំរូ, ការប្រើប្រាស់ token និងតម្លៃ។
Các nhật ký có thể được xuất sang các nhà cung cấp bên ngoài với Logpush.
Logs can be exported to external providers with Logpush.
សៀវភៅអាចត្រូវបាននាំចេញទៅអ្នកផ្គត់ផ្គង់ខាងក្រៅជាមួយ Logpush ។

Liên kết liên quan (docs Cloudflare) Related links (Cloudflare docs) តំណពាក់ព័ន្ធ (docs Cloudflare)

Configuration Configurability ការ Configuration

Phần «Configurability» — đọc hướng dẫn bên dưới, dùng liên kết docs gốc để xem ảnh minh họa và tab cấu hình đầy đủ.

Read the "Configurability" section below — open the official docs link for full screenshots and configuration tabs.

អានផ្នែក «ការ Configuration» ខាងក្រោម — បើកតំណ docs ផ្លូវការសម្រាប់រូបភាព និង tab កំណត់។

Mở section docs gốc ↗ Open source section ↗ បើកផ្នែក docs ផ្លូវការ ↗
Bạn có thể cấu hình wrapper của mình để sử dụng different AI provider hoặc cung cấp cho người dùng tùy chọn lựa chọn giữa nhiều nhà cung cấp AI, bao gồm các mô hình AI chạy trực tiếp trên mạng toàn cầu của Cloudflare với Workers AI. Với điều này, bạn có thể kiểm soát chi phí liên quan đến việc sử dụng AI hoặc áp dụng các mô hình mới hơn mà không ảnh hưởng đến người dùng của bạn hoặc các điều khiển access đã được đưa ra.
You can configure your wrapper to use a different AI provider or give your users the option to choose between multiple AI providers, including AI models running directly on Cloudflare's global network with Workers AI. With this, you can control costs related to AI usage or adopt newer models without impacting your users or the access controls already put in place.
អ្នកអាចកំណត់កុំព្យូទ័ររបស់អ្នកដើម្បីប្រើ different AI provider ឬផ្តល់ឱ្យអ្នកប្រើរបស់អ្នកនូវជម្រើសដើម្បីជ្រើសរើសរើសរើសរើសរើសរើសរើសរើសរើសរើសរើសរើសរើសរើសរើសរើសរើសរើសរើសរើសរើសរើសក្រុមហ៊ុនផ្គត់ផ្គង់ AI, រួមទាំងម៉ូដែល AI ដែលធ្វើដំណើរដោយផ្ទាល់នៅលើបណ្តាញពិភពលោករបស់ Cloudflare ជាមួយ Workers AI ។ ជាមួយនឹងការនេះអ្នកអាចត្រួតពិនិត្យទូទាត់ដែលទាក់ទងនឹងការប្រើប្រាស់ AI ឬទទួលបានម៉ូដែលថ្មីជាងនេះដោយមិនប្រសើរឡើងអ្នកប្រើរបស់អ្នកឬការត្រួតពិនិត្យ access ដែលបានធ្វើឡើងនៅពេលនេះ។
json
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"item":{"@id":"/directory/","name":"Directory"}},{"@type":"ListItem","position":2,"item":{"@id":"/cloudflare-one/","name":"Cloudflare One"}},{"@type":"ListItem","position":3,"item":{"@id":"/cloudflare-one/tutorials/","name":"Tutorials"}},{"@type":"ListItem","position":4,"item":{"@id":"/cloudflare-one/tutorials/ai-wrapper-tenant-control/","name":"Create and secure an AI agent wrapper using AI Gateway and Zero Trust"}}]}

Liên kết liên quan (docs Cloudflare) Related links (Cloudflare docs) តំណពាក់ព័ន្ធ (docs Cloudflare)

Xem bản đầy đủ trên developers.cloudflare.com (ảnh, tab cấu hình). View the full guide on developers.cloudflare.com (images, config tabs). មើលមគ្គុទ្ទេសក៍ពេញលើ developers.cloudflare.com (រូបភាព, tab កំណត់)។

Tài liệu gốc ↗ Official docs ↗ ឯកសារផ្លូវការ ↗