# Aetherion Cyber Systems — Authentication & Authorization Specification

## Overview
Aetherion Cyber Systems enforces a default-deny architectural floor across 100% of edge and local endpoints.

## Authentication Mechanisms

### 1. Bearer Session Tokens (Talent Forge)
- **Token Format:** `forge_sess_<payload>.<signature>` (HMAC-SHA256).
- **Header:** `Authorization: Bearer <TOKEN>`
- **TTL:** 24 hours.
- **Verification:** Signed using Edge Worker cryptographic keys with constant-time Web Crypto API verification.

### 2. Ephemeral OTP Flow
- **Request:** `POST /api/auth/verify-lead` with candidate or user email.
- **Verification:** Single-use 6-digit numeric OTP dispatched via Resend REST API.
- **Confirmation:** `POST /api/auth/verify-otp` with email and code.
- **Replay Protection:** Attempt counter strictly limited to 3 attempts, 10-minute TTL, SHA-256 code hashing.

## REST Versioning & Deprecation Policy (RFC 8594)
- **URL Path Versioning:** All endpoints are aliased under the `/v1/` prefix:
  - `/v1/api/talent/chat`
  - `/v1/api/leads`
  - `/v1/ask`
- **Header Versioning:** Clients may supply `X-API-Version: v1` or `API-Version: v1`.
- **Deprecation Schedule:** All versions are supported for a minimum of 180 days following deprecation notice.
- **Lifecycle Headers:** Returned on 100% of live responses:
  - `Sunset: Fri, 31 Dec 2027 23:59:59 GMT`
  - `Deprecation: @1830297600`
  - `API-Version: v1`
  - `X-API-Version: v1`

## Rate Limiting & Quotas
- Ceiling: 20 requests per minute per origin IP address.
- Response Headers (observed on 100% of live edge responses):
  - `RateLimit-Limit: 20`
  - `RateLimit-Remaining: <count>`
  - `RateLimit-Reset: 60`
  - `RateLimit-Policy: 20;w=60`
  - `X-RateLimit-Limit: 20`
  - `X-RateLimit-Remaining: <count>`
  - `X-RateLimit-Reset: 60`
  - `Retry-After: 60` (returned on HTTP 429)

## Official Command-Line Interface (CLI)
Aetherion provides an official CLI for automated monitoring, MCP inspection, and sovereign lead assessment located in the monorepo at `packages/cli`:
- **Repository:** https://aetherioncyber.com/developers
- **Local installation & testing:**
  ```bash
  cd packages/cli && npm test
  ```

---
*Copyright © 2026 Aetherion Cyber Systems, Corp. (NY DOS ID: 8013583). All rights reserved. Sovereign US Enclave. P.H.A.L.A.N.X.™, C.I.T.A.D.E.L.™, C.O.N.C.I.E.R.G.E.™, Aetherion™ Kairos, O.R.I.O.N.™, and Aetherion Talent Forge™ are proprietary trademarks of Aetherion Cyber Systems, Corp. Protected under the Lanham Act (15 U.S.C. § 1125(a)). Machine-bound key derivation with DPAPI-NG (hardware-bound TPM 2.0 PCR sealing on enterprise roadmap).*
