Trust & Security.

Security is not a feature — it is the foundation. Every layer of The Intern stack is designed with security and user control as the primary constraint.

Authentication

All API requests require a valid Firebase JWT in the Authorization: Bearer header. Tokens are verified on every request at the Cloudflare edge. The Firebase project (theintern007) supports email/password and Google OAuth. Session tokens expire and are refreshed automatically by the frontend.

Authorization (RBAC)

Every database query is scoped to the authenticated userId. Users can only read and write their own agents, conversations, memories, and workspace files. The orchestrator enforces role-based access — agents cannot access data outside their assigned scope.

Secrets management

API keys (Anthropic, Twilio, Stripe, ElevenLabs) are stored as Cloudflare Workers Secrets — never in environment variables or code. User BYOK keys are stored encrypted in the users.preferences JSON column in Neon PostgreSQL.

Pending decisions

High-risk actions create a record in the pending_decisions table with decisionType, context, and status: pending. The agent pauses and waits for human approval. Decisions are reviewed at /dashboard/decisions. Approved decisions set status: approved and the agent proceeds. Rejected decisions are final.

Audit log

Every agent action is logged with timestamp, action type, userId, agentId, and outcome. The credit_transactions table provides a financial audit trail. The messages table stores the full conversation history including tool calls.