Security Model
Ideon secures requests at multiple layers: proxy, API route validation, database row level security in Postgres, and WebSocket authorization.
Proxy Security Headers
The proxy applies these headers to pages and API routes:
- Content Security Policy: Restricts content to the same origin, with a per-request nonce for scripts. Framing is blocked with
frame-ancestors 'none', and plugins withobject-src 'none'. - Framing and sniffing:
X-Frame-Options: DENYandX-Content-Type-Options: nosniff. - Referrer and permissions:
Referrer-Policy: strict-origin-when-cross-origin, and camera, microphone and geolocation are disabled. - HTTPS: When
APP_URLstarts withhttps://, Ideon adds HSTS (one year, including subdomains) andupgrade-insecure-requests.
The MCP endpoint (/api/mcp) and webhook endpoints (/webhooks/...) are served before the Next.js proxy runs, so these headers and the session check do not apply to them. They have their own authentication, described below.
Authentication and Authorization
- Auth is handled by NextAuth with JWT sessions. The session cookie is
httpOnlyandSameSite=Lax, and is markedsecurewhenAPP_URLis HTTPS. - API routes enforce authentication with shared server utilities, and project routes check the caller's role before running.
- Admin endpoints require admin or superadmin roles.
- Passwords are hashed with Argon2.
API Keys
API keys (sk-ideon-...) are stored as SHA-256 hashes and act as the user who created them, with the same project roles. They are accepted only by the MCP endpoint and by webhook endpoints. All other API routes use the session cookie.
Secrets and Encryption
All internal secrets are derived from SECRET_KEY with HKDF-SHA256: the session signing secret, the encryption key and the proxy authentication token secret.
- Stored credentials: Git tokens and Vercel tokens are encrypted with AES-256-GCM, using a per-user salt.
- Password reset tokens are stored as HMAC hashes and expire after one hour.
- Rotating
SECRET_KEYinvalidates every active session. Credentials encrypted with the previous key can no longer be decrypted, so users have to enter their Git and Vercel tokens again.
Rate Limits
| Target | Limit |
|---|---|
| Sign-in attempts | 5 per 15 minutes per identifier |
| Registration | 5 per 10 minutes |
| Forgot and reset password | 5 per 10 minutes per identifier |
| User invitations | 10 per hour per user |
| MCP requests | 60 per minute per API key |
| Webhooks | 30 per minute per webhook block |
Production deployments on Postgres share the sign-in and account limits across instances. Development uses in-memory counters.
Database Row Level Security
Postgres uses row level security policies to scope data access per user. Each request sets app.current_user_id before DB queries. Public share links use a separate app.share_token setting that only exposes the shared project.
WebSocket Authorization
Realtime connections validate the user session and ensure the user has access to the requested project document. In production, the Origin header of the upgrade request must match APP_URL. Viewers can read a canvas but their changes are discarded, and the attempt is recorded in the audit trail.
Shell Block
The Shell block starts a real terminal on the host that runs Ideon. The shell process inherits the environment of the Ideon server, including its secrets. Only the project creator and project owners can start one, and SHELL_MAX_SESSIONS=0 disables the feature. Leave it disabled on instances shared with people you do not fully trust.
SSRF Protection
Link previews, image proxying, Git statistics and repository sync validate URLs and block restricted destinations before fetching. Use GIT_ALLOWED_HOSTS to explicitly allow internal Git servers.