docs: improve readability and remove internal technical details from user docs (#6725)
* docs: improve readability and remove internal technical details from user docs * docs: expand user-doc cleanup to remote instances, deployment, providers, MCP presets, my-tool, and add concept diagrams * docs: streamline root README and SECURITY guide for readability * docs: move Why nanobot before Start Here and highlight lightweight footprint and WebUI
This commit is contained in:
1 parent
2ca8b72eea
commit
607de63fb4
20 files changed
+1002
-2426
No files matched your search
+34
-183
@@ -1,202 +1,53 @@
|
||||
# My Tool
|
||||
|
||||
This page is for operators configuring the agent's runtime self-inspection tool. It describes what the agent can read or change at runtime, and what it saves. Scratchpad values survive across turns until the agent runtime restarts; they are shared by sessions using that runtime, not private per-session storage or durable preferences.
|
||||
The `my` tool lets nanobot inspect its own runtime state—such as which model, workspace, or iteration limit it is using—and optionally adjust safe runtime settings without editing `config.json`.
|
||||
|
||||
## Why You Need It
|
||||
## What It Lets the Agent Do
|
||||
|
||||
Normal tools let the agent operate on the outside world (read/write files, search code). But the agent knows nothing about itself — it doesn't know which model it's running on, which workspace it can access, or which runtime limits apply.
|
||||
|
||||
My tool fills this gap. With it, the agent can:
|
||||
|
||||
- **Inspect the current request**: What model am I using? Which project can I access? What is my per-turn iteration limit?
|
||||
- **Tune runtime settings**: Adjust the iteration limit or select a configured model preset for the session's next turn when writes are enabled.
|
||||
- **Keep temporary notes**: Store non-sensitive scratchpad values across turns, without relying on them surviving a restart.
|
||||
- **Self-inspection (on by default):** Answer questions like *"What model are you using?"*, *"Which project folder is active?"*, *"Is web search enabled?"*, or *"What is your iteration limit?"*.
|
||||
- **Runtime tuning (opt-in):** Switch the current session's model preset, raise or lower the per-turn iteration limit (`1`–`100`), or keep temporary scratchpad notes across turns.
|
||||
|
||||
## Configuration
|
||||
|
||||
Enabled by default (read-only mode). The agent can check its state but not set it.
|
||||
The `my` tool is enabled in **read-only** mode by default. To let the agent adjust allowed runtime settings, merge this into `~/.nanobot/config.json`:
|
||||
|
||||
```yaml
|
||||
tools:
|
||||
my:
|
||||
enable: true # default: true
|
||||
allow_set: false # default: false (read-only)
|
||||
```json
|
||||
{
|
||||
"tools": {
|
||||
"my": {
|
||||
"enable": true,
|
||||
"allowSet": false
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
To allow the agent to set its configuration (e.g. switch models, adjust parameters), set `tools.my.allow_set: true`.
|
||||
Set `"allowSet": true` to allow runtime adjustments.
|
||||
|
||||
Legacy `tools.myEnabled` / `tools.mySet` keys are auto-migrated on load, and rewritten in-place the next time `nanobot onboard` refreshes the config.
|
||||
## What Persists and What Resets
|
||||
|
||||
Most modifications are held in memory only. `model_preset` is the exception: it is stored in the current session so the selection survives a restart.
|
||||
| Change | Persists across turns? | Persists across gateway restart? |
|
||||
|---|---|---|
|
||||
| Switching `model_preset` | Yes (current session) | Yes (saved with the session) |
|
||||
| Adjusting `max_iterations` | Yes (in memory) | No (resets to `config.json`) |
|
||||
| Scratchpad notes | Yes (shared across turns in memory) | No (cleared on restart) |
|
||||
|
||||
---
|
||||
> [!NOTE]
|
||||
> The `my` tool **never** modifies `config.json` on disk. Do not store sensitive secrets or durable user preferences in scratchpad notes—use [Memory](./memory.md) for preferences that should last.
|
||||
|
||||
## check — Check "my" current state
|
||||
## Common Examples
|
||||
|
||||
Without a key, returns an overview of inspectable runtime settings. Example values:
|
||||
You do not need to call the tool manually—just ask nanobot in plain language:
|
||||
|
||||
```text
|
||||
my(action="check")
|
||||
# → max_iterations: 40
|
||||
# context_window_tokens: 200000
|
||||
# model: 'anthropic/claude-sonnet-4-6'
|
||||
# model_preset: 'deep'
|
||||
# workspace: PosixPath('/tmp/agent-workspace')
|
||||
# workspace_sandbox: {...}
|
||||
# provider_retry_mode: 'standard'
|
||||
# max_tool_result_chars: 16000
|
||||
# ...
|
||||
```
|
||||
- *"What model and workspace are you using right now?"*
|
||||
- *"Why didn't you search the web?"* (nanobot can check whether web search is enabled)
|
||||
- *"Switch this conversation to my `deep` preset."* (when `allowSet` is enabled)
|
||||
- *"Give yourself up to 80 iterations for this refactoring task."* (when `allowSet` is enabled)
|
||||
|
||||
With a key parameter, drill into a specific config:
|
||||
Note that `context_window_tokens` reports the configured window capacity, not live token usage. To see live context usage and per-round stats, use the [WebUI context indicator](./webui.md#activity-and-context-usage).
|
||||
|
||||
```text
|
||||
my(action="check", key="workspace_sandbox.workspace_root")
|
||||
# → Current project path
|
||||
## Safety Boundaries
|
||||
|
||||
my(action="check", key="model")
|
||||
# → What model I'm currently running on
|
||||
|
||||
my(action="check", key="web_config.enable")
|
||||
# → Whether web search is enabled
|
||||
```
|
||||
|
||||
### What you can do with it
|
||||
|
||||
| Scenario | How |
|
||||
|----------|-----|
|
||||
| "What model are you using?" | `check("model")` |
|
||||
| "Which model preset is active?" | `check("model_preset")` |
|
||||
| "What is the per-turn iteration limit?" | `check("max_iterations")` |
|
||||
| "What is the context-window capacity?" | `check("context_window_tokens")` — capacity, not current usage or remaining space |
|
||||
| "Which project is active?" | `check("workspace_sandbox.workspace_root")` |
|
||||
| "Is file access restricted to the project?" | `check("workspace_sandbox.restrict_to_workspace")` |
|
||||
| "Show inspectable runtime settings" | `check()` |
|
||||
|
||||
`workspace` is a legacy display of the agent workspace, not the current project or an access grant. Use `workspace_sandbox` for the active project and file restriction. `exec_config` separately reports shell sandbox settings; shell binds do not grant file tools access.
|
||||
|
||||
---
|
||||
|
||||
## set — Runtime tuning
|
||||
|
||||
Changes do not require a restart. `model_preset` is saved for the current session and applies to its next turn. Other writable settings are updated in memory; changing the iteration limit does not extend an already-running agent loop. Direct `model` and `context_window_tokens` writes are rejected during an active session because those setters change the shared instance default. Configure a named preset for model or context-window changes instead.
|
||||
|
||||
```text
|
||||
my(action="set", key="max_iterations", value=80)
|
||||
# → Bump iteration limit from 40 to 80
|
||||
|
||||
my(action="set", key="model_preset", value="fast")
|
||||
# → Use a configured model preset for this session's next turn
|
||||
```
|
||||
|
||||
You can also store temporary, non-sensitive state in your scratchpad. Values remain available across turns until the runtime restarts, and are shared by its sessions:
|
||||
|
||||
```text
|
||||
my(action="set", key="task_focus", value="documentation")
|
||||
my(action="set", key="response_style", value="concise")
|
||||
my(action="set", key="task_complexity", value="high")
|
||||
# → These notes survive across turns, but not a runtime restart
|
||||
```
|
||||
|
||||
### Protected parameters
|
||||
|
||||
These parameters have type and range validation — invalid values are rejected:
|
||||
|
||||
| Parameter | Type | Range | Purpose |
|
||||
|-----------|------|-------|---------|
|
||||
| `max_iterations` | int | 1–100 | Max model/tool iterations per agent run |
|
||||
| `context_window_tokens` | int | 4,096–1,000,000 | Instance default; during a session, select through a preset |
|
||||
| `model` | str | non-empty | Instance default; during a session, select through a preset |
|
||||
| `model_preset` | str | configured preset name | Current session's preset for its next turn |
|
||||
|
||||
`provider_retry_mode` and `max_tool_result_chars` must match their existing value types. Setting `workspace` changes only the legacy display string, not the active project, shell directory, or file permissions. Unknown top-level keys store JSON-safe scratchpad values rather than creating runtime settings. Nested configuration fields cannot be changed through `my`.
|
||||
|
||||
---
|
||||
|
||||
## Practical Scenarios
|
||||
|
||||
### "This task is complex, I need more room"
|
||||
|
||||
```text
|
||||
Agent: This codebase is large, let me switch this session to the configured deep preset.
|
||||
→ my(action="set", key="model_preset", value="deep")
|
||||
```
|
||||
|
||||
### "Simple question, don't waste compute"
|
||||
|
||||
```text
|
||||
Agent: This is a straightforward question, let me switch to the fast preset.
|
||||
→ my(action="set", key="model_preset", value="fast")
|
||||
```
|
||||
|
||||
### "Remember user preferences across turns"
|
||||
|
||||
```text
|
||||
Turn 1: my(action="set", key="user_prefers_concise", value=True)
|
||||
Turn 2: my(action="check", key="user_prefers_concise")
|
||||
# → True (still remembers the user likes concise replies)
|
||||
```
|
||||
|
||||
### "Self-diagnosis"
|
||||
|
||||
```text
|
||||
User: "Why aren't you searching the web?"
|
||||
Agent: Let me check my web config.
|
||||
→ my(action="check", key="web_config.enable")
|
||||
# → False
|
||||
Agent: Web search is disabled — please set tools.web.enable: true in your config.
|
||||
```
|
||||
|
||||
### "Context capacity"
|
||||
|
||||
```text
|
||||
Agent: Let me check the context-window capacity.
|
||||
→ my(action="check", key="context_window_tokens")
|
||||
# → context_window_tokens: 200000
|
||||
```
|
||||
|
||||
This is the configured capacity, not current occupancy, remaining space, or cumulative token usage. `my` does not expose `_last_usage`. For context and per-round usage, see the [WebUI activity and context indicators](./webui.md#activity-and-context-usage).
|
||||
|
||||
### "Subagent monitoring"
|
||||
|
||||
Use the separate `subagent` tool, not `my`. To list the current session's live tasks or inspect a known task ID:
|
||||
|
||||
```text
|
||||
subagent(action="check")
|
||||
subagent(action="check", task_id="<task-id>")
|
||||
```
|
||||
|
||||
Only tasks owned by the current session are accessible. A known task ID can retrieve retained results after completion; finished tasks leave the live list. Checks without a current session identity fail. Background results arrive automatically, so avoid repeated polling.
|
||||
|
||||
---
|
||||
|
||||
## Safety Mechanisms
|
||||
|
||||
Core design principle: **The tool does not rewrite `config.json`.** Instance-wide changes live in memory only, while `model_preset` persists only as the current session's selector.
|
||||
|
||||
### Off-limits (BLOCKED)
|
||||
|
||||
Cannot be checked or modified — fully hidden:
|
||||
|
||||
| Category | Attributes | Reason |
|
||||
|----------|-----------|--------|
|
||||
| Core infrastructure | `bus`, `provider`, `_running` | Changes would crash the system |
|
||||
| Tool registry | `tools` | Must not remove its own tools |
|
||||
| Subsystems | `runner`, `sessions`, `consolidator`, `subagents`, etc. | Use dedicated tools instead of inspecting internal managers |
|
||||
| Sensitive data | `_mcp_servers`, `_pending_queues`, etc. | Contains credentials and message routing |
|
||||
| Security boundaries | `restrict_to_workspace`, `channels_config` | Bypassing would violate isolation |
|
||||
| Python internals | `__class__`, `__dict__`, etc. | Prevents sandbox escape |
|
||||
|
||||
### Read-only (check only)
|
||||
|
||||
Can be checked but not set:
|
||||
|
||||
| Category | Attributes | Reason |
|
||||
|----------|-----------|--------|
|
||||
| Workspace access | `workspace_sandbox` | Shows the active project and file restriction; cannot change access |
|
||||
| Execution config | `exec_config` | Can check sandbox/enable status, cannot change it |
|
||||
| Web config | `web_config` | Can check enable status, cannot change it |
|
||||
|
||||
### Sensitive field protection
|
||||
|
||||
Sub-fields matching sensitive names (`api_key`, `password`, `secret`, `token`, etc.) are blocked from both check and set, regardless of parent path. This prevents credential leaks via dot-path traversal (e.g. `web_config.search.api_key`).
|
||||
- **Never accessible:** Secrets (`apiKey`, `token`, `password`, `secret`, etc.), internal system objects, and channel credentials are always hidden and blocked from both reading and writing.
|
||||
- **Read-only:** Workspace security restrictions, shell sandbox settings, and web configuration can be inspected for self-diagnosis, but the agent cannot weaken or modify them.
|
||||
- **Validated limits:** Writable settings like `max_iterations` (`1`–`100`) and `model_preset` (must be an existing configured preset) are strictly validated.
|
||||
Reference in new issue
Block a user