Expand description
Session workspace management for sandboxed file operations
This module provides utilities for creating and managing session-specific workspace directories. All file operations, shell commands, and tool calls are scoped to the session’s workspace directory for security and isolation.
§Security Features
- Path Traversal Prevention: All paths are validated to ensure they resolve within the workspace
- Symlink Validation: Symlinks are checked to ensure their targets are within the workspace
- Dangerous Path Blocking: Paths containing null bytes, control characters, or suspicious patterns are rejected
- Depth Limiting: Maximum path component depth is enforced to prevent abuse
- Race Condition Mitigation: Time-of-check-time-of-use (TOCTOU) considerations are documented
Structs§
- Session
Workspace - Session workspace configuration
Enums§
- Workspace
Error - Errors that can occur during workspace operations
Functions§
- cleanup_
old_ sessions - Clean up old session workspaces that are older than the specified duration
- get_
sessions_ base_ dir - Get the base directory for session workspaces
- is_
shell_ command_ allowed - Blocked shell command patterns for additional security
Type Aliases§
- Workspace
Result - Result type for workspace operations