File Reader Skill
Enable your Moltbot agent to read local files.
File Reader
Allow your AI agent to read contents of local files on the system.
What It Does
- Read text files (txt, md, json, yaml, etc.)
- Read source code files
- Read configuration files
- Access logs and data files
Install / Enable
# .env
SKILL_FILE_READ_ENABLED=true
SKILL_FILE_READ_PATHS=/home/user/documents,/home/user/projectsPermissions Required
| Permission | Description |
|---|---|
| File System | Read access to specified paths |
Example Commands
User: Read the config.json file
Agent: [Reads /home/user/projects/config.json]
Here's the content:
{
"version": "1.0.0",
"debug": false
}
User: What's in the README?
Agent: [Reads README.md]
The README contains project documentation...
User: Show me the last 20 lines of the error log
Agent: [Reads /var/log/app/error.log, last 20 lines]
Here are the recent errors...Configuration
| Variable | Description | Default |
|---|---|---|
SKILL_FILE_READ_ENABLED | Enable the skill | false |
SKILL_FILE_READ_PATHS | Allowed directories (comma-separated) | none |
SKILL_FILE_READ_MAX_SIZE | Max file size in bytes | 1048576 |
SKILL_FILE_READ_EXTENSIONS | Allowed file extensions | * |
Restricting Access
Allow specific directories:
SKILL_FILE_READ_PATHS=/home/user/documents,/home/user/projectsRestrict file types:
SKILL_FILE_READ_EXTENSIONS=txt,md,json,yaml,yml,js,ts,pyLimit file size:
SKILL_FILE_READ_MAX_SIZE=102400 # 100KBRisks
Sensitive Data Exposure: Agent might read files containing secrets, passwords, or private information.
Prompt Injection via Files: Malicious content in files could manipulate the agent's behavior.
Best Practices
- Limit to specific directories - Never allow root access
- Restrict file extensions - Block binary and sensitive file types
- Set size limits - Prevent reading huge files
- Exclude sensitive files - .env, credentials, private keys
- Audit file access - Log which files are read
Sensitive Files to Exclude
# These paths should never be accessible:
# /.env
# /etc/shadow
# /etc/passwd
# ~/.ssh/
# ~/.aws/
# Any file with "secret", "password", "key" in the nameTroubleshooting
File not found
- Check path is within
SKILL_FILE_READ_PATHS - Verify file exists:
ls -la /path/to/file - Check Docker volume mappings
Permission denied
- Container user lacks read permissions
- See Permission Denied
File too large
- Increase
SKILL_FILE_READ_MAX_SIZE - Or read file in chunks/sections
Alternatives
- PDF Reader - For PDF documents
- CSV Handler - For spreadsheet data