Skip to content
POST/api/v1/copilot/analyze

Copilot-style analysis on platform data

Analyzes results the CALLER supplies — it does not query platform data. Body: type (security | eval | contextual, required) plus the matching payload: findings[] (≤500, required for security and contextual) with optional passRate; cases[] (≤500, required for eval) with optional score; systemPrompt (≤100k) and deploymentContext {useCase, industry, userBase, dataClassification, region} for contextual. Optional model and orgId (orgId is only used for the org gate; API-key callers are pinned to their key's org). Returns { type, analysis }. Uses the platform OPENAI_API_KEY (COPILOT_LLM_MODEL, default gpt-4o-mini) when configured and falls back to rule-based analysis when it is not. requiredRole: editor, evals:read. Rate-limited to 20/min.

Authentication

Send Authorization: Bearer YOUR_API_KEY on every request. Generate API keys at /dashboard/settings/api-keys.

Request body required

Example

{
  "orgId": "00000000-0000-0000-0000-000000000000",
  "type": "security",
  "findings": [
    {
      "type": "string",
      "severity": "string",
      "title": "string",
      "description": "string",
      "passed": false,
      "pluginId": "string"
    }
  ],
  "cases": [
    {
      "input": "string",
      "score": 0,
      "passed": false,
      "scorerType": "string"
    }
  ],
  "passRate": 0,
  "score": 0,
  "model": "string",
  "systemPrompt": "string",
  "deploymentContext": {
    "useCase": "string",
    "industry": "string",
    "userBase": "string",
    "dataClassification": "string",
    "region": "string"
  }
}
Schema
{
  "application/json": {
    "schema": {
      "type": "object",
      "properties": {
        "orgId": {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        "type": {
          "type": "string",
          "enum": [
            "security",
            "eval",
            "contextual"
          ]
        },
        "findings": {
          "maxItems": 500,
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "maxLength": 120
              },
              "severity": {
                "type": "string",
                "maxLength": 60
              },
              "title": {
                "type": "string",
                "maxLength": 500
              },
              "description": {
                "type": "string",
                "maxLength": 20000
              },
              "passed": {
                "type": "boolean"
              },
              "pluginId": {
                "type": "string",
                "maxLength": 200
              }
            },
            "required": [
              "type",
              "severity",
              "title",
              "description",
              "passed"
            ],
            "additionalProperties": false
          }
        },
        "cases": {
          "maxItems": 500,
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "input": {
                "type": "string",
                "maxLength": 50000
              },
              "score": {
                "type": "number"
              },
              "passed": {
                "type": "boolean"
              },
              "scorerType": {
                "type": "string",
                "maxLength": 120
              }
            },
            "required": [
              "input",
              "score",
              "passed"
            ],
            "additionalProperties": false
          }
        },
        "passRate": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "score": {
          "type": "number"
        },
        "model": {
          "type": "string",
          "maxLength": 120
        },
        "systemPrompt": {
          "type": "string",
          "maxLength": 100000
        },
        "deploymentContext": {
          "type": "object",
          "properties": {
            "useCase": {
              "type": "string",
              "maxLength": 500
            },
            "industry": {
              "type": "string",
              "maxLength": 120
            },
            "userBase": {
              "type": "string",
              "maxLength": 500
            },
            "dataClassification": {
              "type": "string",
              "maxLength": 120
            },
            "region": {
              "type": "string",
              "maxLength": 120
            }
          },
          "additionalProperties": false
        }
      },
      "required": [
        "type"
      ],
      "additionalProperties": false
    }
  }
}

Response

200 example

{
  "success": true
}

All status codes

200Analysis with citations.
400(no description)
401(no description)
403Forbidden — the credential is valid but lacks the API-key scope, member role, or plan entitlement this operation requires.
429(no description)
500Internal Server Error — an unhandled error was converted to the standard error envelope (INTERNAL_ERROR).

Code samples

cURL

curl -X POST \
  https://evalguard.ai/api/v1/copilot/analyze \
  -H "Authorization: Bearer $EVALGUARD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "orgId": "00000000-0000-0000-0000-000000000000", "type": "security", "findings": [ { "type": "string", "severity": "string", "title": "string", "description": "string", "passed": false, "pluginId": "string" } ], "cases": [ { "input": "string", "score": 0, "passed": false, "scorerType": "string" } ], "passRate": 0, "score": 0, "model": "string", "systemPrompt": "string", "deploymentContext": { "useCase": "string", "industry": "string", "userBase": "string", "dataClassification": "string", "region": "string" } }'

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/copilot/analyze", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.EVALGUARD_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "orgId": "00000000-0000-0000-0000-000000000000",
    "type": "security",
    "findings": [
      {
        "type": "string",
        "severity": "string",
        "title": "string",
        "description": "string",
        "passed": false,
        "pluginId": "string"
      }
    ],
    "cases": [
      {
        "input": "string",
        "score": 0,
        "passed": false,
        "scorerType": "string"
      }
    ],
    "passRate": 0,
    "score": 0,
    "model": "string",
    "systemPrompt": "string",
    "deploymentContext": {
      "useCase": "string",
      "industry": "string",
      "userBase": "string",
      "dataClassification": "string",
      "region": "string"
    }
  }),
});
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']}"}
headers["Content-Type"] = "application/json"

response = requests.request(
    "POST",
    "https://evalguard.ai/api/v1/copilot/analyze",
    headers=headers,
    json={
    "orgId": "00000000-0000-0000-0000-000000000000",
    "type": "security",
    "findings": [
        {
            "type": "string",
            "severity": "string",
            "title": "string",
            "description": "string",
            "passed": False,
            "pluginId": "string"
        }
    ],
    "cases": [
        {
            "input": "string",
            "score": 0,
            "passed": False,
            "scorerType": "string"
        }
    ],
    "passRate": 0,
    "score": 0,
    "model": "string",
    "systemPrompt": "string",
    "deploymentContext": {
        "useCase": "string",
        "industry": "string",
        "userBase": "string",
        "dataClassification": "string",
        "region": "string"
    }
},
)
print(response.status_code, response.json())

Go

package main

import (
	"context"
	"fmt"
	"net/http"
	"os"
	"strings"
)

func main() {
	body := strings.NewReader(`{"orgId":"00000000-0000-0000-0000-000000000000","type":"security","findings":[{"type":"string","severity":"string","title":"string","description":"string","passed":false,"pluginId":"string"}],"cases":[{"input":"string","score":0,"passed":false,"scorerType":"string"}],"passRate":0,"score":0,"model":"string","systemPrompt":"string","deploymentContext":{"useCase":"string","industry":"string","userBase":"string","dataClassification":"string","region":"string"}}`)
	req, _ := http.NewRequestWithContext(context.Background(), "POST", "https://evalguard.ai/api/v1/copilot/analyze", body)
	req.Header.Set("Authorization", "Bearer "+os.Getenv("EVALGUARD_API_KEY"))
	req.Header.Set("Content-Type", "application/json")
	resp, err := http.DefaultClient.Do(req)
	if err != nil { panic(err) }
	defer resp.Body.Close()
	fmt.Println(resp.Status)
}

Errors

400401403429500

Other NL Pipeline endpoints