Freeze the Agent Tool Catalog at Cost Class Zero
说明与用途
创建静态 tools.freeze.toml,提交到仓库,并在应用初始化前加载,验证每个工具是否符合成本类别和限制。任何不在文件中的新工具都会导致构建失败。
问题
A solo founder needs to ship an agent‑backed indie API the same day while guaranteeing that no paid or vendor‑managed tools are invoked, but still allowing local or free‑net tools.
结果
The workflow ensures that only pre‑approved, zero‑cost tools are callable, preventing accidental billing and enabling same‑day indie API launches.
工作流
- 1. Create a tools.freeze.toml file listing all allowed tools with cost_class, max_calls, max_ms, and allow_url if needed.
- 2. Commit the freeze file to source control and do not generate it in CI.
- 3. Load the freeze in a module that imports no vendor SDKs before the app object is created.
- 4. Parse the TOML, validate uniqueness of names, enforce cost_class rules, and check allow_url for free_net tools.
- 5. Reject the build if the freeze is missing, duplicated names exist, or a tool violates its cost_class constraints.
- 6. During runtime, dispatch every tool call through a dry‑run ledger that enforces max_calls and max_ms per request.
- 7. Reject any call that would exceed the defined budgets or invoke a forbidden tool.
证据
The catalog must load in a module that imports no vendor SDK. Parse TOML, then refuse to boot if the file is missing, if two tools share a name, or if any free_net row lacks an exact allow_url.
Tool calling is how an AI‑drafted handler reaches the rest of the world. A model that can register charge_card, embed_via_vendor, or publish_to_managed_queue will do so with confident names and tidy type hints.
- 记录日期: 2026-09-22T19:45:52.377Z