> **Symptom**: Files in `~/.hermes/cache/documents/` cannot be accessed via Markdown links, even with angle brackets
## Problem Description
When attempting to send files with long Chinese filenames from `~/.hermes/cache/documents/` directory on macOS:
1. File exists and is readable: `ls -la` confirms it
2. File is in an "allowed" cache directory
3. Markdown link uses angle brackets: `](</path/to/文件.md>)`
4.**Error**: `File is outside the session and Hermes workspaces`
## Root Cause
Hermes security policy enforces that files must be within the **session workspace** (`~/.hermes/workspace/`) or explicitly allowed directories. Even though `~/.hermes/cache/` directories are listed as "safe roots" for MEDIA protocol, the **Markdown link delivery** path has stricter restrictions that only allow files within the active workspace.
This is a **platform-specific behavior on macOS** where:
- MEDIA protocol may work for some file types in cache dirs
- Markdown links **always require** files to be in `~/.hermes/workspace/`
1.**Always prefer workspace directory** for files you want to send via Markdown links
2.**For Chinese filenames, always use angle brackets**: `](</path/文件.md>)`
3.**When in doubt, use base64** — it works everywhere and bypasses all path restrictions
4.**For large files**, consider base64 or direct content display
5.**Test file delivery early** in a session to confirm platform behavior
## Related Issues
- Windows path format: Use `C:/...` not `/c/...`
- Chinese filename parsing: Always use angle brackets
- MEDIA protocol initialization: May require gateway restart on macOS
- Cache directory restrictions: Not all "safe roots" work for Markdown links
## Key Takeaway
**On macOS, Markdown file links only work for files in `~/.hermes/workspace/`. Files in `~/.hermes/cache/` directories will fail with "File is outside the session and Hermes workspaces" error.**
Use one of these alternatives:
1. Copy file to workspace (preferred for small/medium files)
2. Use base64 encoding (works for any file, any location)