openclaw-bastionPrompt injection defense for agent workspaces. Scan files for injection attempts, analyze content boundaries, detect hidden instructions, and maintain command allowlists. Free alert layer β upgrade to openclaw-bastion-pro for active blocking, sanitization, and runtime enforcement.
Install via ClawdBot CLI:
clawdbot install AtlasPA/openclaw-bastionRuntime prompt injection defense for agent workspaces. While other tools watch workspace identity files, Bastion protects the input/output boundary β the files being read by the agent, web content, API responses, and user-supplied documents.
Agents process content from many sources: local files, API responses, web pages, user uploads. Any of these can contain prompt injection attacks β hidden instructions that manipulate agent behavior. Bastion scans this content before the agent acts on it.
Scan files or directories for prompt injection patterns. Detects instruction overrides, system prompt markers, hidden Unicode, markdown exfiltration, HTML injection, shell injection, encoded payloads, delimiter confusion, multi-turn manipulation, and dangerous commands.
If no target is specified, scans the entire workspace.
python3 {baseDir}/scripts/bastion.py scan
Scan a specific file or directory:
python3 {baseDir}/scripts/bastion.py scan path/to/file.md
python3 {baseDir}/scripts/bastion.py scan path/to/directory/
Fast single-file injection check. Same detection patterns as scan, targeted to one file.
python3 {baseDir}/scripts/bastion.py check path/to/file.md
Analyze content boundary safety across the workspace. Identifies:
python3 {baseDir}/scripts/bastion.py boundaries
Display the current command allowlist and blocklist policy. Creates a default .bastion-policy.json if none exists.
python3 {baseDir}/scripts/bastion.py allowlist
python3 {baseDir}/scripts/bastion.py allowlist --show
The policy file defines which commands are considered safe and which patterns are blocked. Edit the JSON file directly to customize. Bastion Pro enforces this policy at runtime via hooks.
Quick summary of workspace injection defense posture: files scanned, findings by severity, boundary safety, and overall posture rating.
python3 {baseDir}/scripts/bastion.py status
If --workspace is omitted, the script tries:
OPENCLAW_WORKSPACE environment variableAGENTS.md exists)~/.openclaw/workspace (default)| Category | Patterns | Severity |
|----------|----------|----------|
| Instruction override | "ignore previous", "disregard above", "you are now", "new system prompt", "forget your instructions", "override safety", "act as if no restrictions", "entering developer mode" | CRITICAL |
| System prompt markers | , [SYSTEM], <, <\|im_start\|>system, [INST], ### System: | CRITICAL |
| Hidden instructions | Multi-turn manipulation ("in your next response, you must"), stealth patterns ("do not tell the user") | CRITICAL |
| HTML injection | , , , hidden divs, | CRITICAL |
| Markdown exfiltration | Image tags with encoded data in URLs | CRITICAL |
| Dangerous commands | curl \| bash, wget \| sh, rm -rf /, fork bombs | CRITICAL |
| Unicode tricks | Zero-width characters, RTL overrides, invisible formatting | WARNING |
| Homoglyph substitution | Cyrillic/Latin lookalikes mixed into ASCII text | WARNING |
| Base64 payloads | Large encoded blobs outside code blocks | WARNING |
| Shell injection | $(command) subshell execution outside code blocks | WARNING |
| Delimiter confusion | Fake code block boundaries with injection content | WARNING |
` ) are skipped to avoid false positives| Code | Meaning |
|------|---------|
| 0 | Clean, no issues |
| 1 | Warnings detected (review recommended) |
| 2 | Critical findings (action needed) |
Python standard library only. No pip install. No network calls. Everything runs locally.
Works with OpenClaw, Claude Code, Cursor, and any tool using the Agent Skills specification.
Generated Mar 1, 2026
A company uses AI agents to handle customer inquiries by processing uploaded documents, emails, and web data. Bastion scans these inputs for prompt injection attacks, preventing malicious instructions from manipulating agent responses and ensuring compliance with safety protocols.
Research teams employ AI agents to analyze external datasets, API responses, and online articles. Bastion checks content for hidden payloads like encoded commands or HTML injections, safeguarding the integrity of analysis and preventing data exfiltration.
Media platforms use AI agents to review user-generated content for moderation. Bastion detects prompt injection patterns such as instruction overrides or dangerous commands, ensuring agents operate as intended without being tricked into bypassing safety filters.
Financial institutions deploy AI agents to process sensitive documents like reports and transactions. Bastion scans for hidden Unicode or shell injection attempts, protecting against attacks that could alter financial data or execute unauthorized commands.
Healthcare providers use AI agents to manage patient records and medical literature. Bastion identifies critical threats like system prompt markers or delimiter confusion, preventing manipulation that could lead to incorrect medical advice or data breaches.
Offer Bastion as a cloud-based service with tiered pricing based on usage volume and features like real-time scanning. Revenue comes from monthly subscriptions, targeting enterprises needing scalable security for AI agent deployments.
Sell perpetual licenses for on-premises deployment, including custom integrations and premium support. Revenue is generated through one-time license sales and annual maintenance fees, appealing to organizations with strict data sovereignty requirements.
Provide a free version with basic scanning capabilities, while charging for advanced features like boundary analysis and policy enforcement. Revenue streams include upgrades to Pro plans and consulting services for customization.
π¬ Integration Tip
Integrate Bastion early in the AI agent pipeline by running scans before content processing, and customize the policy file to match specific security needs for reduced false positives.
Transform AI agents from task-followers into proactive partners that anticipate needs and continuously improve. Now with WAL Protocol, Working Buffer, Autonomous Crons, and battle-tested patterns. Part of the Hal Stack π¦
Use the ClawdHub CLI to search, install, update, and publish agent skills from clawdhub.com. Use when you need to fetch new skills on the fly, sync installed skills to latest or a specific version, or publish new/updated skill folders with the npm-installed clawdhub CLI.
Clawdbot documentation expert with decision tree navigation, search scripts, doc fetching, version tracking, and config snippets for all Clawdbot features
Interact with Moltbook social network for AI agents. Post, reply, browse, and analyze engagement. Use when the user wants to engage with Moltbook, check their feed, reply to posts, or track their activity on the agent social network.
OpenClaw CLI wrapper β gateway, channels, models, agents, nodes, browser, memory, security, automation.
MoltGuard β runtime security plugin for OpenClaw agents by OpenGuardrails. Helps users install, register, activate, and check the status of MoltGuard. Use wh...