2026-07-08 15:23:34 +08:00
# How to Configure Web Search for a nanobot AI Agent
2026-10-10 11:48:50 +08:00
nanobot includes built-in web search and web fetch tools. Search uses DuckDuckGo by default and can be configured for API-backed or self-hosted providers.
2026-07-08 15:23:34 +08:00
## What you will build
- web tools enabled in nanobot
2026-07-14 13:59:47 +08:00
- one search provider selected in the WebUI or `config.json`
2026-07-08 15:23:34 +08:00
- optional web fetch settings for page reading
## When to use this
2026-10-10 11:48:50 +08:00
Configure web search when the agent needs current information, public web research, source discovery, or page fetching during a task.
2026-07-08 15:23:34 +08:00
## Install
```bash
python -m pip install nanobot-ai
nanobot onboard --wizard
nanobot agent -m "Hello!"
```
2026-10-10 11:48:50 +08:00
Web tools are enabled by default. Configure them only when you want a specific provider, API key, proxy, fetch behavior, or SSRF allowlist.
2026-07-08 15:23:34 +08:00
## Minimal working example
2026-07-14 13:59:47 +08:00
For local interactive setup:
1. Run `nanobot webui` .
2. Open **Settings → Web** .
3. Enable web search, choose a provider, and enter its API key if required.
4. Save and restart when prompted.
5. Ask a question that requires current information and inspect the cited sources.
For manual or deployment-managed config, use the default search provider:
2026-07-08 15:23:34 +08:00
```json
{
"tools" : {
"web" : {
"enable" : true ,
"search" : {
"provider" : "duckduckgo"
}
}
}
}
```
Or use an API-backed provider:
```json
{
"tools" : {
"web" : {
"search" : {
"provider" : "brave" ,
"apiKey" : "${BRAVE_API_KEY}"
}
}
}
}
```
2026-10-10 11:48:50 +08:00
Ask a question that requires current information and inspect the tool activity in the WebUI or logs.
2026-07-08 15:23:34 +08:00
## Production notes
- Keep API keys in environment variables.
- Set `maxResults` when you need fewer or more search results per query.
- Set `tools.web.proxy` only to a proxy you trust.
- Use `fetch.useJinaReader: false` if you need local page conversion.
## Security notes
- Web fetch and HTTP MCP share an SSRF guard.
2026-10-10 11:48:50 +08:00
- Private, loopback, link-local, and cloud metadata addresses are blocked by default.
- With `useJinaReader` enabled (the default), fetched URLs are disclosed to the remote reader service. Credential-bearing URLs (userinfo or token/signature query parameters) are fetched locally instead; path-embedded secrets cannot be detected, so disable the remote reader when URLs must stay local.
2026-07-08 15:23:34 +08:00
- Add `tools.ssrfWhitelist` only for narrow trusted CIDRs.
2026-10-10 11:48:50 +08:00
- Do not give public chat users unrestricted web and shell access without review.
2026-07-08 15:23:34 +08:00
## Troubleshooting
- If search returns no results, switch provider or check the provider API key.
- If fetch is blocked, inspect the target URL and SSRF whitelist.
- If a proxy changes network behavior, verify `NO_PROXY` and proxy settings.
## Related nanobot docs
- [Configuration: Web Tools ](../configuration.md#web-tools )
- [Security ](../configuration.md#security )
- [WebUI ](../webui.md )