The filesystem gate walks every string value inDocumentation Index
Fetch the complete documentation index at: https://docs.pecta.ai/llms.txt
Use this file to discover all available pages before exploring further.
ctx.output — including nested strings inside objects and arrays — and blocks the evaluation if it finds patterns that indicate a destructive or unauthorized filesystem operation. It is designed for agents that can generate or suggest shell commands: coding assistants, DevOps automation bots, CI/CD orchestrators, and similar tools where a single bad output could wipe data or expose credentials.
All three checks are enabled by default. You can disable any of them individually through the options if your use case requires it.
Usage
What it detects
Destructive rm commands
The gate matches any of the following patterns:
| Pattern | Example |
|---|---|
rm -rf, rm -fr | rm -rf /tmp/old |
rm -Rf, rm -fR | rm -Rf ./build |
| Flags with other letters mixed in | rm -rfv /data |
| Long-form flags | rm --recursive --force /mnt |
| Reversed long-form flags | rm --force --recursive /mnt |
Path traversal
Any occurrence of.. used as a directory component — whether delimited by /, \, whitespace, or quotes — is flagged. This blocks attempts to escape a working directory such as ../../etc/passwd.
Sensitive directories
The gate flags references to the following paths:| Path | What it protects |
|---|---|
/etc | System configuration files |
/usr | System binaries and libraries |
/var | Variable data including logs and databases |
~/.ssh or /home/<user>/.ssh | SSH private keys |
~/.aws or /home/<user>/.aws | AWS credentials |
~/.gnupg or /home/<user>/.gnupg | GPG keys |
What a failure looks like
Configuration
Enable destructive
rm command detection. Defaults to true.Enable path traversal (
..) detection. Defaults to true.Enable sensitive directory detection. Defaults to
true.Override the gate name recorded in results. Defaults to
"filesystem".