> ## Documentation Index
> Fetch the complete documentation index at: https://docs.codeant.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Agent Scan Results

> Retrieves the results of an agent analysis scan. If the scan is still in progress, returns a status of `in_progress`. Once complete, returns deduplicated issues found across all analyzed files. Issues are deduplicated using LLM-based analysis to remove duplicate findings across files.



## OpenAPI

````yaml /openapi.json post /api/analysis/agents/scan/results
openapi: 3.0.3
info:
  title: CodeAnt AI API
  description: >-
    API for code analysis (SAST, SCA, secrets, IaC) and developer productivity
    metrics. Supports GitHub, GitLab, Bitbucket, and Azure DevOps.
  version: 1.0.0
servers:
  - url: https://api.codeant.ai
    description: Production server
security: []
tags:
  - name: Analysis
    description: Code analysis operations
  - name: Agent Analysis
    description: >-
      AI-powered agent analysis operations. Uses LLM-based code exploration
      agents to perform deep security threat hunting, bug finding, and custom
      analysis with reflection-based false positive filtering.
  - name: Developer Metrics — Teams
    description: >-
      Manage developer teams: create, update, delete teams and manage team
      membership. Teams are used to organize developers and scope metrics.
  - name: Developer Metrics
    description: >-
      Developer productivity and activity metrics: active developers, PR
      throughput, individual comparisons, and AI-generated summaries. All
      endpoints support GitHub, GitLab, Bitbucket, and Azure DevOps.
paths:
  /api/analysis/agents/scan/results:
    post:
      tags:
        - Agent Analysis
      summary: Get Agent Scan Results
      description: >-
        Retrieves the results of an agent analysis scan. If the scan is still in
        progress, returns a status of `in_progress`. Once complete, returns
        deduplicated issues found across all analyzed files. Issues are
        deduplicated using LLM-based analysis to remove duplicate findings
        across files.
      operationId: getAgentScanResults
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentScanResultsRequest'
            example:
              repo: owner/repository
              scanId: aB3xK9mP2q
      responses:
        '200':
          description: Scan results retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentScanResultsResponse'
              examples:
                completed:
                  summary: Completed scan with results
                  value:
                    scanId: aB3xK9mP2q
                    repoName: owner/repository
                    status: completed
                    results:
                      - file: src/auth/login.py
                        scan_id: aB3xK9mP2q
                        issues:
                          - relevant_file: src/auth/login.py
                            language: python
                            suggestion_content: >-
                              The `authenticate` function does not validate the
                              length of the password parameter before passing it
                              to the bcrypt hashing function. Extremely long
                              passwords (>72 bytes) are silently truncated by
                              bcrypt, which could lead to collision
                              vulnerabilities.
                            start_line: 45
                            end_line: 52
                            one_sentence_summary: >-
                              Password length not validated before bcrypt
                              hashing
                            label: Security
                            severity: medium
                            cwe_id: CWE-916
                            agent_instructions: threat_hunting
                    totalIssues: 1
                in_progress:
                  summary: Scan still in progress
                  value:
                    scanId: aB3xK9mP2q
                    repoName: owner/repository
                    status: in_progress
                    results: []
                    totalIssues: 0
        '404':
          description: Scan not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: Scan not found
        '500':
          description: Failed to retrieve scan results
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: Failed to retrieve scan results
components:
  schemas:
    AgentScanResultsRequest:
      type: object
      required:
        - repo
        - scanId
      properties:
        repo:
          type: string
          description: Repository identifier
          example: owner/repository
        scanId:
          type: string
          description: Scan identifier returned from the start scan endpoint
          example: aB3xK9mP2q
    AgentScanResultsResponse:
      type: object
      properties:
        scanId:
          type: string
          description: Scan identifier
          example: aB3xK9mP2q
        repoName:
          type: string
          description: Repository name
          example: owner/repository
        status:
          type: string
          description: Current status of the scan
          enum:
            - completed
            - in_progress
          example: completed
        results:
          type: array
          description: List of file results with issues found
          items:
            type: object
            properties:
              file:
                type: string
                description: File path where issues were found
                example: src/auth/login.py
              scan_id:
                type: string
                description: Scan identifier
              issues:
                type: array
                description: List of issues found in the file
                items:
                  $ref: '#/components/schemas/AgentIssue'
        totalIssues:
          type: integer
          description: Total number of deduplicated issues found across all files
          example: 5
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Error message
    AgentIssue:
      type: object
      description: An issue found by the AI agent during analysis
      properties:
        relevant_file:
          type: string
          description: File path where the issue was found
          example: src/auth/login.py
        language:
          type: string
          description: Programming language of the file
          example: python
        suggestion_content:
          type: string
          description: >-
            Detailed description of the issue in markdown format, including the
            problem, impact, and suggested fix
          example: >-
            The `authenticate` function does not validate the length of the
            password parameter before passing it to the bcrypt hashing function.
        start_line:
          type: integer
          description: Starting line number of the issue
          example: 45
        end_line:
          type: integer
          description: Ending line number of the issue
          example: 52
        one_sentence_summary:
          type: string
          description: Brief one-sentence summary of the issue
          example: Password length not validated before bcrypt hashing
        label:
          type: string
          description: Category label for the issue (e.g., Security, Bug, Performance)
          example: Security
        severity:
          type: string
          description: Severity level of the issue
          enum:
            - low
            - medium
            - high
            - critical
          example: medium
        cwe_id:
          type: string
          description: Common Weakness Enumeration (CWE) identifier, when applicable
          example: CWE-916
        exploitability:
          type: string
          description: >-
            Assessment of how exploitable the issue is (included for security
            findings)
          example: Requires attacker to know the truncation behavior of bcrypt
        agent_instructions:
          type: string
          description: >-
            The analysis instructions or prompt that the agent used when it
            found this issue (e.g., threat_hunting, bug_finding, or custom
            rules)
          example: threat_hunting

````