{"_id":"@aefree/pi-safety-rails","_rev":"4-96deb6d2720ecb5f4c5eb0a2f1ee1d7b","name":"@aefree/pi-safety-rails","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.4":{"name":"@aefree/pi-safety-rails","version":"0.1.4","keywords":["pi-package"],"license":"MIT","_id":"@aefree/pi-safety-rails@0.1.4","maintainers":[{"name":"aefree","email":"aaron@secretcrush.net"}],"homepage":"https://github.com/aefreedman/pi-safety-rails#readme","bugs":{"url":"https://github.com/aefreedman/pi-safety-rails/issues"},"pi":{"extensions":["./extensions/tool-output-redactor.ts","./extensions/path-permissions.ts"]},"dist":{"shasum":"02aec6992b5e97464c2c72f93dd1e0e364d0c7a2","tarball":"https://registry.npmjs.org/@aefree/pi-safety-rails/-/pi-safety-rails-0.1.4.tgz","fileCount":9,"integrity":"sha512-VLD9SrHBFgScGQ2xa3F4/zvBfrBPrbkcG9L/3Ro7eQlG/3Btgj158UwzW7GYBCKSn5dM623sSffhIvBPZRTCBw==","signatures":[{"sig":"MEYCIQDTKgIeAdQiE2/evhde5/2dXyRYnGlz1nSUo0nY5lba8gIhAK+ZTTHLtDh8aO1ytsOybz11Q9SYxI1KjvMvInB0UUlM","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16067},"type":"module","gitHead":"87749d7b2a9cf9639391f8e0cc28b159f5bf6a85","scripts":{"test":"tsx --test tests/*.test.ts"},"_npmUser":{"name":"aefree","email":"aaron@secretcrush.net"},"repository":{"url":"git+ssh://git@github.com/aefreedman/pi-safety-rails.git","type":"git"},"_npmVersion":"11.6.2","description":"Pi safety-focused extensions for shell execution and tool result hygiene.","directories":{},"_nodeVersion":"24.13.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"4.23.9"},"peerDependencies":{"@earendil-works/pi-coding-agent":"*"},"peerDependenciesMeta":{"@earendil-works/pi-coding-agent":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/pi-safety-rails_0.1.4_1786019026205_0.4826758490395242","host":"s3://npm-registry-packages-npm-production"}},"0.1.5":{"name":"@aefree/pi-safety-rails","version":"0.1.5","keywords":["pi-package"],"license":"MIT","_id":"@aefree/pi-safety-rails@0.1.5","maintainers":[{"name":"aefree","email":"aaron@secretcrush.net"}],"homepage":"https://github.com/aefreedman/pi-safety-rails#readme","bugs":{"url":"https://github.com/aefreedman/pi-safety-rails/issues"},"pi":{"extensions":["./extensions/tool-output-redactor.ts","./extensions/path-permissions.ts"]},"dist":{"shasum":"7a938e7f0f52a1108dc8c267d413ecd72f7d2150","tarball":"https://registry.npmjs.org/@aefree/pi-safety-rails/-/pi-safety-rails-0.1.5.tgz","fileCount":9,"integrity":"sha512-cRGHqUqF36Tv8H3g+FgTMWaUr4cRmQzUxXHqYRNBoT2Zc+LQwPkkaPxs+EMee/yjk9QfvNUb5IMZwx3awXEGtQ==","signatures":[{"sig":"MEYCIQD92WTQywL+KK3HHq51UYrtoHgAikg6am/F6gEMgjuRfQIhAONfcXIn+kG6JsttyN+V8D/SJCnWQ+XnPZl+R+A+oueD","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIE4ATJwNuI67pGZ+eZS209NiRZzgtejuvSjOTtsFIDHJAiEAtJqkxf+r07kms52ilj2KdwKG+uhgfaaDM2G2JKISEUE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@aefree%2fpi-safety-rails@0.1.5","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":15858},"type":"module","gitHead":"82009cc81803c2ea46baab50b8b71c77b83306f0","scripts":{"test":"tsx --test tests/*.test.ts"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:d8ce90fd-4bb2-49d1-8bf5-403b754861f1"}},"repository":{"url":"git+ssh://git@github.com/aefreedman/pi-safety-rails.git","type":"git"},"_npmVersion":"11.5.1","description":"Pi safety-focused extensions for shell execution and tool result hygiene.","directories":{},"_nodeVersion":"22.14.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"4.23.9","@earendil-works/pi-coding-agent":"0.86.1"},"peerDependencies":{"@earendil-works/pi-coding-agent":"*"},"peerDependenciesMeta":{"@earendil-works/pi-coding-agent":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/pi-safety-rails_0.1.5_1789915177034_0.816962952154672","host":"s3://npm-registry-packages-npm-production"}},"0.1.6":{"name":"@aefree/pi-safety-rails","version":"0.1.6","keywords":["pi-package"],"license":"MIT","_id":"@aefree/pi-safety-rails@0.1.6","maintainers":[{"name":"aefree","email":"aaron@secretcrush.net"}],"homepage":"https://github.com/aefreedman/pi-safety-rails#readme","bugs":{"url":"https://github.com/aefreedman/pi-safety-rails/issues"},"pi":{"extensions":["./extensions/tool-output-redactor.ts","./extensions/path-permissions.ts"]},"dist":{"shasum":"bd2f11b4dc47c59238e864d33640aaf2c00893ad","tarball":"https://registry.npmjs.org/@aefree/pi-safety-rails/-/pi-safety-rails-0.1.6.tgz","fileCount":9,"integrity":"sha512-f5JkT1wqMErYiKVjq8lYZlWl244pDMDqcTkCn2FuVvYl2iIvbiPlIYz9cr/cZXxo+4kTRHYpBOfHj+JKFSOixw==","signatures":[{"sig":"MEUCIQDSSUh5Tz1Lbj143LDlK7N+7zH4Xc52AaqtCO5b4Rd5ZwIgJbi02+T/+rfRMdTllE6ZbWuOFS9+Imq6CwznlfFNCdU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEYCIQDUQKZSfchRJBXkgROwcvQY4QkoIzTWJy1iZC+mA5Gc4QIhANEI82b0StU15O+mqa5iZfAfbzATYCH5REJukc2NPo1x","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@aefree%2fpi-safety-rails@0.1.6","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":15858},"type":"module","gitHead":"a57efce9f73f5a96dfadf2c65e8e58ef923e450d","scripts":{"test":"tsx --test tests/*.test.ts"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:d8ce90fd-4bb2-49d1-8bf5-403b754861f1"}},"repository":{"url":"git+ssh://git@github.com/aefreedman/pi-safety-rails.git","type":"git"},"_npmVersion":"11.5.1","description":"Pi safety-focused extensions for shell execution and tool result hygiene.","directories":{},"_nodeVersion":"22.14.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"4.23.9","@earendil-works/pi-coding-agent":"0.87.0"},"peerDependencies":{"@earendil-works/pi-coding-agent":"*"},"peerDependenciesMeta":{"@earendil-works/pi-coding-agent":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/pi-safety-rails_0.1.6_1790020923469_0.34303047487549443","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"pi":{"extensions":["./extensions/tool-output-redactor.ts","./extensions/path-permissions.ts"]},"_id":"@aefree/pi-safety-rails@0.2.0","bugs":{"url":"https://github.com/aefreedman/pi-safety-rails/issues"},"dist":{"shasum":"56db6bdf5b97b7f348cc6f877e631ba63034d0e8","tarball":"https://registry.npmjs.org/@aefree/pi-safety-rails/-/pi-safety-rails-0.2.0.tgz","fileCount":9,"integrity":"sha512-YYtznwwTeUR5IcMqt2IeihNnbL5VIIgha5I/QACmbJ8ojvJVQ8L3du4UQKeYMAoS49KqQFXAEx0L7nq93Y1h6g==","signatures":[{"sig":"MEYCIQDCP2XxxC096lyZUX2dBFnTIqOJe94LqHg2ajUBR8p7JAIhAPCrkP0ggSR9Dtteioosk2aoSIpt5waV0j5FaPs/7PIP","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQClYo+0y1omlDv7Dcr+e1qXBBtLpWwBaRPtApgYRZgoSgIhAMUqCVasb9bDGugB1ejYFwhawUSbWNs+DotLrYLKcMoW"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@aefree%2fpi-safety-rails@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":16887},"name":"@aefree/pi-safety-rails","type":"module","engines":{"node":">=22.19.0"},"gitHead":"298cf3e72df13363139c4424eaf9a4aeab2e3d8b","license":"MIT","scripts":{"test":"tsx --test tests/*.test.ts"},"version":"0.2.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"d8ce90fd-4bb2-49d1-8bf5-403b754861f1"}},"homepage":"https://github.com/aefreedman/pi-safety-rails#readme","keywords":["pi-package"],"repository":{"url":"git+ssh://git@github.com/aefreedman/pi-safety-rails.git","type":"git"},"_npmVersion":"11.5.1","description":"Pi safety-focused extensions for file-tool path permissions and tool result hygiene.","directories":{},"maintainers":[{"name":"aefree","email":"aaron@secretcrush.net"}],"_nodeVersion":"22.19.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"4.23.15","@earendil-works/pi-coding-agent":"0.99.1"},"peerDependencies":{"@earendil-works/pi-coding-agent":"*"},"peerDependenciesMeta":{"@earendil-works/pi-coding-agent":{"optional":true}},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pi-safety-rails_0.2.0_1790733447293_0.21946885426741303"}}},"time":{"created":"2026-08-06T12:23:46.007Z","modified":"2026-09-30T01:57:27.720Z","0.1.4":"2026-08-06T12:23:46.348Z","0.1.5":"2026-09-20T14:39:37.120Z","0.1.6":"2026-09-21T20:02:03.561Z","0.2.0":"2026-09-30T01:57:27.382Z"},"bugs":{"url":"https://github.com/aefreedman/pi-safety-rails/issues"},"license":"MIT","homepage":"https://github.com/aefreedman/pi-safety-rails#readme","keywords":["pi-package"],"repository":{"url":"git+ssh://git@github.com/aefreedman/pi-safety-rails.git","type":"git"},"description":"Pi safety-focused extensions for file-tool path permissions and tool result hygiene.","maintainers":[{"name":"aefree","email":"aaron@secretcrush.net"}],"readme":"# Pi Safety Rails\n\nPi package containing safety-focused extensions for file-tool path permissions and tool-result hygiene.\n\n## Requirements\n\n- Node.js >=22.19.0.\n- Latest stable Pi (validated with 0.99.1). These extensions run inside the Pi host; the optional Pi peer is not a standalone-library contract.\n\n## Included extensions\n\n- `tool-output-redactor`\n- `path-permissions`\n\n## Purpose\n\nThis package provides practical safety rails for Pi:\n\n- redact token-like secrets from tool outputs before they reach the model/session\n- block sensitive filesystem paths through deny-only path permissions\n\n## Tool output redaction\n\n- Redacts token-like secrets from tool outputs before they are shown to the model/session.\n- Applies to text content and nested string fields in tool result details and structured content.\n- Preserves clean structured results when text is redacted, so typed tool callers retain their data.\n\n## Path permissions\n\n- Deny-only path blocking for the six file-oriented tools listed below.\n- Not a sandbox or shell containment: rules do not block `bash`, other shell commands, or arbitrary/custom tools. Tool-output redaction does not prevent secret access or execution and cannot guarantee detection of every secret.\n- Current v1 target tools:\n  - `read`\n  - `write`\n  - `edit`\n  - `grep`\n  - `find`\n  - `ls`\n- Configuration files:\n  - user-global: `~/.pi/agent/path-permissions.json`\n  - project-local overlay: `.pi/path-permissions.json`\n- The first version intentionally ignores allow rules and only honors `deny`.\n\nExample config with Windows and macOS paths:\n\n```json\n{\n  \"permission\": {\n    \"external_directory\": {\n      \"C:/Windows/**\": \"deny\",\n      \"/Users/yourname/Library/Keychains/**\": \"deny\"\n    },\n    \"edit\": {\n      \"C:/Windows/**\": \"deny\",\n      \"/Users/yourname/.ssh/**\": \"deny\"\n    }\n  }\n}\n```\n\nReplace `yourname` with the macOS account name. A trailing `/**` denies both the named directory and its descendants, without matching sibling prefixes.\n\nDeny matching is case-insensitive on Windows and macOS, while denial messages retain the path's original display casing. macOS matching deliberately fails closed: it remains case-insensitive even on a case-sensitive APFS volume, so a differently cased path can be conservatively denied there. Linux matching remains case-sensitive.\n\nRules are evaluated against both the supplied path and its canonical filesystem destination. Existing symlinks and Windows junctions therefore cannot redirect access into a denied directory; for new files, the nearest existing ancestor is canonicalized before matching.\n\nA copy also ships in this package as `path-permissions.example.json`.\n\n## Install\n\nInstall from npm:\n\n```bash\npi install npm:@aefree/pi-safety-rails\n```\n\nFor local development:\n\n```bash\npi install <path-to-pi-safety-rails>\n```\n\n## License\n\nMIT. See `LICENSE`.\n","readmeFilename":"README.md"}