Build the AuditCode tool (pluggable static code-safety auditor)
Source:R/code_audit.R
audit_code_tool.RdWraps the deterministic audit pipeline (.audit_code_impl()) as an
ellmer::tool() the main-loop model can call to check whether a block of R
code safely references external scripts/data before running it. The tool
NEVER gives the model (or the reviewer) a read/write/shell capability: it
deterministically extracts referenced paths (AST), enforces an in-project
source-file whitelist in code, reads only whitelisted files, and (with a
shield) hands the vetted text to the reviewer.
Usage
audit_code_tool(shield = NULL, project_root = getwd())Value
An ellmer::tool().