Ir al contenido

Comp AI

Comp AI is an open-source (AGPLv3) compliance automation platform and self-hostable alternative to Vanta and Drata. It provides AI-native workflows for SOC 2, ISO 27001, HIPAA, GDPR, and 25+ other frameworks with automated evidence collection across 500+ integrations.

GitHub: https://github.com/trycompai/comp Website: https://trycomp.ai License: AGPLv3 (open-core model) Stack: Next.js, TypeScript, Prisma, PostgreSQL

Self-Hosted Deployment

Docker Setup

# Clone the repository
git clone https://github.com/trycompai/comp.git
cd comp

# Copy environment template
cp .env.example .env

# Configure required environment variables
# Edit .env with database URL, auth secrets, etc.

# Start with Docker Compose
docker compose up -d

# Verify services are running
docker compose ps

# View logs
docker compose logs -f

Local Development Setup

# Clone and install dependencies
git clone https://github.com/trycompai/comp.git
cd comp
pnpm install

# Set up PostgreSQL database
# Ensure PostgreSQL is running locally or via Docker
docker run -d --name comp-db -e POSTGRES_PASSWORD=secret -p 5432:5432 postgres:16

# Configure environment
cp .env.example .env
# Edit .env: DATABASE_URL, NEXTAUTH_SECRET, etc.

# Run database migrations
pnpm db:migrate

# Seed initial data (frameworks, controls)
pnpm db:seed

# Start development server
pnpm dev

Environment Configuration

VariableDescription
DATABASE_URLPostgreSQL connection string
NEXTAUTH_SECRETAuthentication secret key
NEXTAUTH_URLApplication base URL
SMTP_HOSTEmail server for notifications
SMTP_PORTEmail server port
SMTP_USEREmail authentication user
SMTP_PASSWORDEmail authentication password
ENCRYPTION_KEYKey for encrypting sensitive data
OPENAI_API_KEYAPI key for AI-powered features

Supported Compliance Frameworks

FrameworkTypeDescription
SOC 2 Type ISecurity auditPoint-in-time security controls assessment
SOC 2 Type IISecurity auditOngoing security controls over a period
ISO 27001Information securityInformation security management system
HIPAAHealthcareHealth data privacy and security
GDPRData privacyEU General Data Protection Regulation
SOXFinancialSarbanes-Oxley financial controls
PCI DSSPayment securityPayment card industry data security
NIST CSFCybersecurityCybersecurity framework controls
NIST 800-53Federal securityFederal information systems security
CIS ControlsSecurity benchmarksCenter for Internet Security controls
CCPAData privacyCalifornia Consumer Privacy Act
ISO 42001AI governanceAI management system standard
EU AI ActAI regulationEuropean Union AI regulation

Evidence Collection

Integration Categories

CategoryExamples
Cloud ProvidersAWS, Azure, GCP, DigitalOcean
Identity ProvidersOkta, Auth0, Azure AD, Google Workspace
Version ControlGitHub, GitLab, Bitbucket
HR PlatformsBambooHR, Gusto, Rippling, Deel
Ticketing SystemsJira, Linear, Asana, Monday.com
MonitoringDatadog, PagerDuty, Grafana
MDM / EndpointJamf, Kandji, Microsoft Intune
CommunicationSlack, Microsoft Teams

Connecting Integrations

# Integrations are configured through the web UI
# Navigate to: Settings > Integrations

# For cloud providers, provide:
# - API credentials or IAM role ARN
# - Region/account identifiers
# - Scopes for data access

# AWS integration example setup:
# 1. Create IAM role with read-only policy
# 2. Configure trust relationship for Comp AI
# 3. Enter Role ARN in Comp AI integration settings

# GitHub integration:
# 1. Install Comp AI GitHub App on your org
# 2. Select repositories to monitor
# 3. Authorize requested permissions

Evidence Collection Tasks

TaskDescription
Auto-collectScheduled automatic evidence gathering from integrations
Manual uploadUpload screenshots, documents, or exports as evidence
API pullPull data via integration APIs on demand
Webhook listenerReceive real-time evidence via incoming webhooks
Agent-basedDeploy lightweight agents for endpoint evidence

Policy Management

Policy Generation

# AI-assisted policy generation via the dashboard:
# 1. Navigate to Policies section
# 2. Select framework (e.g., SOC 2)
# 3. Choose policy template category
# 4. AI generates draft based on your organization profile
# 5. Review, customize, and approve

# Common policy categories:
# - Information Security Policy
# - Access Control Policy
# - Data Classification Policy
# - Incident Response Plan
# - Business Continuity Plan
# - Acceptable Use Policy
# - Change Management Policy
# - Vendor Management Policy
# - Data Retention Policy
# - Password Policy

Policy Lifecycle

StatusDescription
DraftInitial AI-generated or manually created policy
In ReviewSent to stakeholders for feedback
ApprovedAccepted by policy owner and management
PublishedActive and distributed to employees
Needs UpdateFlagged for periodic review or change
ArchivedSuperseded or no longer applicable

Control Implementation

Control Mapping

ActionDescription
Map controls to frameworksLink organizational controls to framework requirements
Assign control ownersDesignate responsible individuals per control
Set control frequencyDefine testing cadence (daily, weekly, monthly, annual)
Link evidenceAssociate evidence artifacts with controls
Cross-map controlsMap one control to multiple framework requirements

Control Status Tracking

StatusMeaning
Not StartedControl not yet implemented
In ProgressImplementation underway
ImplementedControl deployed, pending evidence
EffectiveControl tested and operating effectively
FailingControl not meeting requirements
Not ApplicableControl scoped out with justification

Risk Assessment

Risk Register Workflow

# Risk assessment workflow in Comp AI:
# 1. Identify risks (manual entry or AI-suggested)
# 2. Categorize by domain (operational, technical, compliance)
# 3. Assess likelihood (1-5 scale)
# 4. Assess impact (1-5 scale)
# 5. Calculate inherent risk score
# 6. Define mitigating controls
# 7. Calculate residual risk score
# 8. Assign risk owner and review date
# 9. Monitor and update periodically

Risk Matrix

Likelihood / ImpactNegligibleMinorModerateMajorCritical
Almost CertainMediumHighHighCriticalCritical
LikelyMediumMediumHighHighCritical
PossibleLowMediumMediumHighHigh
UnlikelyLowLowMediumMediumHigh
RareLowLowLowMediumMedium

Audit Preparation

Readiness Checklist

StepDescription
Gap analysisRun framework gap analysis to find missing controls
Evidence reviewVerify all required evidence is collected and current
Policy reviewEnsure all policies are approved and published
Control testingValidate controls are operating effectively
Personnel trainingConfirm security awareness training completion
Vendor assessmentReview third-party vendor compliance status
RemediationAddress identified gaps before audit window
Auditor accessConfigure read-only auditor portal access

Auditor Portal

# Set up auditor access:
# 1. Navigate to Settings > Auditor Access
# 2. Create auditor user with read-only permissions
# 3. Select frameworks and scope for the audit
# 4. Share secure portal link with audit firm
# 5. Auditors can view evidence, controls, and policies
# 6. Track auditor requests and comments in-platform

Dashboard and Reporting

Key Metrics

MetricDescription
Compliance scoreOverall percentage of controls met per framework
Evidence freshnessAge of most recent evidence per control
Policy coveragePercentage of required policies in place
Risk postureAggregate risk score across all categories
Task completionProgress on remediation and implementation tasks
Integration healthStatus of connected integration data feeds

Report Generation

# Available report types:
# - Compliance posture summary (executive view)
# - Framework-specific readiness report
# - Evidence collection status report
# - Risk register export
# - Control effectiveness report
# - Vendor compliance summary
# - Audit trail / activity log

# Reports can be exported as PDF or CSV
# Scheduled reports can be emailed to stakeholders

Team and Role Management

Role-Based Access

RolePermissions
OwnerFull platform access, billing, user management
AdminManage frameworks, controls, integrations, users
Compliance ManagerEdit policies, controls, evidence, risk register
Control OwnerManage assigned controls and evidence
ViewerRead-only access to dashboards and reports
AuditorRead-only access scoped to audit engagement

Team Management

# User and team operations via dashboard:
# Settings > Team Members

# Invite team members by email
# Assign roles per user
# Set framework-specific access scopes
# Enable SSO via SAML or OIDC
# Configure MFA requirements
# Review access audit logs

API Usage

REST API Patterns

# API base URL (self-hosted)
BASE_URL="https://your-comp-instance.com/api/v1"

# Authentication: API key in header
curl -H "Authorization: Bearer YOUR_API_KEY" \
  "$BASE_URL/frameworks"

# List compliance frameworks
curl -H "Authorization: Bearer YOUR_API_KEY" \
  "$BASE_URL/frameworks"

# Get controls for a framework
curl -H "Authorization: Bearer YOUR_API_KEY" \
  "$BASE_URL/frameworks/soc2/controls"

# Upload evidence artifact
curl -X POST \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "file=@evidence-screenshot.png" \
  -F "controlId=CC-1.1" \
  -F "description=Access review Q1 2026" \
  "$BASE_URL/evidence"

# Get compliance posture summary
curl -H "Authorization: Bearer YOUR_API_KEY" \
  "$BASE_URL/reports/posture?framework=soc2"

# List tasks and remediation items
curl -H "Authorization: Bearer YOUR_API_KEY" \
  "$BASE_URL/tasks?status=open"

Configuration and Customization

Organization Settings

SettingDescription
Organization profileCompany name, industry, size, locations
Framework selectionEnable/disable applicable frameworks
Evidence retentionSet retention periods for collected evidence
Notification preferencesEmail, Slack, or webhook alert configuration
Custom fieldsAdd organization-specific metadata to controls
BrandingCustom logo and colors for auditor portal
Data residencyConfigure storage region for compliance data

Notification Configuration

# Notification channels:
# - Email digests (daily/weekly compliance summary)
# - Slack integration (real-time alerts)
# - Webhook endpoints (custom integrations)

# Alert triggers:
# - Evidence expiring soon
# - Control status changes
# - New risks identified
# - Policy review due dates
# - Integration connection failures
# - Audit requests received

Database Management

# Database operations (self-hosted)

# Run pending migrations
pnpm db:migrate

# Reset database (caution: destroys data)
pnpm db:reset

# Generate Prisma client after schema changes
pnpm db:generate

# Open Prisma Studio for data inspection
pnpm db:studio

# Create a database backup
pg_dump -h localhost -U comp_user comp_db > backup.sql

# Restore from backup
psql -h localhost -U comp_user comp_db < backup.sql

Troubleshooting

IssueSolution
Integration sync failingCheck API credentials and rate limits in Settings
Evidence not collectingVerify integration permissions and connectivity
Database migration errorsRun pnpm db:migrate and check PostgreSQL logs
Authentication issuesVerify NEXTAUTH_SECRET and NEXTAUTH_URL config
AI features not workingConfirm OPENAI_API_KEY is set and valid
Slow dashboard loadingCheck PostgreSQL performance and indexing
Email notifications failingVerify SMTP configuration and credentials
Docker container crashesCheck memory limits and review docker compose logs