Skip to main content
This System Security Plan (SSP) describes AgentVault’s security architecture, controls, and risk management approach. It is intended for security auditors, enterprise customers, and internal engineering teams.
This SSP covers the AgentVault Secure Enclave platform as deployed in production. It is a living document updated as the platform evolves.

1. System Overview

AgentVault is a zero-knowledge, invite-only secure communications platform that enables AI agent owners to communicate with their agents through end-to-end encrypted channels. Core security property: The backend never possesses decryption keys. All encryption and decryption happens client-side. The server stores and relays ciphertext only.
AttributeValue
System typeSecure communications enclave
Deployment modelCloud-hosted (DigitalOcean, Cloudflare, Clerk)
Data classificationConfidential (message content), Internal (metadata)
User populationAI agent owners, agents, tenant administrators
Availability target99.9% uptime for API and WebSocket services

2. Architecture Summary

AgentVault follows a monorepo architecture with clear separation between client-side cryptography and server-side relay:
packages/
  crypto/    -- Shared TypeScript cryptographic library (Double Ratchet, X3DH)
  web/       -- Expo universal app (iOS, Android, Web)
  plugin/    -- OpenClaw Node.js plugin for agent integration
  client/    -- TypeScript SDK for third-party agent developers
  verify/    -- Verification SDK for credential validation
  backend/   -- FastAPI Python backend (ciphertext relay only)

Infrastructure Components

ComponentTechnologySecurity Role
Backend APIPython 3.11+ / FastAPICiphertext relay, tenant management, RBAC enforcement
DatabasePostgreSQL 16 (managed)Encrypted data storage with RLS tenant isolation
Cache / Pub-SubRedis 7 (managed)WebSocket message relay, rate limiting
AuthenticationClerkJWT issuance, session management
DNS / TLSCloudflareTLS termination, DDoS protection
Client cryptolibsodium (JS)All encryption/decryption operations

Data Flow

The backend is a ciphertext-only relay. It never decrypts, inspects, or transforms message content. All cryptographic operations occur on client devices.
  1. Client generates Ed25519 identity keypair during enrollment.
  2. X3DH key exchange establishes a shared secret between owner and agent.
  3. Double Ratchet derives per-message encryption keys from the shared secret.
  4. Client encrypts message with XChaCha20-Poly1305 and sends ciphertext to backend.
  5. Backend stores ciphertext in PostgreSQL and relays via WebSocket/Redis pub-sub.
  6. Recipient client receives ciphertext, advances ratchet, and decrypts locally.

3. Roles & Responsibilities

RoleResponsibility
Security OfficerOverall security posture, risk acceptance, incident escalation
Engineering LeadSecure development practices, code review, architecture decisions
DevSecOps LeadInfrastructure security, deployment pipeline, monitoring
Incident Response LeadIncident detection, containment, recovery, post-mortem

Application Roles (RBAC)

RoleScopeKey Permissions
Owner AdminTenant-wideFull control: enrollment, revocation, billing, room management
Tenant AdminTenant-wideDevice management, enrollment approval, room management
MemberAssigned roomsSend/receive messages, view conversations
AgentAssigned conversationsSend/receive messages within assigned scope

4. Access Control

Authentication

All API access requires a valid Clerk JWT in the Authorization: Bearer header. WebSocket connections require the JWT as a query parameter (?token=<jwt>).
ControlImplementation
Identity providerClerk (custom domain: clerk.agentvault.chat)
Token formatJWT with tenant and role claims
Session managementClerk-managed with automatic rotation
Multi-factor authSupported via Clerk configuration

Authorization

Authorization is enforced at two layers:
  1. API layer: FastAPI middleware checks role permissions on every endpoint.
  2. Database layer: PostgreSQL RLS policies enforce tenant scoping on every query.
-- RLS policy applied to all tables
CREATE POLICY tenant_isolation ON table_name
  USING (tenant_id = current_setting('app.current_tenant_id')::uuid);

Enrollment

StepDescription
1. Invite generationAdmin creates a time-limited invite token
2. Token submissionNew device submits the token with its Ed25519 public key
3. Token verificationBackend verifies BLAKE2b hash of submitted token
4. Admin approvalAdministrator explicitly approves the enrollment
5. Device activationDevice receives “active” status and can participate

5. Cryptographic Controls

Algorithm Suite

FunctionAlgorithmLibraryKey Size
Key exchangeX25519 (X3DH)libsodium256-bit
SigningEd25519libsodium256-bit
Symmetric encryptionXChaCha20-Poly1305libsodium256-bit key, 192-bit nonce
HashingBLAKE2blibsodium256-bit output
Key derivationHKDF (via Double Ratchet)libsodium256-bit

Key Lifecycle

PhaseControl
GenerationEd25519 keypairs generated on-device during enrollment. Never transmitted in plaintext.
StoragePrivate keys stored in platform secure storage (SecureStore on mobile, localStorage on web).
UsageKeys used exclusively for X3DH session establishment and message signing.
RotationDouble Ratchet automatically rotates symmetric keys per message. DH ratchet rotates on each reply.
DeletionMessage keys deleted after decryption (forward secrecy). Device keys deleted on revocation.

Design Decisions

AgentVault uses XChaCha20-Poly1305 rather than AES-GCM. The 192-bit nonce space of XChaCha20 eliminates the risk of nonce reuse, which is a practical concern with AES-GCM’s 96-bit nonce in high-volume messaging systems.

6. Monitoring & Logging

Logging Policy

CategoryLoggedContent
API requestsYesMethod, path, status code, latency, tenant ID
Authentication eventsYesLogin, logout, token refresh, failures
Administrative actionsYesEnrollment, revocation, role changes, room management
Message contentNeverOnly message metadata (IDs, timestamps) is logged
Cryptographic keysNeverNo key material appears in any log output

Observability

AgentVault implements an OTel-shaped telemetry pipeline for operational monitoring:
SignalCoverage
TracesRequest lifecycle, WebSocket message delivery, enrollment flows
MetricsConnection health, message latency, error rates, active sessions
LogsStructured JSON logs with correlation IDs (no plaintext content)

Alerting

ConditionResponse
Failed authentication spikeRate limiting escalation, admin notification
WebSocket disconnection anomalyConnection health check, device status verification
Database connection failureAutomatic reconnection, infrastructure alert
Enrollment rate limit exceededIP-based throttling (5 attempts / 10 minutes)

7. Risk Management

Methodology

AgentVault applies STRIDE threat modeling to identify threats and DREAD scoring to prioritize risk treatment.

Threat Summary

ThreatSTRIDE CategoryMitigationResidual Risk
Database breachInformation DisclosureCiphertext-only storage; no server-side keysLow — attacker obtains only encrypted blobs
Compromised deviceElevation of PrivilegeDevice revocation + session re-establishmentMedium — attacker has access until revocation
RLS misconfigurationTamperingRLS on all tables, audit per releaseLow — database-level enforcement
Enrollment social engineeringSpoofingFingerprint verification, short-lived invites, admin approvalMedium — relies on admin diligence
Network interceptionInformation DisclosureTLS 1.3 + E2E encryptionLow — double-layer encryption
Rogue administratorElevation of PrivilegeAudit logging, RBAC constraintsMedium — admin has inherent privileges

Risk Acceptance

The following risks are accepted as outside the system’s assurance boundary:
  • Fully compromised client operating system
  • Nation-state traffic analysis and metadata correlation
  • Screenshot or screen recording on client devices
  • Physical device theft (mitigated by device revocation)

Review Cadence

ActivityFrequency
Threat model reviewAnnual or after major architecture changes
RLS policy auditEvery release that modifies database schema
Penetration testingAnnual, by external assessor
Cryptographic reviewAnnual, by qualified cryptographer
Dependency vulnerability scanContinuous (automated)
Security incident post-mortemAfter every security incident

8. Incident Response

Response Phases

PhaseActions
DetectionMonitoring alerts, user reports, automated anomaly detection
ContainmentDevice revocation, WebSocket disconnection, rate limit escalation
EradicationSession re-establishment, credential rotation, patch deployment
RecoveryService restoration, ratchet re-establishment, user notification
Post-mortemRoot cause analysis, control improvements, documentation update

Device Compromise Procedure

  1. Admin revokes the compromised device via the management interface.
  2. Backend immediately closes the device’s WebSocket connection.
  3. Device status is set to “revoked” — all subsequent API calls are rejected.
  4. Remaining participants establish new encryption sessions, excluding the revoked device.
  5. Incident is logged in the audit trail.

9. Compliance Posture

FrameworkStatusReference
SOC 2 Type IArchitecture alignedCompliance Mapping
ISO 27001Architecture alignedCompliance Mapping
NIST CSFPartial alignmentIdentify, Protect, Detect addressed
OWASP Top 10MitigatedInput validation, auth enforcement, injection prevention
Formal SOC 2 and ISO 27001 certification is on the roadmap. Current architectural controls provide a strong foundation for certification when the organization is ready to engage an auditor.