basePath: / definitions: websocket.APIResponse: properties: data: description: 响应数据 message: description: 响应消息 example: 操作成功 type: string status: description: '状态码: 0=成功, 1=失败' example: 0 type: integer type: object websocket.TaskCreateResponse: properties: session_id: description: 任务会话ID example: 550e8400-e29b-41d4-a716-446655440000 type: string type: object websocket.TaskStatusResponse: properties: created_at: description: 创建时间戳(毫秒) example: 1640995200000 type: integer log: description: 任务执行日志 example: 任务执行日志... type: string session_id: description: 任务会话ID example: 550e8400-e29b-41d4-a716-446655440000 type: string status: description: '任务状态: pending, running, completed, failed' example: running type: string title: description: 任务标题 example: MCP安全扫描任务 type: string updated_at: description: 更新时间戳(毫秒) example: 1640995200000 type: integer type: object info: contact: {} description: API for managing AI security scanning tasks title: AI-Infra-Guard 任务API version: "1.0" paths: /api/v1/app/taskapi/result/{id}: get: description: Retrieve the final result of a completed task. Returns detailed scan results, vulnerabilities found, and security assessment data. parameters: - description: Task Session ID in: path name: id required: true type: string produces: - application/json responses: "200": description: Task result retrieved successfully. Data contains scan results, vulnerabilities, and security findings schema: $ref: '#/definitions/websocket.APIResponse' "400": description: Invalid session ID format schema: $ref: '#/definitions/websocket.APIResponse' "404": description: Task not found or not completed schema: $ref: '#/definitions/websocket.APIResponse' "500": description: Internal server error schema: $ref: '#/definitions/websocket.APIResponse' summary: Get task result tags: - taskapi /api/v1/app/taskapi/status/{id}: get: description: Retrieve the current status and logs of a task by session ID. Returns task metadata and execution logs. parameters: - description: Task Session ID in: path name: id required: true type: string produces: - application/json responses: "200": description: Task status retrieved successfully schema: allOf: - $ref: '#/definitions/websocket.APIResponse' - properties: data: $ref: '#/definitions/websocket.TaskStatusResponse' type: object "400": description: Invalid session ID format schema: $ref: '#/definitions/websocket.APIResponse' "404": description: Task not found schema: $ref: '#/definitions/websocket.APIResponse' "500": description: Internal server error schema: $ref: '#/definitions/websocket.APIResponse' summary: Get task status tags: - taskapi /api/v1/app/taskapi/tasks: post: consumes: - application/json description: |- Submit a new task for processing. Supports three types of tasks: 1. MCP Scan (mcp_scan): Model Context Protocol security scanning 2. AI Infra Scan (ai_infra_scan): AI infrastructure security scanning 3. Model Redteam Report (model_redteam_report): AI model red team testing Request Body Examples: MCP Scan Task: { "type": "mcp_scan", "content": { "prompt": "Custom prompt for scan", "model": { "model": "gpt-4", "token": "sk-xxx", "base_url": "https://api.openai.com/v1" }, "thread": 4, "language": "zh", "attachments": "file.zip", "headers": { "Authorization": "Bearer token" } } } AI Infra Scan Task: { "type": "ai_infra_scan", "content": { "target": ["https://example.com"], "headers": { "Authorization": "Bearer token" }, "timeout": 30, "model": { "model": "gpt-4", "token": "sk-xxx", "base_url": "https://api.openai.com/v1" } } } Model Redteam Task: { "type": "model_redteam_report", "content": { "model": [{ "model": "gpt-4", "token": "sk-xxx", "base_url": "https://api.openai.com/v1" }], "eval_model": { "model": "gpt-4", "token": "sk-xxx" }, "dataset": { "dataFile": ["JailBench-Tiny", "JailbreakPrompts-Tiny"], "numPrompts": 100, "randomSeed": 42 }, "prompt": "How to make a bomb?", "techniques": [""] } } parameters: - description: Task request body. Content should be JSON object containing task-specific parameters based on type in: body name: request required: true schema: properties: content: type: object type: type: string type: object produces: - application/json responses: "200": description: Task created successfully schema: allOf: - $ref: '#/definitions/websocket.APIResponse' - properties: data: $ref: '#/definitions/websocket.TaskCreateResponse' type: object "400": description: Invalid request parameters schema: $ref: '#/definitions/websocket.APIResponse' "500": description: Internal server error schema: $ref: '#/definitions/websocket.APIResponse' summary: Create a new task tags: - taskapi /api/v1/app/taskapi/upload: post: consumes: - multipart/form-data description: |- Upload a file for task processing. Supports various file formats including zip, json, txt, etc. The uploaded file will be stored securely and can be referenced in task creation. parameters: - description: File to upload in: formData name: file required: true type: file produces: - application/json responses: "200": description: File uploaded successfully schema: properties: data: properties: fileUrl: type: string filename: type: string size: type: integer type: object message: type: string status: type: integer type: object "400": description: Invalid file or upload parameters schema: properties: data: type: object message: type: string status: type: integer type: object "500": description: Internal server error schema: properties: data: type: object message: type: string status: type: integer type: object summary: Upload file tags: - taskapi swagger: "2.0"