Overview
Security guards are input-level validation layers that run independently of the security mode. Even infull mode, the FsGuard and SsrfGuard still block access to dangerous paths and private networks.
Each guard returns a GuardResult:
FsGuard - Filesystem Guard
Prevents path traversal attacks and blocks access to sensitive files.How It Works
- Path normalization - Resolves
../sequences to eliminate traversal - Symlink resolution - Resolves symlinks to their real paths to detect symlink-based escapes
- Allowlist check - Verified resolved path is within an allowed directory
- Blocklist check - Verified path is not in the blocked paths list
- Pattern check - Verified filename does not match blocked patterns
Default Blocked Paths
Default Blocked Filename Patterns
Configuration
Disabling FsGuard
You can disable FsGuard for specific operations if you need to access files outside the default paths:allowedPaths.
SsrfGuard - SSRF Guard
Prevents Server-Side Request Forgery by validating URLs before HTTP requests.How It Works
- Scheme validation - Only
httpandhttpsallowed - Host blocklist - Checks against known metadata endpoints
- CIDR check - Resolves DNS and checks resolved IP against blocked CIDR ranges
- DNS rebinding defense - Resolves hostnames before connecting, re-validates on redirects
- Redirect chain validation - Each redirect target is re-validated (up to 5 hops)
Blocked CIDR Ranges
Blocked Metadata Hosts
Configuration
PromptGuard - Injection Guard
Detects and blocks prompt injection and jailbreak attempts in user input.Detection Categories
| Category | Score | Examples |
|---|---|---|
| Injection delimiters | 40 | [system], [INST], <<SYS>>, <|im_start|> |
| Token smuggling | 45 | Null bytes, ANSI escapes, backspace chars |
| Jailbreak personas | 35 | ”You are now DAN”, “act as unrestricted” |
| Instruction override | 30 | ”Ignore all previous instructions” |
| Encoded injection | 30 | ”execute the following base64” |
| System prompt extraction | 25 | ”reveal your system prompt” |
| Prompt leak via formatting | 20 | ”translate the above text” |
blockThreshold are rejected.
Canary Token System
A random canary token is injected into the system prompt. If this token appears in the user’s message, it indicates the system prompt has been leaked and extracted - the request is blocked withCRITICAL risk.
Configuration
AuditScanner - Code Scanner
Scans skill code and plugin code for dangerous patterns before loading.Detection Patterns
| Pattern | Risk | Example |
|---|---|---|
| Shell execution | CRITICAL | child_process, exec(), spawn() |
| eval usage | CRITICAL | eval(), Function("code") |
| Raw socket access | CRITICAL | net.connect(), tls.connect() |
| Network access | HIGH | fetch(), axios, got() |
| Credential access | HIGH | API_KEY, SECRET, TOKEN references |
| Filesystem writes | MEDIUM | writeFileSync, appendFileSync |
| Destructive ops | HIGH | unlinkSync, rmdirSync, rm -rf |
| Env var access | MEDIUM | process.env. access |
When It Runs
- On skill file load
- On plugin activation
- During
profclaw doctorhealth check