Runtime 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.
Why This Matters
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.
Commands
Scan for Injections
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.
CODEBLOCK0
Scan a specific file or directory:
CODEBLOCK1
Quick File Check
Fast single-file injection check. Same detection patterns as scan, targeted to one file.
CODEBLOCK2
Boundary Analysis
Analyze content boundary safety across the workspace. Identifies:
- Agent instruction files that contain mixed trusted/untrusted content
Writable instruction files (attack surface for compromised skills)
Blast radius assessment for each critical file
CODEBLOCK3
Command Allowlist
Display the current command allowlist and blocklist policy. Creates a default .bastion-policy.json if none exists.
CODEBLOCK4
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.
Status
Quick summary of workspace injection defense posture: files scanned, findings by severity, boundary safety, and overall posture rating.
CODEBLOCK5
Workspace Auto-Detection
If --workspace is omitted, the script tries:
1. OPENCLAW_WORKSPACE environment variable
Current directory (if AGENTS.md exists)
INLINECODE5 (default)
What Gets Detected
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"