フィールドガイド / 11 分
各 Tool に狭い契約を与える
モデルの意図を境界付き・観測可能な application action へ変える。
OpenAI tools は検索、file retrieval、code execution、MCP 接続、custom function を提供できます。信頼性は各 action の周囲——小さな schema、明示 authority、idempotency、解釈可能な result——から生まれます。
作業原則
Capability は authority ではない
Tool definition は callable surface。どの user、task、environment が実行できるかは server が判断します。
小さな schema を選ぶ
generic execute-anything より、引数を制約した一つの明確な operation を選びます。
Result も protocol message
stable ID、bounded data、explicit error category を返し、次の step が outcome を解釈できるようにします。
フィールド手順
- 01
side effect を分類
read-only、reversible write、irreversible write、external communication に分け、read-only から始めます。
- 02
最小 schema を定義
required fields、enums、length limits、additional properties を制約し、credential は argument に入れません。
- 03
authority gate を置く
実行前に authenticated actor と task scope を確認し、高影響 operation は approval を要求します。
- 04
idempotent に実行
write に operation key を使い、同じ intent の retry には以前の result を返します。
- 05
compact result を返す
success、user-correctable error、policy denial、transient failure を分離し、大量 log を context へ返しません。
PASS / FAIL
受入チェック
- 各 tool に owner と impact class がある。
- Arguments に credential がない。
- Write は idempotency / duplicate detection を持つ。
- Audit は intent、actor、execution、result を結ぶ。
WATCH / REJECT
失敗パターン
- 広すぎる shell/database tool。
- description を authorization とみなす。
- stack trace や巨大 payload をそのまま返す。