Clawdstrike ships with 12 built-in guards. Guards evaluate a GuardAction plus GuardContext and return a GuardResult.
| Guard | Purpose | Config key |
|---|---|---|
| ForbiddenPathGuard | Block access to sensitive paths | guards.forbidden_path |
| PathAllowlistGuard | Deny-by-default path allowlisting | guards.path_allowlist |
| EgressAllowlistGuard | Control network egress | guards.egress_allowlist |
| SecretLeakGuard | Detect secrets in writes/patches | guards.secret_leak |
| PatchIntegrityGuard | Block dangerous patches | guards.patch_integrity |
| ShellCommandGuard | Validate shell commands against forbidden patterns | guards.shell_command |
| McpToolGuard | Restrict MCP tool usage | guards.mcp_tool |
| PromptInjectionGuard | Detect prompt-injection in untrusted text | guards.prompt_injection |
| JailbreakGuard | Detect jailbreak attempts with 4-layer analysis | guards.jailbreak |
| ComputerUseGuard | CUA gateway with configurable enforcement modes | guards.computer_use |
| RemoteDesktopSideChannelGuard | Control remote desktop channels | guards.remote_desktop_side_channel |
| InputInjectionCapabilityGuard | Control input injection types and probes | guards.input_injection_capability |
Some prompt-security features are implemented as standalone utilities and are wired into integrations (for example, @clawdstrike/vercel-ai):
- Output Sanitizer — redact secrets/PII from model output (including streaming)
- Watermarking — embed signed provenance markers in prompts
| Guard | FileAccess | FileWrite | Patch | NetworkEgress | ShellCommand | McpTool | Custom |
|---|---|---|---|---|---|---|---|
| ForbiddenPath | ✓ | ✓ | ✓ | ||||
| PathAllowlist | ✓ | ✓ | ✓ | ||||
| EgressAllowlist | ✓ | ||||||
| SecretLeak | ✓ | ✓ | |||||
| PatchIntegrity | ✓ | ||||||
| ShellCommand | ✓ | ||||||
| McpTool | ✓ | ||||||
| PromptInjection | ✓ (untrusted_text) |
||||||
| Jailbreak | ✓ (user_input) |
||||||
| ComputerUse | ✓ (remote.*, input.*) |
||||||
| RemoteDesktopSideChannel | ✓ (remote.* side channels) |
||||||
| InputInjectionCapability | ✓ (input.inject) |
HushEngine evaluates applicable guards in this order:
forbidden_pathpath_allowlistegress_allowlistsecret_leakpatch_integrityshell_commandmcp_toolprompt_injection(only forCustom("untrusted_text", ...))jailbreak(only forCustom("user_input", ...))computer_use(only forCustom("remote.*"|"input.*", ...))remote_desktop_side_channel(only forCustom("remote.*", ...)side channels)input_injection_capability(only forCustom("input.inject", ...))- Custom/extra guards (if registered)
If settings.fail_fast: true, evaluation stops on the first blocked result. Otherwise, all applicable guards run and the final verdict is the highest severity across results (block > warn > allow).
If a guard config is omitted from the policy, the guard runs with its default configuration.
Every guard config supports an enabled field. Set enabled: false to disable a guard:
guards:
forbidden_path:
enabled: false
egress_allowlist:
enabled: falseYou can extend HushEngine with custom guards:
use clawdstrike::{Guard, GuardAction, GuardContext, GuardResult};
struct MyCustomGuard;
#[async_trait::async_trait]
impl Guard for MyCustomGuard {
fn name(&self) -> &str {
"my_custom_guard"
}
fn handles(&self, action: &GuardAction<'_>) -> bool {
matches!(action, GuardAction::Custom(kind, _) if *kind == "my_action")
}
async fn check(
&self,
action: &GuardAction<'_>,
context: &GuardContext,
) -> GuardResult {
// Your logic here
GuardResult::allow(self.name())
}
}
// Register with engine
let engine = HushEngine::new().with_extra_guard(Box::new(MyCustomGuard));See Custom Guards Guide for more details.
Control what resources can be accessed:
- ForbiddenPathGuard — Block sensitive filesystem paths
- PathAllowlistGuard — Deny-by-default path allowlisting
- EgressAllowlistGuard — Network destinations
- ShellCommandGuard — Shell command validation
- McpToolGuard — Tool invocations
Analyze content for security issues:
- SecretLeakGuard — Detect secrets in output
- PatchIntegrityGuard — Validate patch safety
- PromptInjectionGuard — Detect instruction hijacking
- JailbreakGuard — Detect safety bypass attempts
Control AI agent interactions with remote desktops:
- ComputerUseGuard — CUA gateway with enforcement modes
- RemoteDesktopSideChannelGuard — Channel-level control (clipboard, file transfer, etc.)
- InputInjectionCapabilityGuard — Input type validation and postcondition probes
Process LLM output before delivery:
- Output Sanitizer — Redact sensitive data
- Watermarking — Add provenance tracking