Skip to contents

Wraps 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())

Arguments

shield

Optional DataShield whose reviewer reviews referenced file contents (NULL = report references only).

project_root

Directory the read whitelist is confined to.

Value

An ellmer::tool().

Details

Opt-in: not registered by default. Host wires it in (e.g. when running with the sandbox disabled) so the model can self-audit external references.