AWS Thai Blog

Securing AI on AWS: การทำความปลอดภัยสำหรับ AI

เวลาพูดถึง AI Security หลายคนมักเริ่มจากคำถามว่า “ต้องเปิด service อะไรบ้างหรือทำอะไรบ้าง หรือวางมาตรฐานด้าน AI management เช่น ISO/IEC 42001” แต่สำหรับระบบ AI โดยเฉพาะ Agentic AI คำถามสำคัญคือ “AI workload ของเราทำอะไรได้บ้าง มีสิทธิ์เข้าถึงข้อมูลหรือระบบใด ใช้ tool ใดได้บ้าง และมนุษย์ยังมีบทบาทกำกับอยู่ตรงไหนบ้าง”
AWS อธิบายว่าแต่ละชั้นของ AI stack ตั้งแต่ infrastructure, models ไปจนถึง applications มีความเสี่ยงและ control ที่แตกต่างกัน ดังนั้นแนวทางที่เหมาะสมไม่ใช่การพึ่งพา control ตัวเดียว แต่คือการใช้ security, compliance และ governance capabilities ของ AWS ร่วมกันแบบ defense-in-depth เพื่อช่วยปกป้อง AI applications โดยไม่ต้องเริ่ม security strategy ใหม่ทั้งหมด

What — ต้อง Secure อะไรบ้างเมื่อระบบเริ่มมี AI
AI workload มีลักษณะต่างจาก application แบบเดิมหลายด้าน Foundation model อาจให้คำตอบที่ไม่เหมือนเดิมทุกครั้ง และเมื่อระบบพัฒนาไปเป็น Agentic AI ความเสี่ยงจะขยายจากการ “generate คำตอบ” ไปเป็นการ “ตัดสินใจและลงมือทำ” เช่น เรียกใช้ tools, เข้าถึง API, อ่านหรือเขียนข้อมูล, ใช้ memory ข้าม session และประสานงานกับระบบภายนอก
เพราะฉะนั้น security ของ AI ไม่ควรฝากไว้กับ model เพียงอย่างเดียว สิ่งที่ควรออกแบบให้ชัดคือ deterministic controls ที่อยู่รอบตัว model และ agent เช่น identity, authorization, data boundary, tool permission, guardrails, logging, monitoring, approval workflow และ fail-safe mechanism

Agentic AI Security Scoping Matrix
AWS Security Blog เสนอ Agentic AI Security Scoping Matrix เพื่อช่วยให้องค์กรจัดระดับความเสี่ยงของ agent ตามสองมิติหลัก คือ Agency และ Autonomy
Agency คือขอบเขตของสิ่งที่ AI system ได้รับอนุญาตให้ทำ เช่น อ่านข้อมูล เรียก API แก้ไขข้อมูล หรือดำเนินการกับระบบภายนอก
Autonomy คือระดับความเป็นอิสระในการตัดสินใจและลงมือทำโดยไม่ต้องรอมนุษย์อนุมัติ
เมื่อ agency และ autonomy สูงขึ้น security control ต้องเข้มขึ้นตาม เพราะความเสี่ยงไม่ได้หยุดอยู่ที่คำตอบของ model แต่รวมถึง action ที่ agent สามารถทำกับระบบจริงได้

Agentic AI security scoping matrix แบ่งเป็น 4 ระดับตามDimenstions ของ Agency (ขอบเขตสิ่งที่ Agent ทำได้) และ Autonomy (ระดับความเป็นอิสระในการตัดสินใจ)
Scope 1 — No Agency
Agent ทำงานแบบ read-only หรือทำตาม workflow ที่กำหนดไว้ ไม่สามารถเปลี่ยนแปลงระบบภายนอกได้
Security focus: data integrity, workflow boundary, input/output validation
Scope 2 — Prescribed Agency
Agent สามารถเสนอ action หรือเตรียมคำสั่งได้ แต่ action สำคัญต้องผ่าน human approval ก่อนเสมอ
Security focus: approval workflow, identity verification, audit trail, least privilege
Scope 3 — Supervised Agency
มนุษย์เป็นผู้กำหนด objective แต่ Agent สามารถดำเนินงานต่อเองภายในขอบเขตที่กำหนด
Security focus: real-time monitoring, execution boundary, delegated identity, kill switch, logging
Scope 4 — Full Agency
Agent สามารถเริ่มงานเองจาก trigger และดำเนินงานต่อด้วย autonomy สูง โดยมนุษย์ทำหน้าที่กำกับภาพรวม
Security focus: anomaly detection, behavioral validation, human override, fail-safe mechanism, lifecycle governance

หลังจากด้านบน สามารถเลือกScope ของAWS โดยใช้แนวคิด Defense-in-Depth วางหลายชั้นซ้อนกันได้ บน AWS
หลักสำคัญคือไม่ควรมองว่า guardrail หรือ model setting ตัวใดตัวหนึ่งเพียงพอสำหรับ secure agentic AI ทั้งระบบ AWS Prescriptive Guidance ระบุว่าควรใช้หลาย controls ข้ามหลาย control types ตาม threat และ risk appetite ของ workload (สามารถดูเพิ่มเติมได้ที่ agentic ai security prescriptive-guidance : Link)

ตัวอย่าง control ที่ควรวางแบบ defense-in-depth มีดังนี้ 

1. Identity และ Authorization
กำหนดให้ชัดว่า user, service และ agent identity ใดทำอะไรได้บ้าง ด้วย IAM, Amazon Cognito, IAM Access Analyzer และ Amazon Bedrock AgentCore Identity โดยใช้หลัก least privilege และแยกสิทธิ์ของ agent ออกจากสิทธิ์ของมนุษย์
2. Data และ Memory Protection
ปกป้องข้อมูลที่ agent ใช้หรือสร้างขึ้นด้วย AWS KMS, Secrets Manager, PrivateLink และ Amazon Macie รวมถึงกำหนด boundary ของ memory และ state เพื่อลดความเสี่ยงข้อมูลรั่วไหลหรือ memory poisoning
3. Application และ Model Controls
ใช้ Amazon Bedrock Guardrails เพื่อช่วยจัดการ harmful content, denied topics, sensitive information และ prompt attacks เช่น jailbreak, prompt injection และ prompt leakage แต่ไม่ควรใช้แทน authentication, authorization หรือ application validation
4. Tool และ Agency Perimeter
จำกัดว่า agent ใช้ tool หรือ API ใดได้บ้าง และ action ใดต้องผ่าน human approval โดยเฉพาะ Scope 2–4 ควรมี approval flow, runtime boundary, quota, timeout และ kill switch
5. Network และ Perimeter Protection
ใช้ VPC, PrivateLink, AWS WAF, Shield Advanced, Network Firewall และ Verified Access เพื่อจำกัด network path และลดความเสี่ยง unauthorized access หรือ data exfiltration
6. Logging, Monitoring และ Observability
ใช้ CloudTrail, CloudWatch และ Amazon Bedrock AgentCore Observability เพื่อติดตาม agent activity, tool invocation, error, latency และ workflow trace สำหรับ audit, troubleshooting และ incident response

ตัวอย่างจาก Guidance for Agentic AI Operational Foundations on AWS – AWS Solutions Library : Link

สรุป
Securing AI on AWS ไม่ใช่การเริ่มต้นใหม่ แต่เป็นการขยาย security strategy ที่องค์กรมีอยู่แล้วให้ครอบคลุม AI-specific risks โดยเฉพาะเมื่อระบบพัฒนาไปสู่ Agentic AI ที่มี agency และ autonomy สูงขึ้น
แนวทางที่ปลอดภัยคือเริ่มจากการจัด Scope ของ agent ให้ชัด จากนั้นวาง controls แบบ defense-in-depth ครอบคลุม identity, data, model, application, tool, network, logging และ governance ยิ่ง agent มีสิทธิ์ลงมือทำกับระบบจริงมากเท่าไร control รอบตัว agent ก็ต้อง deterministic, observable และ auditable มากขึ้นเท่านั้น

Reference:
ISO/IEC 42001:2023: Link
AI lifecycle risk management: ISO/IEC 42001:2023 for AI governance: Link 
AI for Security and Security for AI: Navigating Opportunities and Challenges: Link
Agentic AI Security Scoping Matrix: Link 
Security, Compliance, and Governance for AI Solutions (skillbuilder): Link 
AWS Security: Securing Generative AI on AWS (skillbuilder): Link
Secure a generative AI assistant with OWASP Top 10 mitigation: Link 
Building an AI-powered defense-in-depth security architecture for serverless microservices: Link 
Four security principles for agentic AI systems: Link
Enabling customers to deliver production-ready AI agents at scale: Link

AWS Workshop:
Building Secure and Responsible Generative AI Applications with Amazon Bedrock Guardrails: Link 
SEC353 – AWS Security Agent: Get started with AI-powered proactive AppSec: Link