---
title: "Start Agent Scan"
method: POST
path: "/api/agents/scan/start"
tags: ["Agent Analysis"]
---

# Start Agent Scan

`POST /api/agents/scan/start`

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.

## Request body

- AgentScanStartRequest
  - `service` 'github' | 'gitlab' | 'azuredevops' | 'bitbucket', required — Version control service provider
  - `repo` string, required — Repository identifier (format varies by service)
  - `accessToken` string, required — OAuth or personal access token for the VCS service
  - `branch` string, required — Git branch to analyze
  - `instructionPrompt` string, required — Analysis type. Use `threat_hunting` for security threat detection.
  - `commitId` string — Specific commit SHA to analyze. If omitted, the latest commit on the branch is used.
  - `includeFiles` string — Comma-separated glob patterns for files to include in analysis
  - `excludeFiles` string — Comma-separated glob patterns for files to exclude from analysis
  - `azureDevopsBaseUrl` string — Base URL for Azure DevOps (for self-hosted instances)
  - `gitlab_base_url` string — Base URL for GitLab (for self-hosted instances)
  - `github_base_url` string — Base URL for GitHub (for GitHub Enterprise Server)
  - `bitbucket_base_url` string — Base URL for Bitbucket (for Bitbucket Data Center)

## Response `200`

Agent scan successfully started

- AgentScanStartResponse
  - `message` string — Success message
  - `scanId` string — Unique identifier for the scan. Use this to retrieve results and check status.
  - `filesQueued` integer — Number of files queued for analysis

## Other responses

- `400` — Missing required parameter
- `500` — Failed to start scan

---

[API](https://skmtc.dev/codeant/apis/codeant-ai-api.md) · [All operations](https://skmtc.dev/codeant/apis/codeant-ai-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/codeant/codeant-ai-api/revisions/d1eb7c083a39/schema)
