SECURITY

Security Policy

UseAI's cryptographic design, authentication model, and vulnerability reporting process.

CRYPTO

Ed25519 Hash Chain

Every session record is part of a hash chain that provides tamper evidence. If any record is modified, deleted, or reordered, the hash chain breaks and verification fails.

01

Record

Each record (session_start, heartbeat, session_end, session_seal) is serialized to JSON.

02

Hash

SHA-256(record_json + prev_hash) produces the record's hash, linking it to the previous record.

03

Sign

The hash is signed with your Ed25519 private key: Ed25519_sign(hash, private_key).

04

Chain

The record's hash becomes the prev_hash for the next record, forming an append-only chain.

Session Seal

When a session ends, a session_seal record captures summary data and two chain anchors:

chain_start_hash — hash of the first record in the session
chain_end_hash — hash of the last record
seal_signature — Ed25519 signature over the seal

The seal provides a compact, verifiable summary of the session without requiring the full chain.

KEYS

Key Management

KEY GENERATION

On first use, UseAI generates an Ed25519 key pair. The private key is encrypted with AES-256-GCM using machine-specific entropy and stored in ~/.useai/keystore.json.

KEY REGISTRATION

You can register your public key with the server. This allows the server to verify that synced sessions were signed by your key, enabling the verified badge on your profile.

Keystore Structure

{
"public_key_pem": "-----BEGIN PUBLIC KEY-----\\n..."
"encrypted_private_key": "hex-encoded ciphertext"
"iv": "hex-encoded 12-byte IV"
"tag": "hex-encoded GCM auth tag"
"salt": "hex-encoded 32-byte salt"
"created_at": "ISO timestamp"
}
VERIFICATION

Verification Tiers

VERIFIED

The user has registered a public key with the server. Ed25519 signatures are valid and the hash chain is intact.

UNVERIFIED

No public key registered. Signatures cannot be validated server-side. Could be from an older version or an unsigned session.

AUTH

Authentication

UseAI uses OTP (one-time password) authentication:

01

Request OTP

User requests a one-time password via email at useai.dev

02

Enter OTP

User enters the OTP in the CLI (useai login)

03

JWT Token

Server returns a JWT token stored locally in ~/.useai/config.json

  • No passwords are stored — OTP-only authentication
  • No OAuth tokens — UseAI does not connect to GitHub, Google, or other providers
  • JWT tokens have server-defined expiry; re-authenticate with useai login when expired
REPORT

Vulnerability Reporting

If you discover a security vulnerability in UseAI, please report it responsibly. Do not file public issues for security vulnerabilities.

We aim to acknowledge reports within 48 hours and provide a fix timeline within 7 days.