Agent Firewall for Openclaw

Agent Firewall provides real-time bidirectional filtering to protect AI agents from prompt injections, PII leakage, and unauthorized data exfiltration.

arhadnane
v1.0.0
Apr 4, 2026
0
904
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install agent-firewall

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install agent-firewall using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Agent Firewall?

Agent Firewall serves as a robust security layer for AI agents, acting as an intermediary between the user input and the model output. By implementing a sophisticated blue-team defense strategy, it ensures that every communication is scrutinized for malicious intent or sensitive data exposure. As a critical component of the Openclaw Skills library, it allows developers to deploy agents in production environments with confidence, knowing that the model is shielded from adversarial attacks.

The skill operates on a dual-filter architecture: the Input Filter blocks prompt injections and role confusion attempts, while the Output Filter scans for secrets, PII, and internal system paths. This comprehensive approach ensures that neither the input nor the response compromises the security or privacy of the underlying infrastructure.

Agent Firewall Use Cases

  • Preventing prompt injection attacks such as 'ignore previous instructions' or role-play jailbreaks.
  • Automatically redacting PII like emails, credit card numbers, and SSNs from model responses.
  • Blocking the accidental leakage of API keys, AWS credentials, and GitHub tokens.
  • Implementing rate limiting to prevent resource exhaustion and denial-of-service attacks on LLM endpoints.
  • Sanitizing internal filesystem paths and sensitive URLs before they reach the end user.

How Agent Firewall Works

  1. The Channel Input is first intercepted by the Input Filter before reaching the AI model.
  2. The system checks the input against a Pattern DB for injection attempts and validates it via a Unicode sanitizer and encoding detector.
  3. If the input passes security checks and rate limits, it is forwarded to the Agent/Model for processing.
  4. The resulting Model Output is intercepted by the Output Filter.
  5. The output is scanned for high-entropy strings (secrets), PII is redacted, and internal paths are scrubbed.
  6. The sanitized and safe response is finally delivered to the Channel Output.

Agent Firewall Setup

To integrate Agent Firewall into your project, define your security policy in a dedicated configuration file. Ensure the rules are set to read-only for the agent.

# Install the security configuration
mkdir -p .security
touch .security/firewall-rules.yaml

Configure your rules in .security/firewall-rules.yaml to define block lists and redaction patterns for your Openclaw Skills deployment.

Agent Firewall Data Schema & Taxonomy

Agent Firewall organizes its security logic and logging through a structured YAML schema and append-only logs:

Component Type Description
input Configuration Defines injection patterns, rate limits, and token budgets.
output Configuration Defines secret patterns, PII settings, and path scrubbing.
logs Metadata Captures timestamps, matched rules, context, and user hashes for every block.
firewall-rules.yaml File The primary policy file located in the .security/ directory.

Agent Firewall Advanced Features

  • Real-time encoding detection to catch Base64, Hex, or ROT13 payloads designed to bypass standard filters.
  • Append-only production rules that require human approval for deletion, ensuring persistent security.
  • Consistency checks that verify the model output does not contradict core system prompt directives.
  • Detailed security logging that records the full context of blocked attempts for forensic analysis.
  • Automated PII redaction that replaces sensitive data with [REDACTED] markers seamlessly.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*