Auth Gate
MonoSurf requires explicit human authorization before AI can access any site. All access is time-limited — when the grant expires, everything locks.The Model
Commands
Scopes
| Scope | Includes | Use Case |
|---|---|---|
read | Read only | Browse, search, extract content |
write | Read + Write | Post, reply, interact |
full | Everything | Alias for write |
write automatically includes read. You don’t need both.
Duration Limits
| Format | Example | Maximum |
|---|---|---|
| Minutes | 30m | — |
| Hours | 24h | — |
| Days | 7d | 28d |
write 24h. Maximum: 28d.
How Credentials are Protected
Login (One-Time)
- Opens Chrome browser to site’s login page
- Human logs in manually
- MonoSurf extracts cookies via CDP
- Cookies encrypted and stored in macOS Keychain
- Cookies removed from Chrome profile
Per-Request Flow
Grant Expiry
When a grant expires:- Keychain access is blocked by the gate
- Chrome tabs don’t receive cookies
- Sites show logged-out content
- Write operations are refused
expires_at < now on every request.
Storage Architecture
Reusable Library
The auth gate is implemented aslib-auth-gate — a standalone Rust library that any tool can use:
Comparison with Kernel-CLI
| MonoSurf Auth Gate | Kernel-CLI OTP | |
|---|---|---|
| Human proof | CLI command | Email OTP |
| Token signing | Local (no server) | Server Ed25519 |
| Scope | read / write | observe / control |
| Duration | 30m to 28d | 10m to 4h |
| Storage | Keychain (local) | File + signature |
| Use case | Social media access | OS-level control |
Security Model by App Type
OpenCLIs tools have different verification levels depending on how they’re accessed:Web Apps (Always Verified)
Web apps (monolex-web, session-gateway) require authentication on every request. All traffic passes through Cloudflare Workers with D1 verification. There is no anonymous mode — login is mandatory.
CLI Tools (Verification Optional)
CLI tools (monosurf, niia) can run locally without any server connection. This creates two modes:
Logged in:
- Server verification on every command (quota check via D1)
- Usage tracking + billing attribution
- Plugin tamper detection via server checksum
- Subscription benefits (unlimited quota, per-dev access)
- D1 cost covered by subscription revenue
- No server calls (D1 cost = $0)
- No verification, no tracking, no protection
- Official plugins (
source: openclis) still work - Non-official plugins (partner/dev/local) require login
- Local checksum only — user’s responsibility