Skip to Content
APIScan

Scan Endpoint

Submit code for security analysis.

POST /api/v1/scan

Analyzes source code files for AI agent security vulnerabilities.

Request

Headers:

HeaderRequiredDescription
AuthorizationYesBearer YOUR_API_KEY
Content-TypeYesmultipart/form-data

Body (multipart form):

FieldTypeRequiredDescription
fileFileYesSource file to scan (can send multiple)

Supported file types:

  • Python (.py)
  • JavaScript (.js, .jsx)
  • TypeScript (.ts, .tsx)
  • Go (.go)
  • YAML (.yaml, .yml)
  • JSON (.json)

Response

{ "success": true, "risk_score": 65, "findings_count": 3, "critical_count": 0, "high_count": 2, "medium_count": 1, "low_count": 0, "findings": [ { "id": "f8a3b2c1", "severity": "HIGH", "file": "agent.py", "line": 42, "column": 12, "message": "User input directly concatenated into LLM prompt", "cwe": "CWE-77", "owasp": "LLM01" } ], "files_scanned": 5, "scan_duration": "2.1s" }

Response Fields

FieldTypeDescription
successbooleanWhether the scan completed
risk_scoreintegerOverall risk score (0-100)
findings_countintegerTotal number of findings
critical_countintegerCritical severity findings
high_countintegerHigh severity findings
medium_countintegerMedium severity findings
low_countintegerLow severity findings
findingsarrayList of security findings
files_scannedintegerNumber of files analyzed
scan_durationstringTime taken for analysis

Finding Object

FieldTypeDescription
idstringUnique finding identifier
severitystringCRITICAL, HIGH, MEDIUM, or LOW
filestringFile path where issue was found
lineintegerLine number
columnintegerColumn number
messagestringDescription of the vulnerability
cwestringCWE identifier (e.g., CWE-77)
owaspstringOWASP LLM Top 10 category

Severity Levels

SeverityDescription
CRITICALImmediate risk, fix before deployment
HIGHSignificant risk, fix before release
MEDIUMModerate risk, fix in normal cycle
LOWMinor risk, address when convenient

Example Request

curl -X POST https://api.inkog.io/api/v1/scan \ -H "Authorization: Bearer YOUR_API_KEY" \ -F "file=@./src/agent.py" \ -F "file=@./src/tools.py"

Scanning a Directory

To scan multiple files, send each file as a separate form field:

# Find all Python files and scan them find ./src -name "*.py" -exec curl -X POST https://api.inkog.io/api/v1/scan \ -H "Authorization: Bearer YOUR_API_KEY" \ -F "file=@{}" \;

Or use the CLI for easier directory scanning:

inkog scan ./src
Last updated on