Documentation / Concepts
Tools and providers
How a tool call is checked and executed, and how Seshat talks to many model providers through one interface.
Two things sit on each side of the loop: tools are what the agent can do, providers are the models that decide.
Tools
Tools cover the work an agent needs to do on a machine and on the web: files (read, edit, write, glob, grep), shell, web fetch and search, tasks, worktrees, language servers, notebooks, memory, knowledge search, sub-agents, and everything an MCP server adds. Their exact list depends on your configuration, so ask the runtime rather than a document: client.ToolNames() in the SDK.
The pipeline of one call
- The tool is looked up in the registry and must be enabled.
- Its input is validated and completed.
- Pre-tool hooks run and can change the call or block it.
- A safety check looks for dangerous patterns and can refuse. No permission mode turns it off.
- The permission pipeline decides: allow, deny or ask.
- The tool runs.
- Post-tool hooks run, the result is formatted for the model and cut to its size limit.
Calls that declare themselves concurrency-safe run together; the others run one after another, in order.
The permission pipeline
| Step | What it checks |
|---|---|
| 1. Deny and ask rules for the tool | Explicit rules on the whole tool |
| 2. The tool’s own check | Path patterns for file tools, command patterns for the shell |
| 3. The permission engine | Deny rules first, then allow rules, then ask rules. Read-only tools are allowed. Then the mode decides |
| 4. The mode | bypass allows unless a rule objects, never turns every question into a refusal, auto asks a classifier (with no classifier configured, it asks you, or refuses when nobody can answer), onRequest asks the user |
If a classifier refuses too often in auto mode, Seshat steps back to asking you, and in a headless run it refuses instead of waiting for someone who is not there. The exact order of the questions is drawn in Security and trust, and the modes are listed in Using the CLI.
Add your own
Implement the Tool interface and register it. See Tools. To add tools without writing Go, connect an MCP server: Skills and MCP.
Providers
A provider runs a model. Seshat hides their differences behind one interface, so the loop never cares which one it is talking to. Each provider has an adapter for its wire format, and most OpenAI-compatible gateways reuse an existing adapter. The supported providers are listed in Configuration.
When a call fails
| Layer | Behaviour |
|---|---|
| Retry | Within one provider, rate limits, network errors and overloads are retried with exponential backoff and jitter. Authentication and client errors are not |
| Circuit breaker | Optional. After repeated failures a provider is skipped for a while, then probed again |
| Fallback models | Configured. Cheaper or alternative models of the same provider are tried first |
| Fallback providers | Opt-in. Another vendor is tried only if you list it, before giving up |
Updated on 2026-10-12