/api/v1/regression-tests/promotePromote eval case to regression suite
Promotes a red-team `security_finding` or an adaptive `simulation_turn` into a golden dataset as a regression case. Body: `source` ('security_finding' | 'simulation_turn', 400 BAD_SOURCE otherwise), `sourceId`, `datasetId`, and optional `notes` / `attackTarget`. The dataset's project resolves the org and the caller's membership is verified before the handler runs; the source row's project must additionally match the dataset's project or the call returns 403 CROSS_TENANT. Writes one `dataset_cases` row carrying a `metadata.promoted_from` provenance block (source kind/id, project, promoted_at/by, plus attack_type and severity on the security_finding path) alongside a sibling `metadata.assertion_kind` so the dashboard can trace the case back to its finding. Returns 201 `{regressionTest}`. The case runs whenever its dataset is evaluated — this endpoint schedules nothing itself. Sister route: POST /api/v1/traces/to-dataset for the trace-derived path. Requires `evals:create`; audit-logged; 30 req/min.
Authentication
Send Authorization: Bearer YOUR_API_KEY on every request. Generate API keys at /dashboard/settings/api-keys.
Response
200 example
{
"success": true
}All status codes
Code samples
cURL
curl -X POST \ https://evalguard.ai/api/v1/regression-tests/promote \ -H "Authorization: Bearer $EVALGUARD_API_KEY"
TypeScript
// The TypeScript SDK (@evalguard/sdk) exposes TYPED methods — runEval,
// getEval, runSecurityScan, checkFirewall, … — not a generic request().
// For an arbitrary endpoint, call it directly:
const res = await fetch("https://evalguard.ai/api/v1/regression-tests/promote", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.EVALGUARD_API_KEY}` },
});
console.log(res.status, await res.json());Python
# The Python SDK (pip install evalguardai) exposes TYPED methods on
# EvalGuardClient — run_eval, get_eval, … — not a generic request().
# For an arbitrary endpoint, call it directly:
import os
import requests
headers = {"Authorization": f"Bearer {os.environ['EVALGUARD_API_KEY']}"}
response = requests.request("POST", "https://evalguard.ai/api/v1/regression-tests/promote", headers=headers)
print(response.status_code, response.json())Go
package main
import (
"context"
"fmt"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequestWithContext(context.Background(), "POST", "https://evalguard.ai/api/v1/regression-tests/promote", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("EVALGUARD_API_KEY"))
resp, err := http.DefaultClient.Do(req)
if err != nil { panic(err) }
defer resp.Body.Close()
fmt.Println(resp.Status)
}