Skip to Content
Fetlar
AI agents

Safety

Where an AI assistant may write, which folders it may index, and the limits on every call.

Fetlar assumes that the assistant calling it may have been tricked by text inside a file it read (a "prompt injection"). So the tools that write are confined, and the tools that read cannot change anything.

Reading

Reading and comparing never write. Files are read the same way as on the command line, with the same safety limits.

Writing is confined

write_office_file and fill_office_template write only under the allowed folders.

  • The allowed folders are the server's working directory, or the folders in FETLAR_MCP_WRITE_ROOTS.
  • Symbolic links and .. are resolved before the check. A link is never followed. Devices, pipes and folders are refused.
  • An existing file is replaced only when the call says overwrite: true. Ask your assistant to check with you first.
  • The extension must match the kind: .csv, .tsv, .xlsx or .docx only. No dot-files and no build or package file names, so the tool cannot create scripts or configuration files.
  • A link planted in the folder while a call runs cannot redirect the write (on Unix).
  • The file is written to a temporary file and renamed. A write that runs out of time leaves no file.
  • Word files are written in safe mode: only fields that compute from the document, and only http, https and mailto links.
  • CSV cells that start with =, +, - or @ are prefixed with ', always. A call cannot turn this off. Only FETLAR_MCP_CSV_GUARD=off in the server's environment can.
  • Excel formulas may call only functions that compute from values. IMAGE, WEBSERVICE, INDIRECT, DDE and references to other workbooks are refused. Links to anything but http, https and mailto are refused.
  • Pictures are base64 data in the JSON, or files under the allowed folders. URLs and file: links are refused. Only PNG, JPEG, GIF and BMP are accepted (no SVG).

Templates are confined too

The template and the data may both be hostile.

  • A template is read only from the template folders (FETLAR_MCP_TEMPLATE_ROOTS, otherwise the write folders). It must be a regular file with one name, one of .docx, .dotx, .xlsx or .xltx, within FETLAR_MCP_MAX_TEMPLATE_MB.
  • Macro-enabled files (.docm, .xlsm, or a file that holds a macro project) are refused.
  • A missing file, a file outside the folders and a link out of them all get the same message.
  • Everything that refers to something outside the template is removed or refused, and listed in the warnings: attached templates, signatures, add-in panes, remote pictures, embedded objects, DDE and INCLUDETEXT fields, links to other workbooks, data connections.
  • Values are text. They are escaped and never become formulas, markup or placeholders.
  • The output is the same kind as the template and follows the rules for writing.

Indexing is confined

index_add_folder works only inside a folder you allowed:

fetlar index mcp-allow ~/Documents/Contracts
fetlar index mcp-allow --list
fetlar index mcp-allow --remove ~/Documents/Contracts

Without an allowed folder, nothing can be added.

No folders are allowed: AI tools cannot add folders. Allow one with `fetlar index mcp-allow <folder>`.

Limits on every call

Each tool call runs in its own child process. A call that takes too long is stopped. Calls are handled one at a time, so one slow call delays the ones behind it.

VariableDefault
FETLAR_MCP_TIMEOUT_SECS60 seconds
FETLAR_MCP_MAX_MEMORY_MB4096 (Unix, where the system enforces it)
FETLAR_MCP_MAX_INPUT_MB50
FETLAR_MCP_MAX_TEXT_CHARS1,000,000

All variables are listed in Environment variables.

Set FETLAR_MCP_WRITE_ROOTS to one folder you are happy to have files created in. Do not set it to your home folder.

Reporting a security problem

Fetlar reads untrusted files, so a file that crashes it, hangs it or makes it use too much memory is a security bug. Please report it privately to the developer and include the file or a way to build one. Do not post it in a public place.

On this page