Configure Fuze via fuze.toml in your project root, programmatically with configure(), or skip both, every setting has a sensible default.
[defaults]
max_retries = 3
timeout = "30s"
max_cost_per_step = 1.00
max_cost_per_run = 10.00
max_iterations = 25
on_loop = "kill"
trace_output = "./fuze-traces.jsonl"
[loop_detection]
window_size = 5
repeat_threshold = 3
max_flat_steps = 4
cost_velocity_window = 60
cost_velocity_threshold = 1.0
[cloud]
api_key = ""
endpoint = ""
[project]
project_id = "default"
[daemon]
enabled = false
socket_path = "/tmp/fuze-daemon.sock"
api_port = 7821
[daemon.budget]
org_daily_budget = 100.00
per_agent_daily_budget = 20.00
alert_threshold = 0.80
[daemon.alerts]
dedup_window_ms = 60000
webhook_urls = []
[providers]
[compliance]
enabled = false
risk_level = "minimal"
log_pii = false
Use configure() as an alternative to fuze.toml. Call it before any guard() or createRun() calls:
import { configure } from 'fuze-ai'
configure({
cloud: { apiKey: process.env.FUZE_API_KEY },
project: { projectId: 'my-agent' },
defaults: { maxCostPerRun: 5.00, maxIterations: 50 },
})
Values set via configure() override fuze.toml. Per-function guard options override both.
Settings are merged in this order (last wins):
- Built-in defaults, sensible values for all options
fuze.toml, project-level configuration
configure(), programmatic override
- Dashboard tool config, per-tool overrides fetched from the Fuze cloud (see Tools)
- Per-function options,
guard(fn, { maxCost: 0.50 }) has highest precedence
| Key | Type | Default | Description |
|---|
max_retries | number | 3 | Maximum retry attempts |
timeout | string | "30s" | Per-call timeout |
max_cost_per_step | number | 1.00 | USD ceiling per call |
max_cost_per_run | number | 10.00 | USD ceiling per run |
max_iterations | number | 25 | Hard iteration cap |
on_loop | string | "kill" | Behavior on loop detection: "kill", "warn", or "skip" |
trace_output | string | "./fuze-traces.jsonl" | File path for local trace output |
Controls how Fuze detects repetitive agent behavior.
| Key | Type | Default | Description |
|---|
window_size | number | 5 | Number of recent outputs to compare |
repeat_threshold | number | 3 | Consecutive identical outputs before triggering |
max_flat_steps | number | 4 | Max steps with no cost change before flagging |
cost_velocity_window | number | 60 | Window in seconds for cost velocity check |
cost_velocity_threshold | number | 1.0 | USD/min threshold that triggers an alert |
Connects the SDK to Fuze Cloud for remote configuration and telemetry. Leave unset for free in-process-only mode.
| Key | Type | Default | Description |
|---|
api_key | string | "" | API key from app.fuze-ai.tech. Can also be set via FUZE_API_KEY env var |
endpoint | string | "https://api.fuze-ai.tech" | Cloud API endpoint. Override only for self-hosted deployments |
| Key | Type | Default | Description |
|---|
project_id | string | "default" | Project identifier shown in the dashboard. Can also be set via FUZE_PROJECT_ID env var |
Self-hosted only. Connects the SDK to a locally-running Fuze daemon for cross-process budget enforcement and audit logging without sending data to the cloud.
| Key | Type | Default | Description |
|---|
enabled | boolean | false | Enable daemon connection |
socket_path | string | platform default | UDS socket path (Unix) or named pipe (Windows) |
api_port | number | 7821 | HTTP API port for the daemon |
| Key | Type | Default | Description |
|---|
org_daily_budget | number | 100.00 | Organization-wide daily spend ceiling (USD) |
per_agent_daily_budget | number | 20.00 | Per-agent daily spend ceiling (USD) |
alert_threshold | number | 0.80 | Alert at this fraction of the ceiling |
| Key | Type | Default | Description |
|---|
dedup_window_ms | number | 60000 | Suppress duplicate alerts within this window (ms) |
webhook_urls | array | [] | List of webhook URLs for alert delivery |
| Key | Type | Default | Description |
|---|
enabled | boolean | false | Enable compliance features |
risk_level | string | "minimal" | AI system risk classification |
log_pii | boolean | false | Store raw args/results (GDPR warning) |