Security Model
Since tinykit is self-hosted (one server = one team), there’s no multi-tenant isolation. All authenticated users can access all projects on that instance.
What’s Protected
| Layer | Protection |
|---|---|
| Builder access | Pocketbase authentication required for /tinykit |
| API keys | Stored server-side in .env, never sent to browser |
| File operations | Scoped to workspace directory |
| Preview | Sandboxed iframe with restricted permissions |
| Database | Pocketbase with collection-level access rules |
Built-in Protections
tinykit includes several security measures out of the box:Authentication
Pocketbase auth with JWT tokens and automatic refresh
Path Traversal Protection
All file paths validated,
../ attacks blockedOrigin Checking
Cross-origin requests blocked for data APIs
Sandboxed Preview
Preview runs in isolated iframe with
allow-scripts allow-same-originServer-side Secrets
API keys and credentials never exposed to client
Pocketbase Proxy
Database accessed via same-origin proxy at
/_pb/Production Checklist
Before exposing your tinykit instance to the public:1
Protect the Builder
The
/tinykit path gives full access to your codebase. Add authentication before going public.2
Use Environment Variables
Never hardcode API keys or secrets. Use
.env for configuration.3
Enable HTTPS
Railway and most platforms provide HTTPS automatically. Never run without it.
4
Set Up Monitoring
Watch for unusual traffic patterns or error spikes.
Scheduling PocketBase Backups
Your PocketBase database (pb_data) contains all your data. Regular backups are essential.
Manual Backups
Access the PocketBase admin at/_pb/_ and use the built-in backup feature under Settings > Backups.
Automated Backups
- Cron + Docker
- Volume Snapshot
Create a backup script and schedule it with cron:Schedule with cron:
Adding Authentication
To protect the/tinykit route, you have several options:
- PocketBase Auth (Built-in)
- Reverse Proxy
- IP Whitelist
tinykit uses PocketBase for authentication. Create users in the PocketBase admin (
/_pb/_) and they can log in to access the builder.- Email/password authentication
- JWT tokens with automatic refresh
- Per-user accounts
Reporting Vulnerabilities
Found a security issue? Please report it responsibly:Report a Vulnerability
Open a private security advisory on GitHub