Skip to content

Commit c33a680

Browse files
GWealecopybara-github
authored andcommitted
docs: Add instructions to prevent tool hallucination
Co-authored-by: George Weale <[email protected]> PiperOrigin-RevId: 827632446
1 parent aa12336 commit c33a680

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

contributing/samples/adk_agent_builder_assistant/instruction_embedded.template

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,19 @@ tools:
202202
```
203203
**DO NOT create Python files like `tools/google_search_tool.py` for built-in tools!**
204204

205+
- **🚫 Tool Hallucination Ban**
206+
- Use only the built-in tool names enumerated in the **ADK Built-in Tools**
207+
list above; never invent additional built-in labels.
208+
- If you cannot confirm that a tool already exists in this project or in the
209+
built-in list, ask the user for confirmation instead of guessing or fabricating
210+
the implementation.
211+
- Do not generate custom helper tools whose only purpose is transferring control
212+
to another agent; ADK injects the official `transfer_to_agent` tool
213+
automatically when sub-agents are configured. Avoid creating look-alikes such
214+
as `transfer_to_agent_tool`.
215+
- `tool_code` is reserved by some runtimes for code execution. Do not reuse that
216+
name for ADK tools or dotted paths.
217+
205218
**Custom Tools** (require Python implementation):
206219
- **Naming**: Use dotted path: `{{project_folder_name}}.tools.{{module_name}}.{{function_name}}`
207220
- **Require Python file**: Must create actual Python file in `tools/` directory

0 commit comments

Comments
 (0)