# Security-First Architecture ✅ (+ Boss Level)
Security-First Architecture ✅ (+ Boss Level)
Built secure foundations BEFORE writing more features. .env.agents single source of truth, 4-tier credential hierarchy, and a wrapper script that keeps MCP configs public-safe.
Tier hierarchy (treat them differently or you'll mix them up)
🔴 Tier 1 Critical — Supabase service_role, Stripe secret → rotate immediately
🟠 Tier 2 Sensitive — n8n tokens, admin access tokens → rotate within 24h
🟡 Tier 3 Restricted — anon keys, scoped API keys → weekly/monthly
🟢 Tier 4 Public — URLs, doc links → commit-safe
Challenge deliverables
• .env.agents with 7 credentials grouped by tier (gitignored, mode 600)
• .env.agents.example committed as template with tier sections
• .gitignore widened to .env* with !*.example exceptions — future env files caught automatically
• Git history grep: clean across 4 git repos audited
Boss Level — secure MCP wrapper (+300 XP)
scripts/secure-mcp-wrapper.sh reads .env.agents at runtime then execs the MCP server. Refuses to start if .env.agents is missing (fail loud), warns if perms aren't 600. Result: .mcp.json contains zero secrets — safe to commit, safe to screenshot.
Engineering note (the bug I caught while writing the wrapper)
First version used `source <(grep ... ENV_FILE)` to strip comments. `set -a` exports didn't propagate through process substitution, so vars came out empty in the child process. Fix: bash handles # comments natively on source — drop the grep filter, source the file directly. Verified 31-char key load.
Takeaway
Security-first isn't security-only. It's making sure the boring infrastructure (where secrets live, how they get loaded, who can read them) is correct BEFORE you add the exciting features. 30 minutes of setup now > one Friday-night incident response later.
#SecurityFirst #EnvAgents #RLSEnabled
2
2 comments
Alex Saumell
4
# Security-First Architecture ✅ (+ Boss Level)
FounderOS
skool.com/foundeross
Run your company with FounderOS. Turn your knowledge into AI context, connect real workflows, and build alongside other founders.
Leaderboard (30-day)
Powered by