pi-guardrails: v0.19.0
Minor Changes
- ef9db31: Merge Permission Gate pattern arrays (
patterns,allowedPatterns,autoDenyPatterns) across config scopes instead of a project config replacing global entries. Previously, defining one of these arrays in.pi/extensions/guardrails.jsonsilently dropped every global pattern, including auto-deny rules. Affected configs print a one-time notice on next load. - 585841e: Add per-rule
respectCwdoption (defaulttrue) so path-treereadOnly/noAccesspolicies no longer neuter the session working directory. Location-anchored patterns (~- or/-prefixed globs like~/work/**) are skipped for targets inside the cwd, while basename globs, relative path globs, and regex patterns keep applying, so secrets stay protected everywhere. SetrespectCwd: falseon a rule to restore strict enforcement. Fixes #100.
Patch Changes
- 1aacdb1: Path extraction no longer treats non-file text as file access. Heredoc delimiters and here-strings (
cat <<'EOF') are skipped instead of surfacing the delimiter as a path; tokens that collapse to the filesystem root (cat //) are dropped; and#comments written after|,&&or||parse as the line continuations they are (via@aliou/sh0.3.3, aliou/sh#24), so comment text and paths mentioned in it never surface as candidates or false policy blocks. - 1aacdb1: Remote command argv no longer reads as local filesystem access. Path extraction drops ssh argv entirely — nothing in it is reliably a local path (
-iidentity files stay unprompted as a consequence) — and drops the kubectl tail after--, which kubectl passes to the container command per its CLI contract.ssh user@host 'cat /etc/passwd'andkubectl exec -it pod/one -- ls /appno longer prompt for/etc/passwdor/appas local paths. - ac36ad9: Stop blocking bash commands when a protected file name is passed as pure text.
echo,printf, andtrtake no file operands by their POSIX grammars, soprintf '%s\n' '.env'orecho .envno longer trigger the protected-file policy. Actual file operands keep working: reading.envwithcat, or redirecting to it (printf … > .env), stays blocked.