v1

latestOpenAPI 3.0.32026-07-26233989.2 KB
Agent Analysis

Start Agent Scan

Initiates an AI-powered agent analysis for a repository. The agent uses LLM-based code exploration to perform deep security threat hunting, bug finding, or custom analysis based on user-provided instructions. Files are filtered by extension, size (≤400KB), and line count (≤5000 lines), with a maximum of 500 files per scan.

post/api/agents/scan/start

Request body

service'github' | 'gitlab' | 'azuredevops' | 'bitbucket' required

Version control service provider

repostring required

Repository identifier (format varies by service)

accessTokenstring required

OAuth or personal access token for the VCS service

branchstring required

Git branch to analyze

instructionPromptstring required

Analysis type. Use threat_hunting for security threat detection.

commitIdstring

Specific commit SHA to analyze. If omitted, the latest commit on the branch is used.

includeFilesstring

Comma-separated glob patterns for files to include in analysis

excludeFilesstring

Comma-separated glob patterns for files to exclude from analysis

azureDevopsBaseUrlstring

Base URL for Azure DevOps (for self-hosted instances)

gitlab_base_urlstring

Base URL for GitLab (for self-hosted instances)

github_base_urlstring

Base URL for GitHub (for GitHub Enterprise Server)

bitbucket_base_urlstring

Base URL for Bitbucket (for Bitbucket Data Center)

Example request

{
  "service": "github",
  "repo": "owner/repository",
  "accessToken": "ghp_xxxxxxxxxxxx",
  "branch": "main",
  "instructionPrompt": "threat_hunting",
  "commitId": "abc123def456",
  "includeFiles": "src/**/*.py,lib/**/*.js,app/**/*.ts",
  "excludeFiles": "tests/**,node_modules/**,dist/**"
}

Response

Agent scan successfully started

messagestring

Success message

scanIdstring

Unique identifier for the scan. Use this to retrieve results and check status.

filesQueuedinteger

Number of files queued for analysis

Example response

{
  "message": "Scan started successfully",
  "scanId": "aB3xK9mP2q",
  "filesQueued": 142
}