Developer Documentation

SDK Integration Guide

Integrate AegisComply into your development workflow in minutes. Catch hardcoded secrets, unencrypted PII, and compliance violations before they reach production — directly in your IDE, CI pipeline, and code review process.

1 Overview

The AegisComply SDK is a compliance-as-code layer that runs wherever your developers write code. It ships as two components:

Both read from the same shared rule set, so a rule added once surfaces in every channel.

ℹ️

The SDK can run in local-only mode with no network calls. Set apiKey to empty to use this mode — findings are shown inline but not synced to your AegisComply dashboard.

2 Prerequisites

3 Installation

Choose the installation path that matches your workflow:

Option A — VS Code Extension

Open the Extensions panel in VS Code, search for AegisComply Compliance Scanner, and click Install. Alternatively, run:

shell
code --install-extension aegiscomply.compliance-scanner

Option B — JetBrains Plugin

Go to Settings → Plugins → Marketplace, search for AegisComply Compliance Scanner, and install. Restart the IDE when prompted.

Option C — CLI (npm)

Install the CLI globally or as a dev dependency in your project:

shell
# Install as a dev dependency
npm install --save-dev @aegiscomply/scanner
shell
yarn add --dev @aegiscomply/scanner
shell
pnpm add -D @aegiscomply/scanner

4 API Key Setup

Your API key authenticates the scanner with your AegisComply workspace and syncs findings to the dashboard.

shell .env (add to .gitignore)
AEGISCOMPLY_API_KEY=ac_live_xxxxxxxxxxxxxxxxxxxx
⚠️

Never hardcode your API key in config files or source code. Use environment variables or your CI/CD secrets manager (GitHub Secrets, GitLab CI Variables, AWS SSM, etc.).

5 Configuration

Create an aegiscomply.config.json file in the root of your repository. Both the IDE plugin and the CLI scanner read from this file automatically.

json aegiscomply.config.json
{
  "frameworks": ["soc2", "gdpr"],
  "severityThreshold": "medium",
  "apiKey": "${AEGISCOMPLY_API_KEY}",
  "enableRealtime": true,
  "scanOnSave": true,
  "exclude": ["node_modules", "dist", "*.test.*"]
}
💡

Use "${ENV_VAR}" syntax in the config to read values from environment variables at runtime — keeps secrets out of the file.

6 IDE Plugins

After installing the plugin and adding your config file, the scanner activates automatically. No extra setup is needed.

VS Code — extension settings

Open Settings → Extensions → AegisComply or add directly to your workspace settings:

json .vscode/settings.json
{
  "aegiscomply.frameworks":        ["soc2", "gdpr"],
  "aegiscomply.severityThreshold": "medium",
  "aegiscomply.enableRealtime":    true,
  "aegiscomply.scanOnSave":        true
}

JetBrains — plugin settings

Navigate to Settings → Tools → AegisComply. The plugin reads aegiscomply.config.json from the project root; individual fields can be overridden in the IDE settings panel.

ℹ️

Findings appear inline as squiggly underlines. Hover any underlined token for a description, the severity level, and the specific compliance control it violates (e.g. SOC 2 CC6.1 or GDPR Art. 32).

7 CI/CD Pipeline Integration

Run aegiscomply scan as a pipeline step to block PRs that introduce compliance violations above your configured threshold.

yaml .github/workflows/compliance.yml
name: Compliance Scan
on: [push, pull_request]

jobs:
  scan:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: "20"
      - run: npm install --save-dev @aegiscomply/scanner
      - run: npx aegiscomply scan --fail-on high
        env:
          AEGISCOMPLY_API_KEY: ${{ secrets.AEGISCOMPLY_API_KEY }}
yaml .gitlab-ci.yml
compliance-scan:
  stage: test
  image: node:20
  script:
    - npm install --save-dev @aegiscomply/scanner
    - npx aegiscomply scan --fail-on high
  variables:
    AEGISCOMPLY_API_KEY: $AEGISCOMPLY_API_KEY
yaml .pre-commit-config.yaml
repos:
  - repo: local
    hooks:
      - id:    aegiscomply
        name:  AegisComply Compliance Scan
        entry: npx aegiscomply scan --staged
        language: node
        pass_filenames: false

CLI flags

FlagDescription
--fail-on <severity>Exit with code 1 if any finding meets or exceeds this severity. Values: low medium high critical
--stagedScan only files staged for commit (pre-commit mode).
--output <format>Output format: text (default), json, sarif (for GitHub code scanning).
--framework <id>Override the frameworks to check. Comma-separated: soc2,gdpr,hipaa.
--no-syncSkip syncing results to the AegisComply platform (offline mode).

8 Supported Frameworks & Languages

The scanner works across all major languages and compliance frameworks out of the box.

Languages

🟨
JavaScript
.js, .mjs, .cjs
🔷
TypeScript
.ts, .tsx
🐍
Python
.py
Java
.java
🎯
Kotlin
.kt, .kts
🐹
Go
.go
💎
Ruby
.rb

Compliance Frameworks

IDStandardExample Controls
soc2SOC 2 Type IICC6.1, CC6.7, CC7.2
gdprGDPRArt. 5, Art. 25, Art. 32, Art. 35
hipaaHIPAA Security Rule§164.312(a)(2)(iv), §164.312(b)
iso27001ISO/IEC 27001:2022A.9.4.3, A.10.1.1, A.12.4.1
pci-dssPCI DSS v4Req 3.4, Req 3.5, Req 10.3

9 How Scanning Works

The scanner runs entirely locally using a pattern-matching engine. Three categories of rules are evaluated on every file:

SECRETS — Hardcoded credentials

Detects credentials that should never appear in source code: AWS keys, GitHub tokens, Stripe keys, JWT secrets, database connection strings, private keys, and more.

PII — Personal & sensitive data

Flags PII fields (SSN, email, phone, date of birth), PHI fields (diagnosis, patient ID, prescriptions), and payment card data (card number, CVV, PAN) that are stored, transmitted, or handled without encryption or masking.

LOG — Sensitive data in logs

Catches PII, PHI, secrets, and raw request/response bodies passed to any logging function (console.log, logger.*, print, etc.).

ℹ️

Every finding includes a rule ID (e.g. SECRETS-002), severity, a plain-language description, and the specific compliance control IDs it violates — with a direct link to the control detail page in your dashboard.

10 Suppressing Warnings

Some findings are intentional (test fixtures, local dev passwords). Suppress them with an inline comment on the line before the flagged code.

javascript
// aegiscomply-disable-next-line LOG-001
console.log(user.email)

// Suppress all rules on the next line
// aegiscomply-disable-next-line all
const config = loadLegacyConfig()
python
# aegiscomply-disable-next-line SECRETS-006
password = "dev-only-password"

# aegiscomply-disable-next-line all
config = load_legacy_config()
java
// aegiscomply-disable-next-line PII-001
String ssn = record.getSsn();
⚠️

All suppressions are captured and visible in your compliance dashboard. Auditors can review suppressed findings and their justifications during a SOC 2 or ISO 27001 audit.

11 Compliance Framework Mapping

Every rule maps to one or more specific control IDs across all supported frameworks. When a finding is surfaced, the SDK includes the exact controls violated — making it directly actionable for auditors and compliance managers.

Rule CategorySOC 2GDPRHIPAAISO 27001PCI DSS
SECRETS-*CC6.1, CC6.7Art. 32§164.312(a)(2)(iv)A.9.4.3, A.10.1.1Req 3.4, 3.5
PII-*CC6.1Art. 5, 25, 35§164.312(e)(2)(ii)A.13.2.3Req 3.4
LOG-*CC7.2Art. 5§164.312(b), §164.528A.12.4.1Req 10.3

Click any control ID in your dashboard findings to open the full control detail page, including remediation guidance and evidence requirements.


12 Configuration Reference

KeyTypeDefaultRequiredDescription
frameworks string[] ["soc2"] Optional Compliance frameworks to check. Rules and control references are filtered to these. Values: soc2 gdpr hipaa iso27001 pci-dss
severityThreshold string "medium" Optional Minimum severity to surface. Findings below this level are suppressed. Values: low medium high critical
apiKey string "" Optional AegisComply API key. Leave empty for local-only mode (findings shown inline, not synced to platform).
apiEndpoint string "https://api.aegiscomply.io/v1" Optional API endpoint. Change only for self-hosted deployments.
enableRealtime boolean true Optional Scan as you type in the IDE (debounced at 500 ms). Has no effect in CLI mode.
scanOnSave boolean true Optional Run a full file scan automatically on each save event in the IDE.
exclude string[] ["node_modules"] Optional Glob patterns for files and directories to exclude from scanning.

13 Rule Reference

SECRETS — Hardcoded Credentials

Rule IDSeverityWhat It Catches
SECRETS-001HighHigh-entropy string in a secret-named variable
SECRETS-002CriticalAWS Access Key ID (AKIA...)
SECRETS-003CriticalGitHub Personal Access Token (ghp_...)
SECRETS-004CriticalStripe Live Secret Key (sk_live_...)
SECRETS-005HighJWT secret hardcoded inline
SECRETS-006CriticalHardcoded password / passwd / pwd
SECRETS-007CriticalDatabase connection string with embedded credentials
SECRETS-008CriticalPEM private key block in source file

PII — Personal & Sensitive Data

Rule IDSeverityWhat It Catches
PII-001HighPII field (SSN, email, phone, DOB…) stored without encryption
PII-002HighPII field transmitted in an HTTP request
PII-003HighPII field written to a file without encryption
PII-004CriticalPHI field (diagnosis, patient_id, prescription…) in plain context
PII-005CriticalPayment card field (card_number, CVV, PAN…) not masked

LOG — Sensitive Data in Logs

Rule IDSeverityWhat It Catches
LOG-001HighPII field passed to console.log / logger.* / print
LOG-002CriticalSecret or credential variable passed to any log call
LOG-003MediumFull req.body / response.data object logged
LOG-004CriticalPHI field in any log statement
LOG-005CriticalPayment card data in any log statement