Brave Search integration enables agents to search the web and retrieve relevant results. The integration is stateless and requires only API key configuration.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/everruns/everruns/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Brave Search capability provides:- Web search - Search the web and get relevant results
- Pagination - Control result count and offset
- Time filters - Filter results by recency (past day, week, month, year)
- Stateless - No per-resource state management needed
Setup
Get API key
Sign up for Brave Search API at Brave Search API and get your API key.
Configure API key
Option 1: User Connection (recommended)Navigate to Settings > Connections > Brave Search and enter your API key.Option 2: Session SecretSet
BRAVE_SEARCH_API_KEY as a session secret:Web Search Tool
brave_web_search
Search the web using Brave Search API. Parameters:query(string, required) - Search querycount(integer, optional, 1-20, default: 10) - Number of resultsoffset(integer, optional) - Pagination offsetfreshness(string, optional) - Time filter:pd- Past daypw- Past weekpm- Past monthpy- Past year
Example Usage
- Basic Search
- Recent Results
- Pagination
API Key Resolution
The API key is resolved lazily at tool execution time:- User connections (preferred):
PUT /v1/user/connections/api-key/brave_search - Session secret (fallback):
BRAVE_SEARCH_API_KEY - Error: Guidance to configure in Settings > Connections
- Persistent across sessions
- User-scoped (not session-scoped)
- Encrypted at rest
- No need to set per-session
Security
API Key Storage
- User connections: Encrypted via envelope encryption (AES-256-GCM)
- Session secrets: Encrypted via envelope encryption
- Never exposed: API key never appears in tool results or message history
- HTTPS only: All API requests over HTTPS
Rate Limiting
Rate limiting is handled by the Brave Search API:- Returns
429on rate limit exceeded - Agents should handle rate limit errors gracefully
Error Handling
| Scenario | Result Type | Message |
|---|---|---|
Missing query parameter | ToolError | ”Missing required parameter: query” |
| API key not configured | ToolError | ”Brave Search API key not configured…” |
| HTTP 401 (Unauthorized) | ToolError | ”Brave Search API error (401): …” |
| HTTP 429 (Rate Limited) | ToolError | ”Brave Search API error (429): …” |
| No context | ToolError | ”brave_web_search requires context.” |
Connection Provider
Brave Search registers as a connection provider plugin: Provider details:- ID:
brave_search - Display Name: Brave Search
- Type: API Key
- Icon:
search
GET https://api.search.brave.com/res/v1/web/search?q=test endpoint.
Comparison with Other Capabilities
| Feature | Brave Search | Daytona | CodeSandbox |
|---|---|---|---|
| Stateless | Yes | No (per-sandbox state) | No (per-sandbox state) |
| Dependencies | None | session_storage | session_storage |
| API Key Storage | User connection or secret | User connection or secret | Session secret |
| External Service | Yes | Yes | Yes |
Threat Model
Search results returned as tool results can contain adversarial content:- TM-LLM-008: Search result prompt injection (accepted risk)
- Results use
tool_resultrole, notsystem - Inherent LLM limitation (same as TM-TOOL-005)
Design Decisions
API Key in User Connections (Not Just Session Secrets)
User connections are persistent across sessions and user-scoped. Session secrets are per-session and lost when the session ends. User connections are the preferred storage for long-lived API keys.Stateless (No Per-Resource State)
Unlike Daytona (which manages sandbox lifecycle), Brave Search is stateless. Each search is independent. No sandbox state, no session state beyond the API key.No Dependencies
Unlike Daytona (which depends onsession_storage), Brave Search has no capability dependencies. The API key resolution uses the connection resolver and storage store from ToolContext directly.
Testing
Brave Search includes comprehensive test coverage: Unit tests:wiremock for HTTP-level assertions (auth headers, query params, error codes).
Integration tests (real API):
smoke_basic_search, smoke_freshness_filter, smoke_pagination.
Tests gracefully skip when BRAVE_SEARCH_API_KEY is not set.
Next Steps
- Create agents - Build agents with web search
- User connections - Configure API key
- Tool execution - How tools are executed