# AIアンチパターン集

CURRENT_STATUS: UNKNOWN
OBSERVATION: SPEC_ONLY
FRESHNESS: UNKNOWN
PAGE_TYPE: failure_note
CANONICAL_URL: /tools/ea-021-ai
CLAIM_IDS: none
EVIDENCE_IDS: EA-021-R11-RESEARCH, EA-021-R11-WEB-READBACK
UNKNOWN_IDS: EA-021-UNKNOWN-01, EA-021-UNKNOWN-CURRENTNESS
OPS_IDS: none

## Summary
AIアンチパターンは、特定技術を使うこと自体ではなく、有効な技術を責務や適用条件を無視して万能化するところから生じる。長いコンテキスト、RAG、Agent、会話memoryはいずれも有用だが、正本、権限、状態、検証、復旧まで一つの層へ背負わせると、性能・安全性・監査性・費用のどこかで破綻しやすい。技術名ではなく、責務分離と失敗包絡で診断する。

## Current judgment
AIアンチパターンは、特定技術を使うこと自体ではなく、有効な技術を責務や適用条件を無視して万能化するところから生じる。長いコンテキスト、RAG、Agent、会話memoryはいずれも有用だが、正本、権限、状態、検証、復旧まで一つの層へ背負わせると、性能・安全性・監査性・費用のどこかで破綻しやすい。技術名ではなく、責務分離と失敗包絡で診断する。

## Scope
AIアンチパターン集

## Confirmed

## UNKNOWN
- EA-021-UNKNOWN-01: - 長いprompt/long context自体をアンチパターンとしない。
- RAG自体を否定しない。
- Agent自体を否定しない。
- external stateを自動的に安全とはみなさない。
- context reset/compaction/summaryを無損失とはみなさない。
- research benchmarkをcurrent provider/tenantの保証へ外挿しない。
- OWASP taxonomyを特定provider/tenantの脆弱性存在の証明にしない。
- provider memory機能の存在とcanonical-record suitabilityを分離する。
- `PRODUCT_VOLATILE` なmodel、context、tool、approval、compaction仕様はpublication時にcurrentnessを再確認する。

`OPEN_UNKNOWN`:
- current frontier modelsでのAP-01/AP-05閾値
- providerごとの自動compaction/context reset実装差
- RAG ACL/freshnessの製品別実挙動
- agent approval UIがindirect prompt injectionに対して持つ実効防御

これらは推測で閉じない。
- EA-021-UNKNOWN-CURRENTNESS: 外部根拠の再確認日がcanonical body/control-planeで確定していないため、currentnessはUNKNOWNとして保持する。日付を推測補完しない。

## Evidence
- EA-021-R11-RESEARCH (RESEARCH): EA-021 監査済みresearch / canonical revision binding
- EA-021-R11-WEB-READBACK (IMPL): EA-021 Web body identity / canonical readback

## Failure / limits
長いprompt/long context自体をアンチパターンとしない。
## Failure / limits
RAG自体を否定しない。
## Failure / limits
Agent自体を否定しない。
## Failure / limits
external stateを自動的に安全とはみなさない。
## Failure / limits
context reset/compaction/summaryを無損失とはみなさない。
## Failure / limits
research benchmarkをcurrent provider/tenantの保証へ外挿しない。
## Failure / limits
OWASP taxonomyを特定provider/tenantの脆弱性存在の証明にしない。
## Failure / limits
provider memory機能の存在とcanonical-record suitabilityを分離する。
## Failure / limits
`PRODUCT_VOLATILE` なmodel、context、tool、approval、compaction仕様はpublication時にcurrentnessを再確認する。

`OPEN_UNKNOWN`:
## Failure / limits
current frontier modelsでのAP-01/AP-05閾値
## Failure / limits
providerごとの自動compaction/context reset実装差
## Failure / limits
RAG ACL/freshnessの製品別実挙動
## Failure / limits
agent approval UIがindirect prompt injectionに対して持つ実効防御

これらは推測で閉じない。
## Practice
**Long-context**: model/context-window、mode、token budget、tool result size、provider compaction behavior。

**RAG**: source access、index freshness、ACL propagation、embedding/reranker/version、retrieval scope。

**Agent**: tool availability、identity/permission、approval policy、sandbox、region/plan、external service limits。

**External state**: source-system API、schema/version、write permission、concurrency/transaction semantics。
## Practice
**Security**: excessive agency、prompt injection、RAG/vector weaknessを各症例へ接続し、least privilegeとuntrusted-content boundaryを必須欄とする。

**Privacy**: 全履歴投入は必要以上のdataをmodel/provider/toolへ渡し得るため、data minimizationを適用する。

**Audit**: AI内部stateを正本化せず、versioned external artifactとtool/action logを保持する。

**Cost**: context/tool定義/中間結果の無制限投入とagent loopはtoken、latency、retry costを増やし得る。

**Operability**: rollback、idempotency、structured handoff、freshness、failure recoveryをcardごとに記録する。
## Public claim
AIアンチパターンは、特定技術を使うこと自体ではなく、有効な技術を責務や適用条件を無視して万能化するところから生じる。長いコンテキスト、RAG、Agent、会話memoryはいずれも有用だが、正本、権限、状態、検証、復旧まで一つの層へ背負わせると、性能・安全性・監査性・費用のどこかで破綻しやすい。技術名ではなく、責務分離と失敗包絡で診断する。

## Diagnostic card schema
以下は `PROPOSAL`。各症例を「兆候 / なぜ魅力的か / 破綻条件 / 観測可能な症状 / 反証 / 代替pattern / TEST_PROFILE」の定型cardとして扱う。禁止リストではない。

## AP-01 巨大プロンプト一本
**兆候**: policy、knowledge、state、workflow、例外処理を一つのpromptへ集中する。

**破綻条件・症状**: 変更差分、provenance、testabilityが弱くなり、長文化が情報利用精度を保証しない。長contextでは関連情報の位置による性能差が研究で報告されているが、特定task/model群の結果を全現行modelへ外挿しない。

**反証**: 全文比較、法令・仕様横断、引用確認など入力全体が必要なtaskではlong contextが合理的な場合がある。

**代替pattern**: system policy、retrieval、external state、tool schema、evalへ責務を分離する。

## AP-02 全部RAG
**兆候**: authoritative record、transactional state、permission decision、deterministic lookupまでvector retrievalへ寄せる。

**破綻条件・症状**: RAG/vector層固有の弱点、index freshness、ACL propagation、retrieval scope、source provenanceが正本・権限・transactionの責任と混同される。

**反証**: RAGは大量の外部knowledgeを必要時取得する有力patternであり、RAG自体を否定しない。

**代替pattern**: source systemを正本に保ち、RAGを派生index/grounding layerとして扱う。

## AP-03 全部Agent
**兆候**: deterministic workflowや単純変換までautonomous planning/tool executionへ寄せる。

**破綻条件・症状**: prompt injectionの攻撃面、excessive agency、権限、費用、非決定性、評価面積が増える。agent化は能力追加と同時にblast radiusを増やし得る。

**反証**: 曖昧なmulti-step task、動的tool selection、環境feedbackが必要なtaskではAgentが価値を持つ。

**代替pattern**: workflow-firstとし、必要な曖昧判断部分だけagent化する。必要性、権限境界、evalを明示する。

## AP-04 AIに正本を持たせる
**兆候**: conversation memory、context、model内部状態をcanonical stateとみなす。

**破綻条件・症状**: versioning、concurrency、ACL、durability、rollback、監査の保証が不足する。

**反証**: external stateにも同期、schema migration、ACL、backup等の運用負荷がある。外部化だけで自動的に安全になるわけではない。

**代替pattern**: 独立したversioned source-of-truthを持ち、AIはread / derive / propose / update-contract経由で扱う。長期taskではexternal artifactをcontinuity anchorとして利用できる。

## AP-05 全履歴投入
**兆候**: token windowに収まる限り、履歴、tool定義、中間結果を全投入する。

**破綻条件・症状**: long-contextの位置依存、token/latency増加、tool-definition overload、中間tool結果の肥大化、context limit超過、転記ミス等を招き得る。

**反証**: context reset、compaction、summaryにも情報損失と追加costがあり、taskごとのevalが必要。

**代替pattern**: bounded retrieval、structured handoff、external state、必要toolの遅延公開、summary/compaction/resetをtask特性で使い分ける。

## Evidence / provenance
- Liu et al., *Lost in the Middle: How Language Models Use Long Contexts* — multi-document QA / key-value retrievalにおけるlong-context positional degradationの研究根拠。全current modelへの普遍保証にはしない。
- Anthropic, *Code execution with MCP: Building more efficient agents* — tool definitionsとintermediate resultsによるcontext/token負荷のofficial engineering report。`PRODUCT_VOLATILE`。
- Anthropic, *Harness design for long-running application development* — long-running agentのcontext saturation、structured handoff/context resetのengineering report。resetのoverheadも保持する。`PRODUCT_VOLATILE`。
- OWASP GenAI Security Project, LLM Top 10 2025 — Prompt Injection / Excessive Agency / Vector and Embedding Weaknesses / Unbounded Consumptionのsecurity taxonomy。特定provider/tenantの脆弱性存在を直接証明するものではない。
- OpenAI, *Designing AI agents to resist prompt injection* — browsing/retrieval/external actionを持つagentの攻撃面に関するofficial security engineering evidence。`PRODUCT_VOLATILE`。
- Anthropic prompting guidance — long-horizon taskでexternal fileへstateを保存しfresh contextからcontinuityを再構成するcurrent implementation guidance。`PRODUCT_VOLATILE`。

## Availability gates
**Long-context**: model/context-window、mode、token budget、tool result size、provider compaction behavior。

**RAG**: source access、index freshness、ACL propagation、embedding/reranker/version、retrieval scope。

**Agent**: tool availability、identity/permission、approval policy、sandbox、region/plan、external service limits。

**External state**: source-system API、schema/version、write permission、concurrency/transaction semantics。

## Security / privacy / audit / cost / operability
**Security**: excessive agency、prompt injection、RAG/vector weaknessを各症例へ接続し、least privilegeとuntrusted-content boundaryを必須欄とする。

**Privacy**: 全履歴投入は必要以上のdataをmodel/provider/toolへ渡し得るため、data minimizationを適用する。

**Audit**: AI内部stateを正本化せず、versioned external artifactとtool/action logを保持する。

**Cost**: context/tool定義/中間結果の無制限投入とagent loopはtoken、latency、retry costを増やし得る。

**Operability**: rollback、idempotency、structured handoff、freshness、failure recoveryをcardごとに記録する。

## Evaluation
`TEST_PROFILE` は未実施。以下を同一業務fixtureで比較する。

- 全履歴投入 vs bounded retrieval + state handoff
- deterministic workflow vs agent
- RAG-only vs source-system lookup + RAG

accuracy/task completionだけでなく、token、latency、tool calls、permission violations、citation/source correctness、recovery costを計測する。未実施のため結果や閾値を推測しない。

## Failure envelope / OPEN_UNKNOWN
- 長いprompt/long context自体をアンチパターンとしない。
- RAG自体を否定しない。
- Agent自体を否定しない。
- external stateを自動的に安全とはみなさない。
- context reset/compaction/summaryを無損失とはみなさない。
- research benchmarkをcurrent provider/tenantの保証へ外挿しない。
- OWASP taxonomyを特定provider/tenantの脆弱性存在の証明にしない。
- provider memory機能の存在とcanonical-record suitabilityを分離する。
- `PRODUCT_VOLATILE` なmodel、context、tool、approval、compaction仕様はpublication時にcurrentnessを再確認する。

`OPEN_UNKNOWN`:
- current frontier modelsでのAP-01/AP-05閾値
- providerごとの自動compaction/context reset実装差
- RAG ACL/freshnessの製品別実挙動
- agent approval UIがindirect prompt injectionに対して持つ実効防御

これらは推測で閉じない。

## Cross-reference boundary
AP-01〜05はEA-020 architecture patternと対にし、anti-patternから代替patternへ接続する。RAG症例はEA-014/015、Agent症例はEA-006/020、TEST_PROFILEはEA-011、AI正本化症例はstate/source-of-truth原則へ接続する。ただし本packetで各関連EAの内容を再編集・再解釈しない。

NEXT: /agent/start.json
STOP: This is a knowledge projection, not an execution order.