Skip to content

Commit 61b8a58

Browse files
committed
docs(tools): add TOOL_SELECTION.md user guide
Explain default behaviour (all tools registered), the four configuration layers, whitelist vs blacklist semantics, security restriction on project config, and concrete deployment examples (chatbot, read-only research, locked-down CI, memory disable). Include the full tool-name reference table.
1 parent defcc75 commit 61b8a58

1 file changed

Lines changed: 207 additions & 0 deletions

File tree

docs/TOOL_SELECTION.md

Lines changed: 207 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,207 @@
1+
# Tool Selection Guide
2+
3+
Control which tools odek exposes to the LLM. By default every built-in tool is
4+
available, but many deployments want a smaller surface: a chatbot with only
5+
search and voice, a read-only research assistant, or a locked-down CI runner.
6+
7+
## Default behaviour
8+
9+
With no `tools` configuration, odek registers **all** built-in tools that its
10+
environment supports:
11+
12+
- Core tools: `shell`, `delegate_tasks`, `read_file`, `write_file`, `search_files`,
13+
`patch`, `batch_read`, `batch_patch`, `glob`, `file_info`, `parallel_shell`,
14+
`http_batch`, `math_eval`, `diff`, `count_lines`, `multi_grep`, `json_query`,
15+
`tree`, `checksum`, `sort`, `head_tail`, `base64`, `tr`, `word_count`
16+
- Media tools: `transcribe`, `vision`
17+
- Memory: `memory` (persistent facts/episodes)
18+
- Session search: `session_search`
19+
- Browser: `browser`
20+
- Web search: `web_search` (only when `web_search.base_url` is configured)
21+
- Skill tools: `skill_load`, `skill_list`, `skill_save`, `skill_patch`,
22+
`skill_delete` (only when skill learning is enabled)
23+
- MCP tools: prefixed as `<server>__<tool_name>` (only when `mcp_servers` are
24+
configured)
25+
26+
Nothing is hidden by default. You opt out with `disabled`, or opt in with
27+
`enabled`.
28+
29+
## Configuration
30+
31+
Use the `tools` section in any operator-controlled config source:
32+
33+
| Source | File / mechanism |
34+
|---|---|
35+
| Global config | `~/.odek/config.json` |
36+
| Project config | `./odek.json`**can only disable, never enable** |
37+
| Environment | `ODEK_TOOLS_ENABLED`, `ODEK_TOOLS_DISABLED` |
38+
| CLI | `--tool <name>`, `--no-tool <name>` |
39+
40+
Priority, highest to lowest:
41+
42+
```
43+
CLI flags → ODEK_* env vars → ./odek.json → ~/.odek/config.json
44+
```
45+
46+
`enabled` is replaced by the highest layer that sets it. `disabled` is merged
47+
across layers.
48+
49+
## Schema
50+
51+
```json
52+
{
53+
"tools": {
54+
"enabled": ["web_search", "transcribe", "vision", "send_message"],
55+
"disabled": ["shell", "write_file", "patch", "delegate_tasks"]
56+
}
57+
}
58+
```
59+
60+
- `enabled` — whitelist. When non-empty, only these tools are registered.
61+
An empty array means **no tools at all**.
62+
- `disabled` — blacklist. Removed from the default set (or from `enabled`
63+
when both are present).
64+
65+
## Examples
66+
67+
### Chatbot with web search and voice
68+
69+
```bash
70+
# CLI only
71+
odek run \
72+
--tool web_search \
73+
--tool transcribe \
74+
--tool vision \
75+
--tool send_message \
76+
--no-tool shell \
77+
--no-tool write_file \
78+
--no-tool patch \
79+
--no-tool delegate_tasks \
80+
"what's the weather in Tokyo?"
81+
```
82+
83+
Or set it once in `~/.odek/config.json`:
84+
85+
```json
86+
{
87+
"tools": {
88+
"enabled": ["web_search", "transcribe", "vision", "send_message"]
89+
}
90+
}
91+
```
92+
93+
### Read-only research assistant
94+
95+
```json
96+
{
97+
"tools": {
98+
"enabled": [
99+
"browser",
100+
"web_search",
101+
"read_file",
102+
"session_search",
103+
"multi_grep",
104+
"search_files"
105+
]
106+
}
107+
}
108+
```
109+
110+
This agent can read and search but cannot write files, run shell commands, or
111+
spawn sub-agents.
112+
113+
### Locked-down CI runner
114+
115+
```json
116+
{
117+
"tools": {
118+
"disabled": [
119+
"write_file", "patch", "batch_patch", "delegate_tasks",
120+
"browser", "web_search"
121+
]
122+
}
123+
}
124+
```
125+
126+
Keeps `shell` available for builds/tests but removes file-mutation, delegation,
127+
and network tools.
128+
129+
### Disable persistent memory
130+
131+
```json
132+
{
133+
"tools": {
134+
"disabled": ["memory"]
135+
}
136+
}
137+
```
138+
139+
The `memory` tool is also subject to filtering. If you use an `enabled`
140+
whitelist and want memory, include `"memory"` explicitly.
141+
142+
## Environment variables
143+
144+
```bash
145+
# Whitelist via env
146+
ODEK_TOOLS_ENABLED=web_search,vision odek run "compare these phones"
147+
148+
# Blacklist via env
149+
ODEK_TOOLS_DISABLED=shell,write_file,patch odek run "review this diff"
150+
```
151+
152+
## CLI flags
153+
154+
```bash
155+
odek run --tool web_search --tool vision --no-tool shell "find me a recipe"
156+
```
157+
158+
Flags override environment and file config. `--tool` sets the whitelist;
159+
`--no-tool` adds to the blacklist.
160+
161+
## Security note
162+
163+
`./odek.json` is treated as untrusted. It may add to `tools.disabled`, but any
164+
`tools.enabled` it sets is ignored. This prevents a malicious repository from
165+
widening the tool surface (for example, enabling `shell` in a shared project).
166+
167+
If `./odek.json` contains `tools.enabled`, odek prints a warning and uses the
168+
operator-controlled source instead.
169+
170+
## Tool names reference
171+
172+
Use these exact names in config, env vars, and CLI flags:
173+
174+
| Category | Names |
175+
|---|---|
176+
| Shell / execution | `shell`, `parallel_shell` |
177+
| Delegation | `delegate_tasks` |
178+
| Files | `read_file`, `write_file`, `patch`, `batch_read`, `batch_patch`, `glob`, `file_info` |
179+
| Search | `search_files`, `multi_grep`, `session_search` |
180+
| Data / transform | `math_eval`, `diff`, `count_lines`, `json_query`, `tree`, `checksum`, `sort`, `head_tail`, `base64`, `tr`, `word_count`, `http_batch` |
181+
| Media | `transcribe`, `vision` |
182+
| Network | `browser`, `web_search` |
183+
| Memory | `memory` |
184+
| Skills | `skill_load`, `skill_list`, `skill_save`, `skill_patch`, `skill_delete` |
185+
| Telegram | `send_message`, `clarify` |
186+
| MCP | `<server>__<tool_name>` |
187+
188+
Unknown names are silently ignored, so typos do not crash startup.
189+
190+
## Mode-specific required tools
191+
192+
Some odek modes preserve tools they need to function:
193+
194+
- **Telegram** always keeps `send_message` and `clarify` so the bot can respond
195+
and ask clarifications, even if you disable them.
196+
- Other modes respect the filter exactly as configured.
197+
198+
## Choosing between whitelist and blacklist
199+
200+
- Use **`enabled`** when you know exactly which tools the deployment needs.
201+
This is the safest default for limited-purpose agents.
202+
- Use **`disabled`** when you want the full agent but want to remove a few
203+
risky tools (for example, disable `shell` and `delegate_tasks` in an
204+
untrusted-input environment).
205+
206+
You can combine both: `enabled` narrows the set, then `disabled` removes
207+
specific tools from that narrowed set.

0 commit comments

Comments
 (0)