Agentic Travel Transaction Safety
Agent loop, retry ve tool invocation kaynaklı duplicate booking/payment riskini idempotency, transaction guards ve UNKNOWN-aware recovery ile yönetin.
AI agent'lar plan yeniden çalıştırabilir, tool retry yapabilir veya aynı intent'i farklı execution path'lerinden tekrar çağırabilir. Bu nedenle agentic transaction safety'nin temeli idempotency + explicit side-effect guards olmalıdır.
Side-effect boundary
Read ve write tool'ları ayırın:
READ:
search
retrieve
quote
status
WRITE:
book
capture
cancel
refund
exchange
modifyWRITE tool'ları ekstra guard gerektirir.
Idempotency key
purchaseIntentId + operation + versionÖrnek:
book:pi_123:v1
capture:pi_123:v1
cancel:bk_456:v1Agent retry kuralı
Agent tool error gördüğünde otomatik olarak write retry yapmamalıdır.
SUCCESS -> return result
FAILED_AUTHORITATIVE -> policy-based retry/new version possible
UNKNOWN -> reconcile, do not repeat side effectDuplicate transaction prevention
Koruma katmanları:
- persistent idempotency store,
- unique constraint,
- provider idempotency mapping,
- single active attempt,
- UNKNOWN retry block,
- request hash,
- manual override audit.
Payment/booking separation
Agent "payment captured" sonucunu "trip booked" diye yorumlamamalıdır. Canonical transaction completion ancak gerekli booking/payment/document state'leri uyumlu olduğunda oluşur.
Replacement booking guard
İlk booking UNKNOWN iken agent alternatif booking açmak istiyorsa:
- authoritative lookup,
- HITL checkpoint,
- duplicate-risk warning,
- new purchase intent/version gereklidir.
Tool contract
Write tool response en az:
- operationId,
- status,
- terminal boolean,
- providerReference,
- retrySafe,
- reconciliationRequired alanlarını dönmelidir.
Failure modes
- LLM aynı tool'u iki kez çağırır,
- orchestration timeout sonrası retry,
- tool success response agent'a ulaşmaz,
- provider success/local persist fail,
- payment ve booking divergence,
- replay edilmiş plan eski authorization ile çalışır.
Observability
- duplicate side-effect blocked,
- UNKNOWN write attempts,
- repeated tool-call count,
- idempotency conflict,
- reconciliation-required count,
- agent plan replay count.
Production checklist
- read/write tool classification,
- persistent idempotency,
- UNKNOWN-aware retry,
- terminal flag,
- reconciliation tool,
- separate payment/booking states,
- HITL for replacement booking,
- audit of all write attempts.
Bu problemi production’da mı yaşıyorsunuz?
Semptomu, veri akışını ve entegrasyon davranışını birlikte teknik olarak inceleyebiliriz.