Skip to main content

Overview

Security guards are input-level validation layers that run independently of the security mode. Even in full 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

  1. Path normalization - Resolves ../ sequences to eliminate traversal
  2. Symlink resolution - Resolves symlinks to their real paths to detect symlink-based escapes
  3. Allowlist check - Verified resolved path is within an allowed directory
  4. Blocklist check - Verified path is not in the blocked paths list
  5. 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:
Instead, prefer adding specific paths to allowedPaths.

SsrfGuard - SSRF Guard

Prevents Server-Side Request Forgery by validating URLs before HTTP requests.

How It Works

  1. Scheme validation - Only http and https allowed
  2. Host blocklist - Checks against known metadata endpoints
  3. CIDR check - Resolves DNS and checks resolved IP against blocked CIDR ranges
  4. DNS rebinding defense - Resolves hostnames before connecting, re-validates on redirects
  5. 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

Total score is the sum of all triggered patterns. Inputs scoring above the 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 with CRITICAL risk.

Configuration


AuditScanner - Code Scanner

Scans skill code and plugin code for dangerous patterns before loading.

Detection Patterns

When It Runs

  • On skill file load
  • On plugin activation
  • During profclaw doctor health check

Configuration

Security Modes

Guards apply within all modes except deny.

Audit Logging

Guard decisions are recorded in the audit log.