When an LLM writes R code, you need two things at once: a way for that code to
call back into your application, and confidence that it can’t do anything
dangerous. securer provides both.
LLM-generated code runs in a child R process that is sandboxed at the OS level. Your functions are exposed to it as tools: when the sandboxed code calls one, execution pauses, the tool runs on the host side with full access to your resources, and the result is passed back in. The model’s code never touches your filesystem, network, or data directly.
execute_r('
data <- query_db("mtcars", 5)
mean(data$mpg)
', tools = tools, sandbox = TRUE)
It is the base of a four-package stack for building governed AI agents in R, alongside securetools, secureguard, and securebench. Docs live at ian-flores.github.io/securer.