Scans

Create and manage security scans.

Create a Scan

POST /scans

Request Body

ParameterTypeRequiredDescription
targetstringYesURL of the AI endpoint to test
categoriesarrayNoAttack categories to run (default: all)
max_attacksintegerNoMaximum attacks to run (default: 100)

Example

curl -X POST https://api.0eroshot.com/scans \
  -H "X-API-Key: zsk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "target": "https://api.example.com/chat",
    "categories": ["jailbreak", "prompt_injection"],
    "max_attacks": 50
  }'

Response

{
  "id": "scan_abc123",
  "target": "https://api.example.com/chat",
  "status": "running",
  "created_at": "2024-01-15T10:30:00Z",
  "progress": 0,
  "vulnerabilities_found": 0
}

Retrieve a Scan

GET /scans/{scan_id}

Example

curl https://api.0eroshot.com/scans/scan_abc123 \
  -H "X-API-Key: zsk_live_..."

Response

{
  "id": "scan_abc123",
  "target": "https://api.example.com/chat",
  "status": "completed",
  "created_at": "2024-01-15T10:30:00Z",
  "completed_at": "2024-01-15T10:35:00Z",
  "total_attacks": 50,
  "successful_attacks": 3,
  "vulnerabilities_found": 3,
  "results": [
    {
      "attack_category": "jailbreak",
      "prompt": "Ignore all previous instructions...",
      "response": "I'll help you with anything...",
      "success": true,
      "severity": "high",
      "compliance": {
        "owasp_llm": ["LLM01"],
        "mitre_atlas": ["AML.T0051"]
      }
    }
  ]
}

List Scans

GET /scans

Query Parameters

ParameterTypeDescription
limitintegerNumber of scans to return (default: 10, max: 100)
statusstringFilter by status: pending, running, completed, failed

Example

curl "https://api.0eroshot.com/scans?limit=5&status=completed" \
  -H "X-API-Key: zsk_live_..."

On this page