Overview
IronClaw stores all data locally in your PostgreSQL database (or libSQL for embedded deployments). No information is sent to external services except when you explicitly use tools that make API calls.Data Storage Architecture
Local-First Architecture
No Cloud Dependencies
IronClaw is designed to work entirely offline:- Database: Local PostgreSQL or libSQL file
- Vector search: pgvector extension (no external embedding API)
- Tool execution: Local WASM runtime
- Secrets: Encrypted in local database
The only external connections are to LLM providers (OpenAI, Anthropic, etc.) when you explicitly send a message. You control which provider via configuration.
Data Ownership
You own all your data:- Conversations: Stored in
conversationsandmessagestables - Workspace: Files in
workspace_entriesandmemory_chunks(for vector search) - Secrets: Encrypted in
secretstable - Job history:
jobs,job_events,llm_callsfor full audit trail - Settings:
settingstable (user preferences)
Database Backends
PostgreSQL (Default)
Recommended for:- Desktop installations
- Multi-user deployments
- High-volume usage
PostgreSQL provides ACID guarantees, concurrent access, and native vector search with pgvector.
libSQL (Embedded)
Recommended for:- Single-user installs
- Edge deployments
- Portable installations (no server required)
Encryption
Secrets Encryption
All credentials are encrypted with AES-256-GCM:- Algorithm: AES-256-GCM (authenticated encryption)
- Key derivation: HKDF-SHA256 with per-secret salt
- Master key: From OS keychain or
SECRETS_MASTER_KEYenv var
Database Encryption at Rest
IronClaw does not encrypt the database itself, but you can: PostgreSQL:- Enable full-disk encryption (LUKS, BitLocker, FileVault)
- Use encrypted tablespaces
- Encrypt database backups
- Store
.dbfile on encrypted filesystem - Use Turso with server-side encryption
Only secrets are encrypted within the database. Conversations, workspace files, and settings are stored in plaintext (but protected by filesystem permissions).
Data Categories
Conversations
Tables:conversations, messages
Contains:
- Message history (user and assistant messages)
- Conversation metadata (title, created_at, updated_at)
- Tool calls and results (for audit trail)
- No automatic deletion
- User can delete conversations manually
- LLM context window limits apply (older messages dropped from active context)
Workspace Files
Tables:workspace_entries, memory_chunks
Contains:
- Files stored in the workspace (notes, logs, context)
- Vector embeddings for semantic search
- Metadata (path, size, created_at, updated_at)
- No automatic deletion
- User controls file lifecycle via workspace commands
Embeddings are generated locally if you use a local embedding model, or via API if you use OpenAI/Voyage/etc.
Job History
Tables:jobs, job_events, llm_calls, sandbox_jobs
Contains:
- Full execution log for every job
- LLM requests/responses (input/output tokens, cost)
- Tool invocations (parameters, results, errors)
- Docker sandbox executions (for code execution)
- No automatic deletion by default
- Grows unbounded (implement custom cleanup if needed)
Secrets
Table:secrets
Contains:
- Encrypted API keys, tokens, passwords
- Metadata (provider, expires_at, last_used_at, usage_count)
- Manual deletion only
- Expired secrets remain in database (inaccessible)
Settings
Table:settings
Contains:
- User preferences (default_model, safety_config, etc.)
- Feature flags
- Bootstrap configuration (copied from env on first run)
- Persists until manually changed
- Overrides environment variables
Privacy Guarantees
No Telemetry
IronClaw has zero telemetry or analytics:- No usage tracking
- No crash reporting
- No phone-home behavior
- No update checks
The only network traffic is:
- LLM API calls when you send a message
- HTTP requests from tools you explicitly invoke
- Database connections (if using remote PostgreSQL or Turso)
No Data Sharing
IronClaw never shares your data with:- NEAR AI (unless you explicitly use NEAR AI as your LLM provider)
- Tool developers (tools run sandboxed with no network access by default)
- Third-party services (unless you configure them)
LLM Provider Privacy
When you use an LLM provider:- Messages sent: Your prompts and conversation history (within context window)
- Messages NOT sent: Workspace files, secrets, job history (unless explicitly included in context)
- Provider policies vary: OpenAI, Anthropic, etc. have their own data retention policies
Backup and Export
Database Backup
PostgreSQL:Remember to back up your master key separately. Encrypted secrets are useless without it.
Exporting Data
No built-in export format yet, but you can query directly:Data Cleanup
Manual Cleanup
Delete old data to free space:Vacuum (PostgreSQL)
After large deletions, reclaim space:Security Best Practices
For Local Deployments
- Encrypt filesystem: Use full-disk encryption (LUKS, BitLocker, FileVault)
- Restrict database access: Set PostgreSQL to listen only on localhost
- Secure master key: Use OS keychain, not environment variables
- Limit user permissions: Run IronClaw as a non-root user
- Back up regularly: Automate daily backups to encrypted storage
For Remote Deployments
- Use TLS for database: Enable SSL for PostgreSQL connections
- Firewall rules: Restrict database port to trusted IPs
- Rotate credentials: Change database passwords every 90 days
- Monitor access: Log all database connections
- Encrypt backups: Always encrypt backup files before storing
For Multi-User Deployments
- User isolation: Each user has a separate
user_idfor all data - Row-level security: Consider PostgreSQL RLS policies
- Audit logs: Enable
log_statement = 'all'in PostgreSQL - Rate limiting: Prevent one user from exhausting resources
- Quota enforcement: Limit workspace size per user
Compliance Considerations
GDPR (EU)
IronClaw itself doesn’t collect data, but if you deploy it for others:- Right to access: Provide SQL queries to export user data
- Right to erasure: Delete all rows with
user_id = $1 - Data portability: Export data in machine-readable format
- Data minimization: Only store what’s needed (consider auto-cleanup)
HIPAA (US Healthcare)
For protected health information (PHI):- Encryption at rest: Enable PostgreSQL tablespace encryption
- Encryption in transit: Use TLS for database connections
- Access controls: Implement user authentication and authorization
- Audit logs: Enable comprehensive logging for all access
- Business Associate Agreement: If using Turso or hosted PostgreSQL
Monitoring and Auditing
Database Size
Activity Logs
Disaster Recovery
Recovery Plan
- Restore database: From most recent backup
- Restore master key: From keychain backup or secure vault
- Verify secrets: Test decryption of a known secret
- Check integrity: Run
SELECT COUNT(*) FROM conversations;etc. - Test functionality: Send a test message to LLM
Recovery Time Objective (RTO)
- Local PostgreSQL: Minutes (if backup is recent)
- libSQL file: Seconds (copy backup file)
- Turso replica: Automatic (server-side redundancy)
Recovery Point Objective (RPO)
- Depends on backup frequency: Daily backups = max 24 hours data loss
- Continuous WAL archiving (PostgreSQL): Near-zero data loss
For mission-critical deployments, enable PostgreSQL continuous archiving or use Turso’s automatic replication.
Related Sections
- Credential Protection - Secrets encryption and management
- WASM Sandbox - Isolated tool execution
- Prompt Injection Defense - Input validation and sanitization
