--- name: volt-load-testing description: Safely exercise and evaluate HTTP APIs with the Volt CLI, including authenticated requests, JSON bodies, staged load, machine-readable results, performance baselines, and before/after comparisons. Use when developing or reviewing an API and the user asks to load test, benchmark, measure latency or throughput, check behavior under concurrency, investigate performance regressions, or run Volt. --- # Volt Load Testing Use Volt's non-interactive `bench` command. Treat load generation as a potentially disruptive operation and keep every run authorized and bounded. ## Establish scope Before sending traffic: - Confirm that the user owns the target or is authorized to test it. - Prefer localhost, a preview environment, or a dedicated test environment. - Do not test production, shared infrastructure, or a third-party API without explicit approval and a traffic budget. - Determine whether the request mutates data. Use disposable data and verify that repeating it is safe. - Read route definitions, an OpenAPI document, tests, or an existing curl example to obtain the URL, uppercase method, headers, body, and expected successful statuses. - Use a user-provided service objective. If none exists, report a baseline without declaring it a pass or failure. Never paste, print, or commit a secret. Refer to a credential already supplied through an environment variable, such as `${API_TOKEN}`. ## Follow the staged workflow 1. Verify that `volt` is on `PATH` and inspect `volt bench -h`. 2. Verify one functional request with the service's tests or curl. Volt does not currently provide a CLI single-request preflight. 3. Run a five-request smoke test with one connection and `-rate 1`. 4. Inspect the JSON result before increasing traffic. 5. Run an unrecorded warm-up. 6. Run a representative, explicitly rate-limited baseline. 7. Increase load only when the user requested it and the prior stage remained healthy. 8. Save JSON evidence and report the workload with secrets redacted. Do not jump directly to unlimited traffic. Stop when failures rise unexpectedly or the target becomes unhealthy. ## Build commands Use the explicit subcommand and JSON output: ```bash volt bench \ -url http://127.0.0.1:8080/api/widgets \ -m POST \ -H "Authorization: Bearer ${API_TOKEN}" \ -H "Content-Type: application/json" \ -b "$(