Skip to contents

Convenience function to create a PreToolUse hook that applies Deputy's canonical file-write permission policy to write_file, edit_file, and multi_edit. Prefer configuring Permissions as the Agent's authority policy; this helper is useful as an additional hook-level restriction.

Usage

hook_limit_file_writes(allowed_dir)

Arguments

allowed_dir

Existing directory where writes are allowed. The path is canonicalized when the hook is created.

Value

A HookMatcher object

See also

Examples

if (FALSE) { # \dontrun{
dir.create("output", showWarnings = FALSE)
agent$add_hook(hook_limit_file_writes("output"))
} # }