Skip to main content
Fishnet is configured through a fishnet.toml file located at /var/lib/fishnet/fishnet.toml (Linux) or /Library/Application Support/Fishnet/fishnet.toml (macOS). You can override this location with the FISHNET_CONFIG environment variable.

Configuration File Location

Fishnet searches for configuration in the following order:
  1. Path specified via --config CLI flag
  2. Path in FISHNET_CONFIG environment variable
  3. System data directory (/var/lib/fishnet/fishnet.toml or /Library/Application Support/Fishnet/fishnet.toml)
  4. Legacy home directory (~/.fishnet/fishnet.toml)
If no configuration file is found, Fishnet uses built-in defaults.

LLM Configuration

Configure AI model guardrails, spend tracking, and rate limiting.

Basic Settings

llm.track_spend
boolean
default:"true"
Enable automatic cost tracking for LLM API requests
llm.daily_budget_usd
float
default:"20.0"
Daily spending limit in USD for all LLM providers combined (OpenAI + Anthropic)
llm.budget_warning_pct
integer
default:"80"
Percentage of daily budget that triggers a warning alert (0-100)
llm.rate_limit_per_minute
integer
default:"60"
Maximum LLM requests per minute per provider. Set to 0 to disable.
llm.allowed_models
array[string]
default:"[]"
Whitelist of allowed model names. Empty array allows all models. Case-insensitive matching.
[llm]
allowed_models = ["gpt-4o", "gpt-4o-mini", "claude-sonnet"]

Model Pricing

Define per-token costs for accurate spend tracking. Fishnet includes defaults for common models.
llm.model_pricing
map[string, ModelPricing]
Map of model names to pricing information. Keys are trimmed and normalized.Default pricing included:
  • gpt-4o: 2.50/2.50 / 10.00 per million tokens (input/output)
  • gpt-4o-mini: 0.15/0.15 / 0.60 per million tokens
  • claude-sonnet: 3.00/3.00 / 15.00 per million tokens
[llm.model_pricing.gpt-4o]
input_per_million_usd = 2.50
output_per_million_usd = 10.0

[llm.model_pricing."claude-sonnet"]
input_per_million_usd = 3.0
output_per_million_usd = 15.0
llm.model_pricing.<model>.input_per_million_usd
float
required
Cost per million input tokens in USD. Must be non-negative.
llm.model_pricing.<model>.output_per_million_usd
float
required
Cost per million output tokens in USD. Must be non-negative.

Prompt Drift Detection

Detect when system prompts change unexpectedly.
llm.prompt_drift.enabled
boolean
default:"true"
Enable prompt drift detection
llm.prompt_drift.mode
enum
default:"alert"
Action to take when drift is detected:
  • alert: Log alert and allow request
  • deny: Reject the request
  • ignore: Disable drift checking
llm.prompt_drift.hash_chars
integer
default:"0"
Number of characters from start of prompt to hash. 0 means hash entire prompt.
llm.prompt_drift.hash_algorithm
enum
default:"keccak256"
Hash algorithm for prompt fingerprinting. Currently only keccak256 is supported.
llm.prompt_drift.ignore_whitespace
boolean
default:"true"
Normalize whitespace before hashing to reduce false positives
llm.prompt_drift.reset_baseline_on_restart
boolean
default:"true"
Clear baseline prompt hashes when Fishnet restarts

Prompt Size Guard

Prevent excessively large prompts that could cause runaway costs.
llm.prompt_size_guard.enabled
boolean
default:"true"
Enable prompt size enforcement
llm.prompt_size_guard.max_prompt_tokens
integer
default:"50000"
Maximum allowed tokens in a prompt. Estimated at 4 characters per token.
llm.prompt_size_guard.max_prompt_chars
integer
default:"0"
Maximum allowed characters in a prompt. 0 means no character limit (only token limit applies).
llm.prompt_size_guard.action
enum
default:"deny"
Action when prompt exceeds size limits:
  • deny: Reject the request
  • alert: Log alert and allow request

HTTP Client Configuration

Configure connection pooling and timeouts for upstream API requests.
http.connect_timeout_ms
integer
default:"5000"
Connection timeout in milliseconds. Minimum 1ms, defaults to 5000 if set to 0.
http.request_timeout_ms
integer
default:"0"
Total request timeout in milliseconds. 0 disables timeout (recommended for streaming).
http.pool_idle_timeout_secs
integer
default:"90"
How long to keep idle connections in the pool before closing them
http.pool_max_idle_per_host
integer
default:"16"
Global default for maximum idle connections per upstream host
http.upstream_pool_max_idle_per_host
map[string, integer]
Per-upstream connection pool size overrides. Keys can be:
  • openai
  • anthropic
  • binance
  • custom.<name> (e.g., custom.github)
[http.upstream_pool_max_idle_per_host]
openai = 32
anthropic = 24
binance = 12
"custom.github" = 8

Dashboard Configuration

dashboard.spend_history_days
integer
default:"30"
Number of days of spend history to display in the dashboard

Alert Configuration

Control which events trigger alerts and how long they’re retained.
alerts.prompt_drift
boolean
default:"true"
Alert when prompt drift is detected
alerts.prompt_size
boolean
default:"true"
Alert when prompts exceed size limits
alerts.budget_warning
boolean
default:"true"
Alert when reaching budget warning threshold
alerts.budget_exceeded
boolean
default:"true"
Alert when daily budget is exceeded
alerts.onchain_denied
boolean
default:"true"
Alert when on-chain transactions are denied
alerts.rate_limit_hit
boolean
default:"true"
Alert when rate limits are triggered
alerts.anomalous_volume
boolean
default:"true"
Alert on unusual request volume spikes
alerts.new_endpoint
boolean
default:"true"
Alert when a new API endpoint is accessed for the first time
alerts.time_anomaly
boolean
default:"true"
Alert on requests at unusual times
alerts.high_severity_denied_action
boolean
default:"true"
Alert when high-severity actions (withdrawals, destructive operations) are blocked
alerts.retention_days
integer
default:"30"
Number of days to retain alert records in the database

Binance Configuration

See Binance Configuration for detailed documentation.
binance.enabled
boolean
default:"false"
Enable the Binance trading proxy
binance.base_url
string
default:"https://api.binance.com"
Binance API base URL. Can be changed for testnet.
binance.max_order_value_usd
float
default:"500.0"
Maximum USD value per order
binance.daily_volume_cap_usd
float
default:"2500.0"
Daily trading volume limit in USD
binance.allow_delete_open_orders
boolean
default:"false"
Allow DELETE /api/v3/openOrders (cancels all open orders). Blocked by default.
binance.recv_window_ms
integer
default:"5000"
Binance recvWindow parameter for request validity. Must be ≤ 60000ms.

Custom Services Configuration

See Custom Services for detailed documentation.
custom.<name>
object
Define custom API proxies. <name> can be any identifier (e.g., github, stripe).
[custom.github]
base_url = "https://api.github.com"
auth_header = "Authorization"
auth_value_prefix = "Bearer "
auth_value_env = "GITHUB_TOKEN"
blocked_endpoints = ["DELETE /repos/**"]
rate_limit = 100
rate_limit_window_seconds = 3600

On-Chain Configuration

Configure transaction limits and smart contract permissions.
onchain.enabled
boolean
default:"false"
Enable on-chain transaction proxying and policy enforcement
onchain.chain_ids
array[integer]
Allowed blockchain chain IDs (e.g., [1, 137, 42161] for Ethereum, Polygon, Arbitrum)
onchain.limits.max_tx_value_usd
float
default:"100.0"
Maximum USD value per transaction
onchain.limits.daily_spend_cap_usd
float
default:"500.0"
Daily spending limit in USD for on-chain transactions
onchain.limits.cooldown_seconds
integer
default:"30"
Minimum seconds between transactions
onchain.limits.max_slippage_bps
integer
default:"50"
Maximum allowed slippage in basis points (50 = 0.5%)
onchain.limits.max_leverage
integer
default:"5"
Maximum leverage multiplier for leveraged positions
onchain.permits.expiry_seconds
integer
default:"300"
How long signed permits remain valid (5 minutes default)
onchain.permits.require_policy_hash
boolean
default:"true"
Require permit signatures to include policy version hash
onchain.permits.verifying_contract
string
Address of the permit verifying contract
onchain.whitelist
map[string, array[string]]
Whitelisted addresses per chain ID
[onchain.whitelist]
"1" = ["0x1234...", "0x5678..."]
"137" = ["0xabcd..."]

Example Configuration

# LLM spend tracking and rate limiting
[llm]
track_spend = true
daily_budget_usd = 50.0
budget_warning_pct = 80
rate_limit_per_minute = 100
allowed_models = ["gpt-4o", "claude-sonnet"]

[llm.prompt_drift]
enabled = true
mode = "alert"
ignore_whitespace = true

[llm.prompt_size_guard]
enabled = true
max_prompt_tokens = 50000
action = "deny"

[llm.model_pricing.gpt-4o]
input_per_million_usd = 2.50
output_per_million_usd = 10.0

# HTTP client configuration
[http]
connect_timeout_ms = 5000
request_timeout_ms = 0
pool_idle_timeout_secs = 90
pool_max_idle_per_host = 16

[http.upstream_pool_max_idle_per_host]
openai = 32
anthropic = 24

# Binance trading limits
[binance]
enabled = true
base_url = "https://api.binance.com"
max_order_value_usd = 100.0
daily_volume_cap_usd = 200.0
allow_delete_open_orders = false
recv_window_ms = 5000

# Custom GitHub proxy
[custom.github]
base_url = "https://api.github.com"
auth_header = "Authorization"
auth_value_prefix = "Bearer "
auth_value_env = "GITHUB_TOKEN"
blocked_endpoints = [
  "DELETE /repos/**",
  "DELETE /orgs/**",
]
rate_limit = 100
rate_limit_window_seconds = 3600

# Alerts
[alerts]
prompt_drift = true
budget_warning = true
budget_exceeded = true
rate_limit_hit = true
retention_days = 30

# Dashboard
[dashboard]
spend_history_days = 60

Build docs developers (and LLMs) love