Programmatic access and editor integrations for this server.
The client is sdk/python/aegis_sdk.py in this repository. The PyPI name aegis-sdk is unpublished, so pip install aegis-sdk cannot work yet.
# From a clone pip install -e sdk/python
In a consumer GitHub Actions job, install with pip install "git+https://github.com/ThomasGenua/aegis.git#subdirectory=sdk/python" after setup-python. The repository is private, so that step needs credentials that can read it. See the Python SDK README.
from aegis_sdk import AegisClient
client = AegisClient(api_key="aegis_...", base_url="http://127.0.0.1:5000")
result = client.scan_code("import pickle; pickle.load(open('m.pkl'))")
print(f"Score: {result.score}/100")
job = client.scan_repo("https://github.com/example/repo.git")
result = client.wait_for_job(job.job_id)
if result.scan_id:
open('aegis.sarif', 'wb').write(client.export_scan(result.scan_id, 'sarif'))
raise SystemExit(client.fail_on(result, severity="critical"))
scan_directory skips the same trees as the CLI and honors a root .aegisignore. Unreadable files are skipped. Empty files are 0 findings (HTTP paste of blank code is 400). scan_code / scanCode raise AegisError (No code provided) for a blank snippet instead of POSTing. Leading/trailing spaces on file_path / filePath are stripped so Docker/IaC routing still applies. scan_file / scan_directory strip surrounding spaces on the path. An API error raises AegisError so a down server does not look like a clean scan. A missing path or a file path raises AegisError (Not a directory) instead of score 100. A directory with no scannable files raises AegisError (No scannable files). scan_file on a missing path or a directory raises AegisError (Not a file). PDF is 501 without reportlab on the server.
Python wait_for_job timeout is seconds. JavaScript waitForJob timeout is milliseconds. Both raise if a job completed without a scan_id and without inline findings, so fail_on / failOn cannot look like a clean scan. Missing or blank job_id raises AegisError (job_id is required) instead of GET /api/jobs/None. fail_on / failOn on a queued job body or null is also 1. Whitespace scan_id is treated as missing. Severity is stripped and lowercased ( CRITICAL ). A failed, error, or cancelled job includes the job error (for example No scannable files) in the exception. export_scan / exportScan raise AegisError (scan_id is required) when the id is missing or blank, instead of GET /api/export/None/sarif. Format is lowercased (SARIF → sarif). HTTP GET /api/export/{id}/{fmt} lowercases fmt the same way. scan_repo / scanRepo raise AegisError (branch cannot be blank) when branch is missing or whitespace (github.head_ref is empty on push); omitted branch is main. scan_repo(..., scan_history=True) also scans git commit history; the job fails with Cannot scan git history if git log / git show cannot be read. explain_rule / explainRule raise AegisError (rule_id is required) when the id is missing or blank, instead of GET /api/rules/None or /api/rules/ (the list endpoint).
The client is sdk/javascript/aegis-sdk.js in this repository. The npm name @aegis/sdk is unpublished, so npm install @aegis/sdk cannot work yet.
The JavaScript client is HTTP-only (scanCode / scanRepo). It does not walk a local tree or honor .aegisignore; use the Python SDK or CLI for that. ESM import works on Node 18+. CommonJS require() of this file needs Node 22+; Node 18 fails with ERR_REQUIRE_ESM. package.json has no require export because engines allows Node 18.
import { AegisClient } from './sdk/javascript/aegis-sdk.js';
import { writeFile } from 'node:fs/promises';
const client = new AegisClient({ apiKey: 'aegis_...', baseUrl: 'http://127.0.0.1:5000' });
const result = await client.scanCode("eval(userInput)");
console.log(`Score: ${result.score}/100`);
const job = await client.scanRepo('https://github.com/example/repo.git');
const full = await client.waitForJob(job.job_id);
if (full.scan_id) {
await writeFile('aegis.sarif', await client.exportScan(full.scan_id, 'sarif'));
}
process.exit(client.failOn(full, 'critical'));
The extension lives in vscode-extension/ in this repository. It is not a VS Code Marketplace listing from this repository. Use Run Extension or Install from VSIX. Store the API key with AEGIS: Set API Key (Secret Storage), not settings.json. Remote SSH/WSL/dev containers use aegis.baseUrl; a Marketplace code --install-extension id cannot work.
The plugin lives in jetbrains-plugin/ in this repository. This repository does not ship a Gradle wrapper. Build with system Gradle (gradle -p jetbrains-plugin buildPlugin) and install the zip under jetbrains-plugin/build/distributions/. Configure the API key in Tools → AEGIS Settings (PasswordSafe), not a plaintext settings file.
# From a clone (pip install aegis-ai-sast cannot work until the first upload) pip install -e . # Scan current directory aegis . # Fail CI in an AI-app repo: copy Option 4 on /docs/quickstart # (git+https install + SARIF). Settings → GitHub Actions is the remote snippet. aegis . --fail-on critical