A tool that executes R code and returns the result. It runs in a separate process for fault isolation and timeout enforcement (requires callr).
Format
A tool definition created with ellmer::tool().
Details
This tool intentionally uses R's code evaluation capabilities to execute arbitrary R code provided by the LLM. This is a core feature for agentic workflows where the agent needs to perform data analysis or other R tasks.
The execution boundary is explicit:
Code runs in a separate callr subprocess, not an OS security sandbox
A timeout prevents runaway execution
The Permissions system can disable this tool entirely