สายพาน workflow มืดหยุดที่ประตูอนุมัติมนุษย์ โดยมีเครื่องมือสีอำพันหนึ่งชิ้นรออยู่และส่วนอื่นถูกกั้นในช่องแยก

Google ADK Python 2.11.0 เพิ่ม tool confirmation และ cancellation: guardrail ดีขึ้น แต่ tool ยังมีสิทธิ์เท่า process

พี่โชว์Engineering

Google ออก Agent Development Kit for Python 2.11.0 โดยเพิ่ม graceful cancellation ใน Runner/Workflow/nodes, tool confirmation สำหรับ workflow nodes, ModelConsultTool ที่มี budget ต่อ turn/session, SQLite memory service และทางเลือก MCP SDK 2.x แบบ opt-in ครับ นอกจากนี้มี breaking change ใน dev UI runtime config: server เสิร์ฟไฟล์ config ต่อ request แทนการเขียนลง package ที่ติดตั้ง

จุดที่สำคัญต่อ safety คือ workflow tool node สามารถหยุดผ่าน RequestInput เพื่อรอผู้ใช้อนุมัติ แทนการส่ง error ลงสายงานเหมือนเดิม และ cancellation ช่วยหยุดงานเมื่อ client disconnect แต่สองฟีเจอร์นี้เป็นกลไกให้ผู้พัฒนาใช้ ไม่ได้ห่อ tool ทุกตัวให้ปลอดภัยอัตโนมัติ Python tool ยังรันภายใต้สิทธิ์ของ process, filesystem, network และ credentials ที่ environment ให้

ผมตรวจ official repository/release, commit/tag, PyPI files/hashes, tool docs และ security advisories แบบอ่านอย่างเดียว ไม่ติดตั้ง google-adk, ไม่ต่อ model/MCP และไม่รัน sample กับ repository จริง รุ่นนี้ ผ่านเกณฑ์คัดกรอง ณ วันที่ตรวจ 2026-10-07 สำหรับ pilot ที่จำกัดสิทธิ์ โดยยังมี residual risk จาก custom tools, memory, MCP และ approval design

สรุป 30 วินาที

  • Release v2.11.0 จาก google/adk-python ลงวันที่ 1 ตุลาคมและเผยแพร่ GitHub 2 ตุลาคม ผูกกับ commit 9f7965e
  • abort_signal ช่วย Runner, Workflow และ node หยุดอย่างเป็นระเบียบ; /run_sse ผูก cancellation กับ client disconnect
  • workflow tool confirmation หยุด node แล้วถามผู้ใช้ผ่าน RequestInput แทนการปล่อย error เป็นข้อมูลธรรมดา
  • ModelConsultTool จำกัดจำนวนการปรึกษาโมเดลต่อ turn/session ช่วยคุม recursion/cost แต่ไม่ใช่ security sandbox
  • SQLite memory เพิ่ม persistence ในเครื่อง; MCP SDK 2.x เป็น opt-in path ซึ่งเพิ่ม server/tool boundary ที่ต้องตรวจ
  • Dev UI config เปลี่ยนตำแหน่ง/วิธีเสิร์ฟ ผู้ที่แก้หรืออ่านไฟล์เดิมต้อง migrate ไม่ควร patch package ใน site-packages ต่อ

ทำไมเรื่องนี้เกี่ยวกับคุณ

Agent framework ทำให้การต่อ LLM กับ email, database, cloud API หรือ shell ง่ายขึ้น จุดอันตรายจึงย้ายจาก “โมเดลตอบผิด” เป็น “โมเดลตอบผิดแล้ว tool ทำจริง” Confirmation ที่อยู่ใน workflow graph ช่วยสร้างจุดหยุดแบบเป็นทางการ แต่ถ้า UI แสดงคำขอคลุมเครือ หรือผู้ใช้กด approve เป็นนิสัย control ก็อ่อน

นึกถึงร้านข้าวตามสั่งที่เด็กเสิร์ฟจดคำสั่งแล้วส่งครัว Tool confirmation คือการให้ลูกค้าดูบิลก่อนครัวทำเมนูแพง แต่บิลต้องบอกโต๊ะ เมนู จำนวน ราคา และข้อแพ้ ไม่ใช่เขียนแค่ว่า “อนุมัติการทำงานไหม” สำหรับ agent เช่นกัน approval ต้องแสดง destination, arguments, data scope และผลกระทบ

Cancellation สำคัญต่อทั้งเงินและ side effect หาก browser ปิดหรือ client หลุด ระบบไม่ควรปล่อย workflow สร้าง request ต่อไปไม่รู้จบ แต่ cancellation ไม่ย้อนธุรกรรมที่ส่งไปแล้ว ทีมต้องออกแบบ idempotency, compensation และ timeout ใน tool แต่ละตัว

ทำงานยังไง: จุดหยุดในกราฟไม่ใช่กำแพงรอบ process

Workflow node รับ context แล้วเรียก tool ตาม graph รุ่นนี้ทำให้ tool node ขอ input/approval ได้เหมือน LlmAgent เมื่อถึงจุดเสี่ยง execution ถูกพักและรอผลผู้ใช้ จากนั้น resume ตาม state ของ workflow จุดนี้ควรวางก่อน external side effect ไม่ใช่หลัง tool เริ่มทำ

abort_signal ส่งสัญญาณหยุดลง Runner, Workflow และ node ช่วยให้ long-running operation ตรวจ cancellation และ cleanup ได้ แต่ Python function ที่ block อยู่, library ที่ไม่รับ signal หรือ remote API ที่รับ request ไปแล้วอาจไม่หยุดทันที ต้องกำหนด cooperative cancellation และ deadline ในแต่ละ integration

ModelConsultTool ให้ agent ถามโมเดลอีกตัวกลางงาน พร้อม budget ต่อ turn/session ช่วยกัน loop และค่าใช้จ่ายล้น แต่ผลจากโมเดลที่ปรึกษายังเป็น untrusted content ต้องไม่ข้าม validation หรือเพิ่มสิทธิ์เพียงเพราะมาจาก “อีกโมเดล”

SQLite memory เก็บ state ไว้ในไฟล์ local สะดวกสำหรับ demo/single-node แต่ไฟล์อาจมี prompt, user data, tool output หรือ secret ต้องกำหนด path, permission, encryption/backup, retention และ tenant isolation ส่วน MCP 2.x เชื่อม server ที่ประกาศ tools/resources; schema จาก server ไม่เท่ากับความไว้ใจ

หลักฐานที่ตรวจ

Release 2.11.0 มาจาก official Google repository, ระบุ commit 9f7965e และแจกแจง highlights, breaking change กับ commits ของแต่ละ feature แหล่งนี้ยืนยันว่าฟีเจอร์อยู่ใน release แต่ไม่ได้รับรอง configuration ของผู้ใช้

PyPI google-adk 2.11.0 เป็น registry version ที่เผยแพร่ไฟล์พร้อม hashes ทีมติดตั้งควร pin version/hash ผ่าน lock/constraints และ mirror ภายใน ไม่ใช้ curl | shell หรือ snippet จาก issue ที่ไม่ตรวจเจ้าของ ผมไม่ได้ติดตั้ง package หรือ dependencies

ADK tool docs อธิบาย custom/built-in/tool integrations ซึ่งทำงานใน application context ดังนั้นสิทธิ์ default ขึ้นกับ process และ credential ของเรา ไม่ใช่ sandbox แยกอัตโนมัติ security advisories ไม่แสดง known high/critical advisory ที่ประกาศว่ากระทบ 2.11.0 โดยไม่มี mitigation ณ เวลาตรวจ

ผมตรวจ publisher, official repository, tag/version/changelog, PyPI provenance/hashes, docs และ advisories โดยไม่ execute candidate จากหลักฐานนี้รุ่น 2.11.0 ผ่านเกณฑ์คัดกรอง ณ วันที่ตรวจ แต่ต้องวาง confirmation/permissions เอง

เงินและผลกระทบ

Model consultation กับ workflow ที่ resume ได้เพิ่มโอกาสทำงานซับซ้อน แต่ทุก model call และ retry มีต้นทุน ตั้ง budget ทั้ง per-turn, per-session, global job และ wall-clock ไม่ใช้เพียงเพดานของ ModelConsultTool เพราะ tool อื่นหรือ sub-agent อาจสร้าง call เพิ่ม

Graceful cancellation ลดงานค้างเมื่อ client หลุด แต่ต้องวัดว่า remote jobs ถูกยกเลิกจริงหรือเหลือ orphan cost สร้าง metric สำหรับ started/completed/cancelled/compensated, tool latency, approval wait และ side effect ที่เกิดก่อน cancel

SQLite memory ลดค่า infrastructure ในงานเล็ก แต่ถ้าหลาย worker เขียนไฟล์เดียว contention, backup และ tenant separation อาจแพงกว่าฐานข้อมูลบริการ อย่าขยายจาก demo สู่ production โดยไม่ทดสอบ concurrency/recovery

สิ่งที่ยังไม่ชัดและแหล่งข่าวพูดไม่ตรงกัน

Release notes บอก tool confirmation “pause for user approval” แต่ไม่ได้กำหนด UX มาตรฐานว่าต้องแสดง argument ใด ผู้พัฒนา application เป็นคนออกแบบ prompt/UI จึงมีความต่างมากระหว่าง “มี confirmation” กับ “confirmation ที่ผู้ใช้ตัดสินใจได้”

Cancellation API ช่วยส่งสัญญาณ แต่ไม่มีหลักประกันว่า custom tool หรือ third-party SDK ทุกตัวตอบสนอง ไม่มี distributed transaction ที่ย้อน side effect อัตโนมัติ ต้องทดสอบ adapter ของเราเอง

หน้า release ไม่ได้สรุป default filesystem/network/secret permission แบบ runtime sandbox เพราะ ADK เป็น library ใน process สิ่งนี้ไม่ใช่ความขัดแย้งกับ docs แต่เป็นช่องที่ทีมอาจเข้าใจผิดจากคำว่า agent framework ว่ามี isolation ให้แล้ว

MCP 2.x เป็น opt-in ลด blast radius ของผู้ที่ไม่เปิด แต่เมื่อเปิดแล้ว trust ขึ้นกับ server, transport, authentication, tool schema และ version negotiation ยังต้องตรวจ advisory ของ MCP SDK/server แยกจาก ADK

วิธีใช้ให้ปลอดภัยขึ้น

  1. pin google-adk==2.11.0 พร้อม hash/lock และใช้ internal package mirror ที่สแกน dependency
  2. รัน agent ใน container/identity แยก filesystem read-only, writable scratch จำกัด, egress allowlist และไม่มี production secret โดย default
  3. วาง tool confirmation ก่อน side effect แสดง action, destination, arguments ที่ redact แล้ว, data scope, cost และ rollback
  4. ห้าม “always approve” สำหรับ shell, file write, email/message, database mutation, permission/account, payment หรือ deploy
  5. ใส่ timeout, idempotency key, cancellation check และ compensation ใน custom tool ทุกตัว
  6. จำกัด ModelConsultTool ทั้งต่อ turn/session/job และ validate ผลเหมือน untrusted model output
  7. เก็บ SQLite memory ใน path สิทธิ์แคบ แยก tenant ตั้ง retention/encryption/backup และห้ามเก็บ secret/raw credential
  8. allowlist MCP server/tool pin version ตรวจ auth/TLS/schema และปิด dynamic server จาก prompt
  9. log tool decision/approval แบบ redact พร้อม correlation ID และ kill switch

แล้วเราควรทำอะไร

เริ่ม pilot ด้วย workflow ที่อ่านข้อมูลสังเคราะห์และมี tool ปลอม วาง test ว่า safe read ผ่าน, high-impact action ขออนุมัติ, denial หยุดจริง, client disconnect ยกเลิก และ resume ไม่ทำ side effect ซ้ำ จากนั้นค่อยเชื่อม service จริงด้วย credential scope ต่ำ

ทีม platform ควรมี tool registry กลางที่ระบุ owner, input schema, side effect, data class, required approval, timeout และ rollback ห้าม agent import arbitrary Python function จาก repository แล้วถือเป็น tool ที่อนุมัติอัตโนมัติ

ทีม security ต้องทดสอบ prompt injection ผ่าน user text, memory, MCP resource และ tool output เพราะทุกช่องสามารถพยายามแก้ plan/ขอสิทธิ์เพิ่ม ตรวจว่า approval UI ไม่ซ่อน destination ในข้อความยาว และ approval token ผูกกับ exact arguments/expiry ไม่ใช้ซ้ำหลัง state เปลี่ยน

ก่อน production ให้ canary, rate limit, budget, anomaly alert และ revoke path ชัด หาก workflow เริ่มวนหรือส่งข้อมูลผิด endpoint ต้องหยุด identity/egress ได้โดยไม่รอ deploy code ใหม่

ความเสี่ยงคงเหลือ

Custom tool ยังรันด้วยสิทธิ์ process และอาจเรียก shell/network โดยไม่ผ่าน wrapper หากผู้พัฒนาวาง confirmation ไม่ครบ Prompt injection อาจชักผู้ใช้ให้ approve และ model consultation อาจขยาย context/ค่าใช้จ่ายหรือส่งข้อมูลไป provider เพิ่ม

SQLite memory มีความเสี่ยงข้อมูลค้าง, tenant ปน, backup หลุด และ prompt injection ข้าม session MCP server สามารถเปลี่ยน behavior/schema ฝั่ง server แม้ client version pin และ dependency ใหม่อาจมี advisory หลังวันตรวจ

Cancellation ไม่รับประกัน rollback ของ external side effect; resume/retry อาจทำซ้ำหากไม่มี idempotency รุ่นนี้เพิ่ม primitive ที่ดี แต่ safety สุดท้ายอยู่ที่ architecture ของ application และสิทธิ์ runtime

Recap

  • pin package/hash และสแกน dependency
  • sandbox process พร้อม filesystem/network/secret แบบ least privilege
  • confirmation ต้องแสดง exact action และอยู่ก่อน side effect
  • ทำ tool ให้ timeout, cancellable, idempotent และชดเชยได้
  • จำกัด model consultation, memory และ MCP คนละชั้น
  • ทดสอบ denial/disconnect/resume กับ tool ปลอมก่อนของจริง
  • มี budget, audit log, kill switch และ owner ทุก tool

ADK 2.11.0 ทำให้ “หยุดถามก่อนทำ” กับ “หยุดเมื่อ client ไปแล้ว” ง่ายขึ้นครับ แต่ framework มอบเบรกให้เรา ไม่ได้เหยียบเบรกแทน—ทีมยังต้องวางเบรกในตำแหน่งที่ถูกและไม่ต่อ tool กับกุญแจ master