Quick Start
How It Works
Workspace containment operates through three key mechanisms:| Mechanism | Purpose | Implementation |
|---|---|---|
| Path Resolution | Resolve paths against workspace root | workspace.resolve(path) |
| Containment Check | Verify paths stay within boundaries | workspace.contains(path) |
| Access Control | Enforce read/write permissions | Access mode validation |
Configuration Options
Workspace Access Modes
Workspace Configuration
| Option | Type | Default | Description |
|---|---|---|---|
root | Path | required | Absolute workspace directory (auto-created; refuses /) |
access | "rw", "ro", "none" | "rw" | Read-write, read-only, or copy-on-write sandbox |
scope | "shared", "session", "user", "agent" | "session" | Workspace scope level |
session_key | Optional[str] | None | Session identifier for scope resolution |
BotConfig Workspace Fields
| Option | Type | Default | Description |
|---|---|---|---|
workspace_dir | Optional[str] | None → ~/.praisonai/workspaces/<scope>/<session_key> | Override workspace path |
workspace_access | str | "rw" | Access mode |
workspace_scope | str | "session" | Scope level |
Common Patterns
Scope Selection Guide
Advanced Path Operations
Read-Only Workspace
Best Practices
Choose the Right Scope
Choose the Right Scope
Use
"session" (default) for most chat bots to isolate conversations. Use "shared" only when agents need to collaborate on files. Use "user" for personal assistants. Use "agent" for specialized single-purpose bots.Security by Construction
Security by Construction
Workspaces reject filesystem root access, resolve symlinks to prevent macOS issues, and validate all path operations. Never bypass workspace containment in production deployments.
Default Path Layout
Default Path Layout
The default workspace structure is
~/.praisonai/workspaces/<scope>/<session_key>/. This ensures clean separation and predictable file organization across different deployment scenarios.Backward Compatibility
Backward Compatibility
File tools fall back to
os.getcwd() when no workspace is configured, maintaining compatibility with existing code. Bots automatically apply workspace containment for security.Related
Bot Default Tools
Auto-injected tools that work with workspaces
Self-Improving Skills
How skills interact with workspace containment

