วันนี้ผมแวะมาเอาเสิ้อ CNCF เสื่อสวยน้า และจด+ฟังงานนี้ด้วย ตอนแรกสนใจของ LangChain โดยที่จดมามีตามนี้ครับ
ถ้าพลาดอะไร แนะนำได้ เผื่อพลาด ตอนแรกคิดว่า Speaker ไทยหมด T__T
Stop Prompting "Please be careful" Finance Agents need enforced control point
Speaker Faisal Masood

📌ถึงแม้ว่าเราจะ Prompt เยอะละเอียด บอกมันว่า "อย่าโอนเงินเกิน 20,000 บาท Please be careful" แต่สุดท้ายมันเท เพราะ LLM มันเป็น non-deterministic มันแค่เดาคำตตัวถัดไปเท่านั้น ดังนั้นถ้าเจอ Edge Case หรือ มีใครเล่นพิเรนทณ์ ทำ Prompt Injection มันก็แตกได้
แม้ว่า Model Reason เก่งขนาดนั้น สิ่งที่มันควรทำเลือก Tools (ทำงานแบบ deterministic ) ที่ถูกต้อง
deepagents (Harness - Enforced Control Points)
📌deepagents เป็น Framework ที่ต่อยอดมาจาก LangChain อีกที เหมาะสำหรับทำงานที่ซับซ้อน ในงาน 4 ส่วน
- Execution environment - Code Interpreter / Sandbox / Filesystem
- Context management - Summarisation / Context offloading / Memory / Prompt caching / Skills
- Delegation - Planning / Subagents (แยกหน้าที่เฉพาะทาง เพื่อ เพิ่มประสิทธิภาพ)
- Steering - Human-in-the-loop

📌นอกจากนี้ตัว deepagents ยังมีส่วน Life Cycle hooks ให้เรามาดักจับอะไรบ้างอย่างได้ แบบ Claude Code เช่น before_agents / before_models / after_model เป็นต้น โดยตรงนี้ Speaker เค้าจะเรียกว่า middleware แนะนำ MemortGuadian มีใช้ Granite (Decision Model) / Regopy ครับ

- guardian.py - เป็นส่วน AgentMiddleware ที่จุดป้องกันตาม Life Cycle อย่าง
- assess_memory บอกหน้าที่ของ Tools + Prompt
-before_agentเก็บข้อความล่าสุดจากผู้ใช้
-awrap_tool_callตรวจก่อน ถ้าเป็นrememberหรือrecallจะตรวจว่ามีcustomer_idเป็นจำนวนเต็มบวกและมี memory store
- ที่นี้มันจะมี Flow ตรวจเพิ่มจาก Model กลุ่ม System 1 อย่าง Granite ประเมินว่า fact ส่งมาตรงที่เคยกำหนดไหม นอกจากมี regopy เอาไว้ตรวจ policy guardian.rego - guardian-demo-agent.py - สร้าง Agent + Register AgentMiddleware guardian.py
- demo-prompts.md - เอาไปลอง Test มีหลายแบบ เคสปกติ , Mixed Valid/Invalid Requests, Prompt Injection / Jailbreak หรือ หลอกเอา PII
📌ที่เหลือเป็น demo แล้ว โดยถ้า run uv langgraph dev มันขึ้น web based มาให้เรา track ลองดูการทำงานของ Agent เต็มๆ ถ้าไปทางเสียเงิน


- LangSmith Tracing: End-to-End Visibility ของทุก Step การตัดสินใจ และการเรียกใช้ Tool ช่วย Audit Trail และตรวจสอบ Compliance ย้อนหลังสะดวก
- LangSmith Engine: ตรวจสอบ Source Code ของ Agent โดยอัตโนมัติ เพื่อค้นหาช่องโหว่ด้านความปลอดภัยหรือปัญหาเรื่องเงินทองๆ แบบ Run แล้วจะผลาญ Token พร้อมเสนอ วิธีแก้ หรือ PR ให้ก็ได้
Q&A
📚 การจัดการ Conflict Rule - ตัว Tools อาจจะไม่มี Out-of-the-box Logic แต่เปิดให้เรา Custom ได้
📚 Memory Guardian สามารถใช้กับภาษาไทยได้ไหม - หลักๆขึ้นกับการเลือก Decision Model Support ภาษาไทย
Resource: https://github.com/masoodfaisal/langchain-middlewares
x402 Payment Security: How AI Agents pay per over HTTP, and where the risks live
Speaker Warot Asawakowitkorn / Thanachai Pramewitayapoori / Dasapich Thongnopnua
-HTTP 402
📌มีมานานแล้ว แต่ไม่ถูกนำมาใช้จริง เนื่องจากตอนนั้นยุคปี 90 ยังไม่ได้มี Use Case ที่เหมาะสม จนกระทั่งมาของ Block Chain / AI Agents ที่มีการทำรายการเล็กๆจำนวนมาก (Micro Transactions) ทำให้เจอข้อจำกัดของระบบเดิม
- การลงทะเบียน
- ค่าธรรมเนียมต่อรายการสูง เมื่อเทียบกับยอดที่จ่าย แต่ยอดเล็ก 20-50 cents รวมๆ 3-5 Trillion (ล้านล้าน US) ปี 2030
- Scale ยาก
📌ซึ่ง Flow การทำงาน ดูจาก Diagram นี้เลย เอาง่าย Agent เข้าไปจับจ่ายแทนเราครับ อย่าง
- Investor App (Buyer) อยากดูข้อมูลของ StockNew (seller)
- StockNew (seller) เฮ้ย จ่ายค่าดูมา 0.01 usdc
- Investor App (Buyer) จ่ายเงินตาม header x-payment ที่นี้หน้าที่ของ Coinbase Facilitator ตรวจ ถ้าผ่าน
- ยัดลง Chain L2
- บอก StockNew (seller) เงินเข้าแล้วว ผ่านๆ

📌เจ้าใหญ่ในปัจจุบัน มี Coinbase (x402 / Base chain), Stripe (MPP/Perchant Protocol) เป็น Facilitator เข้ามาช่วยจัดการก่อนเข้า Chain มี Blog งานของ Arise Blockchain Agentic Payments: Payment Layer for AI Agents ของพี่โดม ไปอ่านเพิ่มได้

-พอ AI Agents ยุ่งกระเป๋าเงินเรา อะไรที่ต้องระวัง
📌Microtransactions มันจะต่างกับ Card Payment แบบเดิม (บัตรเครดิต) เมื่อทำธุรกรรมบน Blockchain มันไม่สามารถของคืนเงินได้ และยิ่งมีธุรกรรมที่เล็ก จำนวนเยอะด้วย
📌สิ่งที่ต้องระวังมีตามใน paper ในส่วนของ 2 หมวดใหญ่ คือ Authorization Correctness (ใช้คนจ่ายไหม) และ Execution Safety (เช่น การจ่าย 0 บาท, เงินติดลบ, หรือการโกง) มี 8 ช้อ
| RULE | WHAT IT ENFORCES | GROUP |
|---|---|---|
| SR1 | Invalid if the proof does not match the server-declared requirements | Authorization |
| SR2 | Invalid if payer authorization is not authentic under the signature model | Authorization |
| SR3 | Invalid if the payer authorization is expired or stale | Authorization |
| SR4 | Valid only when the payment is settled on-chain | Authorization |
| SR5 | Fail fast on zero-value, non-settleable or duplicate proofs; enforce freshness | Execution safety |
| SR6 | Upper bounds on sponsored fees, gas or compute | Execution safety |
| SR7 | Redo verification immediately before settlement submission | Execution safety |
| SR8 | Settle only explicit, allow-listed execution semantics; reject the rest | Execution safety |
และมีรูปแบบการโจมตีที่เกิดขึ้นจริงแล้ว

- Free Shopping (Shoplifting): เกิดขึ้นเมื่อ Seller ส่งมอบ Product / Service ให้ Buyer ก่อนการตัดเงิน (Transaction Settlement) จะเสร็จสิ้น ทำให้ได้ของไปฟรีโดยไม่เสียเงิน
- Asset Theft / Request Injection: ผู้โจมตีแทรก payload ที่เป็นอันตรายลงใน Request เพื่อ ดึงข้อมูล หรือ สร้างความเสียหายให้ระบบเหมือน Prompt Injection
- Denial of Service (DoS): การยิง Request ขนาดเล็กมากๆ (เช่น 0.001 เซนต์) เข้ามาระดับหลายแสนล้านครั้ง เพื่อทำให้ระบบหลังหยุดทำงาน
- Gas Abuse: การส่งคำสั่งก่อกวน เพื่อให้ Facilitator ต้องเสีย Resource Process + ค่า Gas บน Blockchain
-เราออกแบบระบบยังไงให้มันทนทานได้ ?

🛡️เรื่องของ Security และ เงินๆทองๆ ห้ามพึ่งพา System Prompt - ต้องถูก Enforce ในระดับ Code, API และ IAM Policies เท่านั้น อันนี้คล้ายกับ Session แรกของ Langchain
🛡️Identity & Authorization Control: ต้องมีระบบจัดการ Key Management, กำหนดนโยบาย Spending Limit ในโค้ด และใช้มาตรฐานการยืนยันตัวตน เช่น JWT / Single Sign-On (SSO) การจัดการสิทธิ
🛡️Session Isolation: การรัน AI Agent หลาย Session บน Container ที่ใช้ Resource/Kernel ร่วมกัน อาจเกิดปัญหา Memory Leak ทำให้ผู้ใช้คนหนึ่งแอบเข้าถึง Session หรือข้อมูลการชำระเงินของผู้ใช้อีกคนได้ จึงต้องทำ Session Isolation -- เกิดยังไงลองดูจากอันนี้ (LinDevConf26) Workshop: Secure Agentic Development
-Solution ที่ AWS มี

💸 AgentCore (Buyer Side) - Managed wallet / Per-session spending limits / Policy guardrails / Audit Trail จริงเริ่มว่ามี VM มีทุกอย่างสำหรับ Agent แบบพวก memory tool

💸 CloudFront + Lambda@Edge (Seller Side) - Serverless / Monetize any HTTP application (ทำให้ Request เข้า Flow 402 Paywall จ่ายก่อน) / Enforce at the edge / x402 challenge & payment check
💸 EKS Nitro Sandbox (Seller Side) ถ้าอยาก Deploy เอง หรือ มี Use Case อยากเปิดทำอะไรที่เสี่ยง เอามา Run บนนี้ได้ เพราะตรงนี้ pod ที่ run จะแยก
- Sandbox แบบไหน
- Isolated Sandbox แยก Kernel เบื่องหลังใช้ตัส Firecracker - MicroVM
- Confidential Sandbox (เหมือนกับ Isolated Sandbox เพิ่มเรื่องทำงานร่วมกับ AWS KMS และ Cryptographic Key (PCR 17) ตรวจ Buyer ตัวจริงไหม ประมาณนี้ - แต่ละส่วนควรวางตรงไหน ใช้ Pod แบบไหน


- ภาพรวมของระบบอยู่บน EKS


Durable Agents: Why Agents That Move Money Cannot Afford to forget
Speaker Ron Teo De-Zhao
-Intro Temporal
📌Temporal เป็น Open-source Durable Execution Platform ที่นำเสนอ Programming Model เพื่อรักษา Application State) ช่วยให้ระบบสามารถ Pause, Resume หรือ Recover จากการ Crash ได้โดยอัตโนมัติ
📌ปัญหาในระบบเดิม - ทีมต้องเสียเวลาไปกว่า 70% ในการสร้าง Reliability Layer เช่น การจัดการ Message Queue, Dead Letter Queue, Cron Jobs และ State Database เพื่อคอยบันทึก State ในทุกขั้นตอนการทำงาน


📌Temporal แก้โดยทำ SDK เข้ามาจัดการและบันทึก Event History ให้ ซึ่งใช้ได้กับหลาย Use Case ด้วย


- Durable Timers: ตั้งเวลาทำงานข้ามวันหรือข้ามเดือนได้โดยที่เวลาจะไม่ถูก Reset แม้ Server จะ Crash ก็
- Human-in-the-loop
- Flow Retry / Queue / Schedule
- State Management
เจ้า Temporal มีทั้งธนาคารใหญ่ๆใช้กัน และก็ในไทยมียกเคสของ TrueMoney Coin ที่ใช้มานานถึง 4 ปีแล้ว
-Why Agentic Commerce is Hard

📌ต้องมาดูก่อนเรามี Agent แบบไหน
- Single Prompt/Chatbot (3-4 ปีก่อน): ถาม-ตอบจบในครั้งเดียว หากล้มเหลวก็แค่ลองใหม่
- Agentic Loop
- Multi-Agent Orchestrator: มีตัวควบคุมหลักคอยสั่งการ Sub-agents เฉพาะทาง
- Personal/Browser-based Agent: ใช้ VM Sandbox ทำงานเหมือน Human User อย่าง muse / GrokBot
📌ความยากของมัน เมื่อเอา Agent เข้ามา ต้องมาแก้ปัญหาของ Agentic Loop / Multi-Agent และ Personal Agent ทำงานได้เหมือนเดิม โดย
- Agentic Loop - ถ้าหลุดจะเกิดปัญหา Double Order/Checkout เพราะกำลังดูอยู่ ดับ ลเยคิดว่าไม่ได้ซื้อ
- Session Memory - Human Approval หาก Session หมดอายุ ต้องใหม่ทั้งหมด
- Long-term Memory - ข้อมูลพฤติกรรมหรือประวัติสำคัญของลูกค้าจะสูญหายไปทันที เพราะระหว่างบันทึกสรุปข้อมูลหาย
What Temporal Helps


📌 สำหรับงานใน Use Case Agentic Commerce สิ่งที่ตัว Temporal ทำ จะมองตัวเองเป็น Outer Harness ทำงานร่วมกับ Framework ต่างๆแบบ Agent Framework หรือ SDK ต่างๆ (เช่น LangChain, AutoGen, LlamaIndex, OpenAI SDK, AWS SDK, Microsoft Agent Framework )
📌Event History & Replay: บันทึก Input, Output และ Message History ถ้า Worker นั้นมีปัญหาสามารถ ไปยังจุดที่ต้องการได้
📌Long-running Workflows
📌Security & Privacy: รองรับการ Encrypt Payload แบบ End-to-End หน้าที่ Temporal ทำให้ของไม่หาย โดยที่ Key ถูกจัดการฝั่ง Customer



จากนั้นเป็นส่วน Live Demo Travel Agent Workflow โดยมีทั้งส่วน Human Approve และวางยาทำให้ Worker ตุยไป แต่ State ทุกอย่างครบถ้วนเลย ระบบก็ Retry จาก State เดิมได้ รวมถึงมา Demo Replay ที่จะช่วย Audit หรือ Debug การทำงานของ Agent ได้ง่าย
Resource: https://github.com/temporalio/temporal
-Q&A
📚 ถ้าทำระบบที่เป็๋น Micropayment แบบละครแนวตั้งของจีนย ที่มาตอนเล็กๆ เดิมต้องใข้ cron มาตรวจ ถ้ามี Temporal มีทท่าไหนที่แนะนำ
Ans Durable Timer จัดการได้
📚 Pricing - แบบไหน
Ans มีทั้งแบบ Per Per Use / นับตาม Action โดย $50 ต่อ 1 ล้าน Actions เค้าบอกว่า 1 ธุรกรรมใช้ 7-8 Actions นอกจากมีมี Credit 150 USD / ถ้า Start Up เข้ามาคุยแยกได้
📚อยากใช้ เริ่มยังไง ?
Ans มีคอร์สฟรี Temporal 101 และ 102
ตอนแรกผมมาตั้งใจมาฟัง LangChain เพราะได้ Assign มา รอบนี้ปรากฏว่าตัว Temporal น่าสนใจจริงๆ และมี SDK ของ .NET ด้วย



