← Back to App

Security Architecture

Last Updated: March 1, 2026 Operated by: Assistant Hub
🔒 Security by Design — Assistant Hub uses NIST-aligned audit logging, formal agent capability attestations, defense-in-depth enforcement, and industry-standard encryption to protect your data at every layer.
5
Agent Capabilities
3
Enforcement Layers
25+
Audit Event Types
426
Tests Passing
🔐
AES-256-GCM
API keys encrypted at rest
🔑
PBKDF2
200K iterations + random salt
🔒
HTTPS
TLS everywhere via Cloudflare
🛡
No Custody
Your wallet, your keys

1. Overview

This page provides a transparent look at how Assistant Hub secures your data. We believe in security through transparency — understanding our architecture helps you make informed decisions about trusting us with your API keys and data.

All cryptographic operations use the Web Crypto API (not Node.js crypto), which provides hardware-backed implementations on supported platforms.

2. API Key Encryption

When you store API keys (Gemini, Grok, CoinGecko, BANKR), they are encrypted before being written to the database using AES-256-GCM — the same authenticated encryption standard used by banks and government agencies.

Encryption Flow

Step 1You enter key
Step 2HTTPS / TLS
Step 3AES-256-GCM Encrypt
Step 4PostgreSQL (encrypted)
On UseDecrypt on demand
API CallProvider (Gemini, etc.)

Technical Details

PropertyValue
AlgorithmAES-256-GCM (Galois/Counter Mode)
Key derivationServer-side ENCRYPTION_KEY environment variable
IV (nonce)96-bit random per encryption (never reused)
Authentication tag128-bit (included in ciphertext)
Storage formatenc:v1:{base64url(IV)}:{base64url(ciphertext)}
Frontend displayMasked — only last 4 characters shown (e.g., ****a1b2)

The encryption key is stored as a Railway environment variable and never committed to source code. Each value is encrypted with a unique random IV, ensuring that even identical keys produce different ciphertexts.

3. Password Security

User passwords are hashed using PBKDF2 (Password-Based Key Derivation Function 2) before storage. Plaintext passwords are never stored, logged, or transmitted after initial receipt.

Hashing Flow

InputYour password
Salt16-byte random (per user)
PBKDF2200,000 iterations
Output256-bit hash
Storedsalt:hash (hex)
PropertyValue
AlgorithmPBKDF2 with SHA-256
Iterations200,000
Salt length128 bits (16 bytes), random per user
Output length256 bits
ImplementationWeb Crypto API (crypto.subtle.deriveBits)

The 200,000 iteration count follows current OWASP recommendations and makes brute-force attacks computationally expensive. Each user has a unique random salt, preventing rainbow table attacks.

4. Authentication

After login, you receive a signed JSON Web Token (JWT) that authenticates all subsequent API requests.

PropertyValue
AlgorithmHMAC-SHA256 (HS256)
Expiry7 days from issuance
StorageBrowser localStorage
VerificationServer-side on every API request
PayloaduserId, username, tier (no sensitive data)
Signing keyJWT_SECRET environment variable

Tokens contain only non-sensitive identifiers. Passwords, API keys, and personal data are never included in the JWT payload.

5. Data in Transit

All communication between your browser and our servers is encrypted using TLS 1.2+ via Cloudflare and Railway's infrastructure.

6. Wallet Connectivity

Assistant Hub detects wallets using the EIP-6963 multi-wallet detection standard. Our wallet integration is strictly read-only and non-custodial.

7. Agent Isolation & Bun Worker Sandboxing

Autonomous trading agents operate within strict security boundaries, with optional V8 isolate sandboxing for condition evaluation:

8. Agent Capability Attestations (ACA)

Every autonomous trading agent operates under a formal, default-deny permission system. Rather than trusting agents by default, each must be explicitly granted specific capabilities before it can act.

Standard Capabilities

Capability Description Default
READ_MARKET_DATA Fetch live prices, charts, and market indicators Granted
GENERATE_SIGNALS Produce buy/sell/hold signals from analysis Denied
EXECUTE_SWAPS Open and close paper or live positions Denied
MANAGE_LIQUIDITY Stake, unstake, or rebalance liquidity Denied
WITHDRAW_FUNDS Move funds to external wallets Always Denied

Key design decisions:

9. Defense-in-Depth Enforcement

ACA permission checks are enforced at three independent layers. Even if one layer is bypassed, the next catches unauthorized actions.

1
Agent Engine
Autonomous evaluation loop — gates GENERATE_SIGNALS before analysis and EXECUTE_SWAPS before position changes
2
Paper Engine
Simulated trading layer — blocks agent-initiated opens/closes without EXECUTE_SWAPS capability
3
On-Chain Executor
BANKR x402 execution — requires WITHDRAW_FUNDS for buy/sell/swap, MANAGE_LIQUIDITY for stake operations

Each gate calls enforceAcaCapability() which checks the agent's stored capabilities, logs the result to the audit trail, and hard-blocks the action if not granted — no fallback, no override.

10. NIST Framework Alignment & Audit Logging

We voluntarily align our security program with the NIST Cybersecurity Framework (CSF 2.0) and key NIST Special Publications:

All security-relevant events are recorded in an immutable, append-only audit log with cryptographic hash chain linking. Each entry includes a pseudonymized actor ID (never raw usernames in logs), structured event type, outcome metadata, and a SHA-256 hash that chains it to the previous entry — making any tampering detectable.

Audit Event Categories

Authentication
Login, Logout, Register, Failed Login, Token Refresh
Agent Lifecycle
Create, Deploy, Update, Stop, Delete, Permission Change
Trading
Signal Generated, Position Opened/Closed, Order Rejected
Security
Capability Denied, Rate Limited, Integrity Violation
System
Settings Changed, API Key Rotated, Tier Upgraded, Cron Executed

Audit Record Structure

Every audit record contains:

Immutability guarantee: Audit records are insert-only with cryptographic chaining. There is no UPDATE or DELETE path for audit data. The SHA-256 hash chain ensures any modification or deletion of entries is detectable via the /api/observability/audit/verify admin endpoint.

Retention & Access Policy

11. Distributed Request Tracing & OTLP Export

Every inbound request is assigned a unique correlation ID that propagates through the entire request lifecycle, with W3C Trace Context compatibility and configurable sampling:

This enables end-to-end incident investigation: from the initial HTTP request through AI provider calls, database operations, and audit events — all linked by a single ID.

Configurable Trace Sampling

Sampling is fully configurable via the TRACE_SAMPLE_RATE environment variable (default: 1.0 = 100%):

OTLP Export (OpenTelemetry)

A native OTLP HTTP JSON exporter sends completed traces to any OpenTelemetry-compatible backend (Jaeger, Grafana Tempo, Datadog, etc.) — zero npm dependencies, pure fetch(). Configured via OTLP_ENDPOINT (disabled when empty). Batch size and flush interval are configurable; a final flush runs on SIGTERM for graceful shutdown.

Tracing Privacy & Retention

12. Supervised Message Bus & Content Guard

All inter-agent and swarm room communication passes through a dedicated content inspection layer before broadcast:

The content guard runs synchronously before message dispatch — blocked content never reaches other participants. Each pattern category can be independently enabled or disabled via configuration.

13. Behavioral Monitor & Auto-Isolation

A rolling-window anomaly detection system tracks per-agent behavior patterns and auto-escalates when thresholds are exceeded:

Anomaly TypeThresholdWindow
Excessive trades10 trades1 hour
Excessive errors50 errors5 minutes
Excessive signals30 signals1 hour
Rapid-fire actions5 consecutive actions < 2s apartReal-time

Escalation Path

NormalAll counters OK
WarnedFirst anomaly detected
PausedRepeated anomaly — auto-isolated

14. Security Architecture Overview

Layer 1 — EdgeUser → HTTPS/TLS (Cloudflare) → Railway
Layer 2 — AuthJWT (HS256, 7d) + PBKDF2 Passwords + AES-256-GCM Keys
Layer 3 — Agent ControlACA Permissions → Content Guard → Bun Worker Isolation
Layer 4 — MonitoringBehavioral Monitor → Signed Audit Log → OTLP Trace Export

15. What We Don't Store

✓ We take a minimalist approach to data. Here is what we explicitly do not collect or store:

16. Safe Usage Guide

🛡 Privacy levels you control:

Tip: For maximum privacy, use a VPN, an incognito browser session, and connect only throwaway test API keys until you're comfortable.

17. Vulnerability Reporting

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

Have security questions? Email [email protected] or review our Open Agent Specs for full transparency into our AI systems.