Skip to main content

Agent Internet Access

โดยค่าเริ่มต้น Codex บล็อก internet access ระหว่าง agent phase Setup script ยังคงรันพร้อม internet access เพื่อ install dependencies คุณสามารถเปิด agent internet access ต่อ environment เมื่อจำเป็น

ความเสี่ยงของการเปิด Agent Internet Access

การเปิด agent internet access เพิ่มความเสี่ยงด้านความปลอดภัย ได้แก่:

  • Prompt injection จากเนื้อหาเว็บที่ไม่น่าเชื่อถือ
  • Data exfiltration ของโค้ดหรือ secrets
  • Malware หรือ dependencies ที่มีช่องโหว่
  • การดึงเนื้อหาที่มีข้อจำกัดด้าน license

เพื่อลดความเสี่ยง อนุญาตเฉพาะ domain และ HTTP method ที่จำเป็น และตรวจสอบ agent output และ work log เสมอ

ตัวอย่าง Prompt Injection

Prompt injection เกิดขึ้นเมื่อ agent ดึงและปฏิบัติตามคำสั่งจากเนื้อหาที่ไม่น่าเชื่อถือ เช่น หน้าเว็บหรือ dependency README ตัวอย่างเช่น คำสั่งที่ซ่อนอยู่ใน GitHub issue อาจทำให้ข้อมูลรั่วไหลผ่านคำสั่ง curl ไปยัง server ของผู้โจมตี

สถานการณ์นี้แสดงให้เห็นว่า prompt injection สามารถเปิดเผยข้อมูลสำคัญหรือทำการเปลี่ยนแปลงที่ไม่ปลอดภัยได้ ควรชี้ Codex ไปยังแหล่งข้อมูลที่เชื่อถือได้เท่านั้นและจำกัด internet access ให้น้อยที่สุด

การตั้งค่า Agent Internet Access

Internet access ตั้งค่าต่อ environment:

  • Off: บล็อก internet access ทั้งหมด
  • On: อนุญาต internet access โดยสามารถจำกัดด้วย domain allowlist และ HTTP methods ที่อนุญาต

Domain Allowlist

เลือกจาก preset allowlist:

  • None: Allowlist ว่าง ระบุ domain เองด้วยตนเอง
  • Common dependencies: Preset allowlist ของ domain สำหรับ download และ build dependencies
  • All (unrestricted): อนุญาตทุก domain

เมื่อเลือก None หรือ Common dependencies คุณสามารถเพิ่ม domain เพิ่มเติมได้

Allowed HTTP Methods

เพื่อการป้องกันเพิ่มเติม จำกัด network request เป็นเฉพาะ GET, HEAD และ OPTIONS เท่านั้น method อื่น (POST, PUT, PATCH, DELETE) จะถูกบล็อก

Preset Domain Lists

Common dependencies allowlist ประกอบด้วยกว่า 70 domain สำหรับ source control, package management และ development dependencies รวมถึง:

  • github.com
  • npmjs.com
  • pypi.org
  • docker.com
  • maven.org

และอีกหลาย domain