No English page yet. Showing the Japanese source.
Agent Idempotency/重複実行防止
記事状態: 公開 · 最終確認: 2026-10-05
要点
Agentの重複実行防止は、promptで同じtoolを二度呼ばないと指示するだけでは成立しない。timeout、network disconnect、SDK retry、queue redelivery、webhook replay、double click、model/tool retryがあるため、副作用を持つ操作にはstableなbusiness operation identityとdurableな重複判定が必要である。idempotencyは定義したscope/lifetime内で追加副作用を抑制するprotocolであり、無条件のexactly-once保証ではない。
現在の判断
Agentの重複実行防止は、promptで同じtoolを二度呼ばないと指示するだけでは成立しない。timeout、network disconnect、SDK retry、queue redelivery、webhook replay、double click、model/tool retryがあるため、副作用を持つ操作にはstableなbusiness operation identityとdurableな重複判定が必要である。idempotencyは定義したscope/lifetime内で追加副作用を抑制するprotocolであり、無条件のexactly-once保証ではない。
どこまで当てはまるか
keyのscopeとTTLを明示する。TTL後のlate retryは新規操作になり得る。provider/API固有のregional/zonal等のscopeを無視してglobal onceと一般化しない。
詳しく理解する
実装・運用
transport request IDとbusiness operation IDを分離する。retry時は同じoperation identityを再利用する。同じpayloadが正当な別注文・別送信の場合もあるためpayload hashだけをbusiness identityにしない。keyにsecret/PIIを埋め込まない。
FINGERPRINT AND MISMATCH
同じkeyのrequestはcanonical operation fingerprintと照合する。amount、recipient、target、action等の意味が変わればfail closedにする。serialization順序やvolatile timestamp差はcanonicalization ruleで固定する。
DURABLE STATE MACHINE
side effect前にdurable stateをatomic claimする。IN_PROGRESS / SUCCEEDED / FAILED_RETRYABLE / FAILED_TERMINAL / UNKNOWN_RECONCILIATIONを区別する。check-then-insertではなくunique constraint、compare-and-set、transaction等でownerを一意にする。成功済みduplicateには保存済みresultまたはstable downstream handleを返す。
AMBIGUOUS TIMEOUT
timeoutはfailureと同義ではない。remote commit後にresponseだけ失われ得る。未受付を証明できない場合はUNKNOWNとして、同一operation identityで安全にretryできるcontractまたはstatus/query endpointでreconcileする。
TTL AND SCOPE
keyのscopeとTTLを明示する。TTL後のlate retryは新規操作になり得る。provider/API固有のregional/zonal等のscopeを無視してglobal onceと一般化しない。
PRECONDITIONS
request dedupeとresource preconditionは別機能である。ETag、generation、version、revision等で対象状態を固定し、stale writeを拒否する。
RETRY POLICY
retryability、backoff、jitter、retry budgetを分離する。backoff/jitterはretry amplificationを抑えるがduplicate side effectは防がない。SDK hidden retryとapplication retryの積み重なりを把握する。
MULTI STEP AGENT ACTIONS
複数side effectを含むAgent actionはouter keyだけで全stepを保証しない。各side effectにstable identityを割り当て、workflow state、outbox/inbox、downstream operation ID等でcommit/reconcile状態を保持する。
セキュリティとプライバシー
idempotency key所持をauthorizationにしない。retry時もprincipal、tenant、target、policyを検証する。
OPERATING CHECK
concurrent duplicate、same-key mismatch、JSON順序差、timeout before acceptance、timeout after commit、process crash、stale IN_PROGRESS、TTL後replay、queue/webhook redelivery、stale resource version、SDK+application retry、cross-tenant/cross-region key、multi-step partial completionをfault injectionする。duplicate-side-effect rate、false-dedupe rate、UNKNOWN/reconciliation rate、retry amplification、late-replay exposureを別metricにする。
実装・運用 2
2026-10-05時点のAWS EC2、Google Cloud retry/idempotency docs、AWS operations guidance、Stripe engineering、IETF HTTPAPI Idempotency-Key draft-07に基づくdesk research。IETF文書はexpired Internet-Draftでfinal RFCとして扱わない。production side-effect testは未実施。
よくある失敗・反証
new key on retry、key reuse mismatch、non-atomic dedupe、crash after side effect、stale IN_PROGRESS、TTL expiry、clock skew、cross-region scope、late queue replay、hidden SDK retry、webhook/model replay、partial multi-step commit、non-idempotent downstream、short downstream dedupe window、stale precondition、repeated compensation、replay attack、tenant collision、result-version drift。
実務での使い方
2026-10-05時点のAWS EC2、Google Cloud retry/idempotency docs、AWS operations guidance、Stripe engineering、IETF HTTPAPI Idempotency-Key draft-07に基づくdesk research。IETF文書はexpired Internet-Draftでfinal RFCとして扱わない。production side-effect testは未実施。
まだ確認できていないこと
- EA-241-UNKNOWN-01
対象Agent runtime、workflow/queue、downstream API、idempotency window、SDK hidden retry、dedupe store、multi-region topology、tenant namespace、authorization binding、fingerprint rule、TTL、reconciliation endpoint、outbox/inbox、compensation、audit retention、privacy requirementは未確認。
根拠資料
この記事には、直接開ける外部出典が登録されていません。出典IDや検証情報は末尾で確認できます。
更新履歴
EA-241-FIRST-20261005: canonical audit/publication binding
出典ID・検証情報・機械可読データ
根拠の種類と情報の鮮度は、ラベルとアイコンで確認できます。
- 記事ID
- EA-241
- 最終確認日
- 2026-10-05
- 提供元・モデル・プラン・利用環境
- —
- 対象地域
- —
元資料の全文と収録照合記録
PUBLIC_CLAIM
Agentの重複実行防止は、promptで同じtoolを二度呼ばないと指示するだけでは成立しない。timeout、network disconnect、SDK retry、queue redelivery、webhook replay、double click、model/tool retryがあるため、副作用を持つ操作にはstableなbusiness operation identityとdurableな重複判定が必要である。idempotencyは定義したscope/lifetime内で追加副作用を抑制するprotocolであり、無条件のexactly-once保証ではない。
OPERATION_IDENTITY
transport request IDとbusiness operation IDを分離する。retry時は同じoperation identityを再利用する。同じpayloadが正当な別注文・別送信の場合もあるためpayload hashだけをbusiness identityにしない。keyにsecret/PIIを埋め込まない。
FINGERPRINT_AND_MISMATCH
同じkeyのrequestはcanonical operation fingerprintと照合する。amount、recipient、target、action等の意味が変わればfail closedにする。serialization順序やvolatile timestamp差はcanonicalization ruleで固定する。
DURABLE_STATE_MACHINE
side effect前にdurable stateをatomic claimする。IN_PROGRESS / SUCCEEDED / FAILED_RETRYABLE / FAILED_TERMINAL / UNKNOWN_RECONCILIATIONを区別する。check-then-insertではなくunique constraint、compare-and-set、transaction等でownerを一意にする。成功済みduplicateには保存済みresultまたはstable downstream handleを返す。
AMBIGUOUS_TIMEOUT
timeoutはfailureと同義ではない。remote commit後にresponseだけ失われ得る。未受付を証明できない場合はUNKNOWNとして、同一operation identityで安全にretryできるcontractまたはstatus/query endpointでreconcileする。
TTL_AND_SCOPE
keyのscopeとTTLを明示する。TTL後のlate retryは新規操作になり得る。provider/API固有のregional/zonal等のscopeを無視してglobal onceと一般化しない。
PRECONDITIONS
request dedupeとresource preconditionは別機能である。ETag、generation、version、revision等で対象状態を固定し、stale writeを拒否する。
RETRY_POLICY
retryability、backoff、jitter、retry budgetを分離する。backoff/jitterはretry amplificationを抑えるがduplicate side effectは防がない。SDK hidden retryとapplication retryの積み重なりを把握する。
MULTI_STEP_AGENT_ACTIONS
複数side effectを含むAgent actionはouter keyだけで全stepを保証しない。各side effectにstable identityを割り当て、workflow state、outbox/inbox、downstream operation ID等でcommit/reconcile状態を保持する。
AUTHORIZATION_AND_REPLAY
idempotency key所持をauthorizationにしない。retry時もprincipal、tenant、target、policyを検証する。
OPERATING_CHECK
concurrent duplicate、same-key mismatch、JSON順序差、timeout before acceptance、timeout after commit、process crash、stale IN_PROGRESS、TTL後replay、queue/webhook redelivery、stale resource version、SDK+application retry、cross-tenant/cross-region key、multi-step partial completionをfault injectionする。duplicate-side-effect rate、false-dedupe rate、UNKNOWN/reconciliation rate、retry amplification、late-replay exposureを別metricにする。
FAILURE_ENVELOPE
new key on retry、key reuse mismatch、non-atomic dedupe、crash after side effect、stale IN_PROGRESS、TTL expiry、clock skew、cross-region scope、late queue replay、hidden SDK retry、webhook/model replay、partial multi-step commit、non-idempotent downstream、short downstream dedupe window、stale precondition、repeated compensation、replay attack、tenant collision、result-version drift。
IMPLEMENTATION_STATE
2026-10-05時点のAWS EC2、Google Cloud retry/idempotency docs、AWS operations guidance、Stripe engineering、IETF HTTPAPI Idempotency-Key draft-07に基づくdesk research。IETF文書はexpired Internet-Draftでfinal RFCとして扱わない。production side-effect testは未実施。
SAFE_WORDING
Agentの副作用操作にはstable operation identity、same-key mismatch拒否、atomic dedupe state、result replay/reconciliation、TTL、resource-version preconditionを設計する。idempotencyはretryを安全にする境界であり、無条件のexactly-once保証ではない。
OPEN_UNKNOWN
対象Agent runtime、workflow/queue、downstream API、idempotency window、SDK hidden retry、dedupe store、multi-region topology、tenant namespace、authorization binding、fingerprint rule、TTL、reconciliation endpoint、outbox/inbox、compensation、audit retention、privacy requirementは未確認。
EA-241-CURRENT-APPROVAL研究資料研究資料根拠の出所: AUDITED_CANONICAL_RESEARCH_PACKET現行本文の監査・revision対応
- 裏付ける内容
- 現行台帳のAUDIT_PASSと候補・revision・本文ハッシュの対応を確認しています。
- 確認日
- —
- 出典・実験ID
- CANDIDATE-EA241-FIRST-20261005-C2-RESCUE20261013
- 検証箇所
- 1KqhJtiSb2S84rWmeYVwKcT_76dBwZ_B0ZZuAWQqH0rQ · EA_REVISION_LEDGER!A44:U44 · EA-241-FIRST-20261005
- 適用範囲
- —
- 出典・来歴
- CURRENT_CANONICAL_APPROVAL_READBACK
- 限界
- 監査状態と来歴の記録です。外部根拠の最新性や本文の全主張を追加保証しません。
EA-241-CURRENT-BODY-READBACK実装資料実装資料根拠の出所: IMPLEMENTATION_READBACK現行本文の収録照合
- 裏付ける内容
- 公開生成入力の本文SHA-256が、監査済み候補に結び付いたハッシュと一致しています。
- 確認日
- 2026-10-13
- 出典・実験ID
- BODY-SHA256:e84b3249cbbd5627502241d057d409e53cf9d03df8af21d5822957e9028db333
- 検証箇所
- content/staging/EA-241.md · e84b3249cbbd5627502241d057d409e53cf9d03df8af21d5822957e9028db333 · EA-241-FIRST-20261005
- 適用範囲
- —
- 出典・来歴
- CURRENT_APPROVED_BODY_HASH_MATCH
- 限界
- 本文の同一性の検査です。外部システムの挙動や全主張の真偽を実証したものではありません。
- 出典ID
- CANDIDATE-EA241-FIRST-20261005-C2-RESCUE20261013, BODY-SHA256:e84b3249cbbd5627502241d057d409e53cf9d03df8af21d5822957e9028db333
- 追跡中のUNKNOWN ID
- EA-241-UNKNOWN-01
- 再確認のきっかけ
- canonical revision/publication state change · body artifact hash change · source currentness change · new contradiction or implementation readback
機械検査: 通過 — Automated validation does not guarantee accuracy or authorize execution.
同じ記事IDの機械可読データです。