Skip to content
POST/api/v1/demo-scan

Run a demo security scan

Runs a canned demo security scan: 15 built-in attack payloads across 5 plugins (prompt-injection, jailbreak, pii-leak, system-prompt-leak, xss) are graded against hardcoded model responses — no target is contacted and no LLM call is made. Requires an authenticated session cookie (this route does not accept `eg_` API keys) and is rate-limited to 5 scans/minute per user. A projectId is resolved from the body, `?projectId`, or `/api/v1/project/current`; the caller must be a member of that project's org (403 otherwise). The scan writes a REAL `security_scans` row (model='demo-simulated') plus `security_findings`, and consumes one red-team scan unit from the org's monthly plan allowance. Returns { success, scanResult, message }.

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

200Demo result.
400Bad Request — NO_PROJECT.
401Unauthorized.
403Forbidden — FORBIDDEN.
404Not Found — PROJECT_NOT_FOUND.
429Too Many Requests — RATE_LIMIT_EXCEEDED.
500Internal Server Error.

Code samples

cURL

curl -X POST \
  https://evalguard.ai/api/v1/demo-scan \
  -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/demo-scan", {
  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/demo-scan", 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/demo-scan", 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)
}

Errors

400401403404429500

Other Security endpoints