# Security Policy

## Supported Versions

| Version | Supported          |
| ------- | ------------------ |
| 0.6.x-preview (current) | :white_check_mark: |
| Older alpha builds | :x: |
| Legacy non-alpha lines | :x: |

> Aegis currently ships in the preview channel only. Legacy version lines
> are retired and no longer receive security fixes.

## Reporting a Vulnerability

If you discover a security vulnerability in Aegis, please report it responsibly:

1. **Preferred**: Open a [GitHub Security Advisory](https://github.com/OneStepAt4time/aegis/security). This keeps the report private until a fix is released.
2. **Fallback**: Use the [Security Vulnerability issue template](https://github.com/OneStepAt4time/aegis/issues/new?template=security.yml). Maintainers will move it to a private advisory if needed.
3. Include a description of the vulnerability, steps to reproduce, and potential impact.
4. We will acknowledge receipt within 48 hours and provide a timeline for the fix.

## Security Measures

Aegis implements the following security controls:

- **Authentication**: API key-based auth with optional master token
- **Session ownership**: All action routes enforce ownership — non-owning API keys cannot send/interrupt/kill sessions unless admin or master token
- **Input validation**: Path traversal prevention, env var name validation, Zod schema validation on all routes
- **Env var denylist**: CreateSession rejects dangerous env vars (AI provider keys, credentials, shell vars) and prefix-blocked vars (npm_config_, SSH_, GIT_ etc.)
- **SSRF protection**: URL scheme and private IP range validation
- **Command injection prevention**: Port validation, safe exec patterns
- **Transport security**: Recommended behind HTTPS reverse proxy

Phase 3.5 ACP backend migration is complete. Aegis communicates with Claude
Code via the Agent Client Protocol (ACP) over JSON-RPC stdio. ACP
driver/observer, approval, pause/resume, and intervention actions are
security-sensitive control-plane operations and remain covered by RBAC,
session ownership, audit attribution, and tenant boundaries.

## Security Updates

Security patches are released through the active preview line. We recommend upgrading to the latest published preview immediately.

Security hotfixes may target `main` directly with maintainer approval, but normal releases follow `develop` → `release/<version>` → `main` → `v*` tag. Public publishing is performed only by the tag-triggered release workflow after its preflight, SBOM, checksum, Sigstore, npm, PyPI, and Helm gates pass.

## Compliance Documentation

For SOC 2 Type II audit preparation, GDPR data mapping, and incident response, see:

- **[`docs/compliance/`](docs/compliance/)** — Compliance documentation hub
  - [SOC 2 CC Mapping](docs/compliance/soc2-cc-mapping.md) — Trust Services Criteria mapped to Aegis features
  - [SOC 2 Evidence Checklist](docs/compliance/soc2-evidence-checklist.md) — Audit evidence collection checklist
  - [Data Retention Policy](docs/compliance/data-retention-policy.md) — Retention schedules and DSAR handling
  - [DPA Template](docs/compliance/dpa-template.md) — Data Processing Agreement template for enterprise customers
  - [Incident Response](docs/compliance/incident-response.md) — Security incident response runbook
- **[`docs/COMPLIANCE.md`](docs/COMPLIANCE.md)** — High-level SOC 2 + GDPR + HIPAA readiness overview
- **[`docs/SECURITY_QUESTIONNAIRE.md`](docs/SECURITY_QUESTIONNAIRE.md)** — Pre-filled vendor security questionnaire
