Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
e559827
feat(spider-sense): promote to first-class built-in guard across all …
bb-connor Mar 4, 2026
6be7339
fix(spider-sense): harden fail-closed paths and cross-SDK parity
bb-connor Mar 4, 2026
847894e
fix(spider-sense): address PR review comments
bb-connor Mar 4, 2026
91cfff7
feat(spider-sense): add cross-sdk provider parity, integrity, metrics…
bb-connor Mar 4, 2026
1fd707a
feat(spider-sense): harden provider path, trust controls, and conform…
bb-connor Mar 4, 2026
7ba0db1
fix(spider-sense): resolve review blockers and CI regressions
bb-connor Mar 4, 2026
0a3be2f
fix(openclaw): execute canonical spider-sense and bundle TS builtin DB
bb-connor Mar 4, 2026
5c26302
test(spider-sense): enforce s2bench pattern DB sync
bb-connor Mar 4, 2026
dcd34c6
fix(spider-sense): resolve new review threads and CI regressions
bb-connor Mar 4, 2026
6dd5ec1
fix(spider-sense): fail closed on invalid policy toggles and load races
bb-connor Mar 4, 2026
7e325f4
fix(hush-py): align spider_sense parser error text with mapping-only …
bb-connor Mar 4, 2026
83c8890
feat(spider-sense): add full threat-intel example and rust v1.3 confi…
bb-connor Mar 4, 2026
c2d2c6e
fix(spider-sense): preserve legacy LLM config and trim example dead code
bb-connor Mar 4, 2026
11c7c80
docs(examples): clarify first-class spider-sense vs custom action pay…
bb-connor Mar 4, 2026
8fb7e2d
fix(spider-sense): resolve review findings and unblock CI
bb-connor Mar 4, 2026
76d0ef2
fix(spider-sense): fail closed and dedupe migration config
bb-connor Mar 4, 2026
23b0761
fix(spider-sense): verify signed manifest before DB path resolution
bb-connor Mar 4, 2026
049dbfb
fix(spider-sense): allow external trust-store key identifiers
bb-connor Mar 4, 2026
ff30310
fix(openclaw): honor spider-sense toggle and gate full-only test
bb-connor Mar 4, 2026
e6d541b
fix(spider-sense): enforce direct DB integrity and policy-event parse
bb-connor Mar 4, 2026
1a0efa6
docs(readme): link spider-sense quickstart to full example
bb-connor Mar 4, 2026
0ee8074
fix(spider-sense): close TS asset path and legacy OpenClaw no-ops
bb-connor Mar 4, 2026
daeaa2a
docs(readme): move spider-sense quickstart below observe sdk examples
bb-connor Mar 4, 2026
fa31b80
fix(openclaw): allow spider_sense true when executable custom guard e…
bb-connor Mar 4, 2026
71c76ce
fix(policy): deep-merge spider-sense inherited config
bb-connor Mar 4, 2026
eaea114
fix(spider-sense): preserve explicit defaults and bundle crate assets
bb-connor Mar 4, 2026
b1a3748
fix(cli): format daemon start log for CI
bb-connor Mar 4, 2026
46ff50a
fix(spider-sense): handle fallback overrides and boolean toggles
bb-connor Mar 4, 2026
ab982f9
Merge remote-tracking branch 'origin/main' into feat/ocsf
bb-connor Mar 4, 2026
2735acb
fix(spider-sense): clarify programmatic merge and path resolution
bb-connor Mar 4, 2026
445ea3c
fix(spider-sense-ts): align trust keys and deep-path template parity
bb-connor Mar 4, 2026
71f8932
fix(spider-sense): harden manifest parsing and defaults
bb-connor Mar 4, 2026
8a7c1c1
fix(hush-ts): reject non-executable spider_sense boolean enable
bb-connor Mar 4, 2026
51a0d58
fix(spider-sense): restore merge_with partial-merge semantics
bb-connor Mar 4, 2026
ffe6cbe
fix(openclaw): honor policy spider_sense disable for custom guard
bb-connor Mar 4, 2026
e826e7e
fix(spider-sense): allow merge_with enabled=false overrides
bb-connor Mar 4, 2026
df29cfb
fix(spider-sense): handle OpenClaw runtime + serde-default merge
bb-connor Mar 4, 2026
5d9e861
fix(spider-sense): address review findings on merge + pattern DB
bb-connor Mar 4, 2026
d9c508b
fix(spider-sense): tighten enabled heuristic for serde defaults
bb-connor Mar 4, 2026
4d759ad
fix(spider-sense): preserve enabled override in heuristic merge
bb-connor Mar 4, 2026
9e8cc98
fix(openclaw): fail closed on spider-sense provider/integrity errors
bb-connor Mar 4, 2026
3a529a7
fix(spider-sense): avoid serde-default auto-enable in heuristic merge
bb-connor Mar 4, 2026
2321a8f
fix(spider-sense): deny on invalid query embedding shape
bb-connor Mar 4, 2026
692de0a
fix(spider-sense): harden merge metadata and pattern parsing
bb-connor Mar 4, 2026
97be444
fix(spider-sense): tighten enabled merge semantics
bb-connor Mar 4, 2026
c35d1ba
fix(spider-sense): resolve new merge and trust-store review findings
bb-connor Mar 4, 2026
0e0f650
fix(openclaw): harden spider-sense path and threshold validation
bb-connor Mar 4, 2026
79c13bc
fix(spider-sense): avoid implicit heuristic re-enable from defaults
bb-connor Mar 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ clawdstrike check --action-type file --ruleset strict ~/.ssh/id_rsa
- **Receipt** - Ed25519-signed attestation of decision, policy, and evidence
- **HushEngine** - Facade orchestrating guards and signing

### Built-in Guards (12)
### Built-in Guards (13)

1. `ForbiddenPathGuard` - Blocks sensitive filesystem paths
2. `PathAllowlistGuard` - Allowlist-based path access control
Expand All @@ -96,11 +96,12 @@ clawdstrike check --action-type file --ruleset strict ~/.ssh/id_rsa
10. `ComputerUseGuard` - Controls CUA actions for remote desktop sessions
11. `RemoteDesktopSideChannelGuard` - Side-channel controls for clipboard, audio, drive mapping, file transfer
12. `InputInjectionCapabilityGuard` - Restricts input injection capabilities in CUA environments
13. `SpiderSenseGuard` - Hierarchical threat screening (Yu et al. 2026): embedding-based cosine similarity + optional LLM deep path

### Policy System

Policies are YAML files with schema version 1.2.0 (backward-compatible with 1.1.0). They support inheritance via `extends`:
- Built-in rulesets: `permissive`, `default`, `strict`, `ai-agent`, `cicd`, `ai-agent-posture`, `remote-desktop`, `remote-desktop-permissive`, `remote-desktop-strict`
- Built-in rulesets: `permissive`, `default`, `strict`, `ai-agent`, `cicd`, `ai-agent-posture`, `remote-desktop`, `remote-desktop-permissive`, `remote-desktop-strict`, `spider-sense`
- Local file references
- Remote URLs
- Git refs
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ Composable, policy-driven security checks at the tool boundary. Each guard handl
| **JailbreakGuard** | 4-layer detection engine with session aggregation (see below) |
| **ComputerUseGuard** | Controls CUA actions: remote sessions, clipboard, input injection, file transfer |
| **ShellCommandGuard** | Blocks dangerous shell commands before execution |
| **SpiderSenseGuard**&nbsp;<sup>β</sup> | Hierarchical threat screening adapted from [Yu et al. 2026](https://arxiv.org/abs/2602.05386): fast vector similarity resolves known patterns, optional LLM escalation for ambiguous cases |
| **SpiderSenseGuard** | Hierarchical threat screening adapted from [Yu et al. 2026](https://arxiv.org/abs/2602.05386): fast vector similarity resolves known patterns, optional LLM escalation for ambiguous cases |

---

Expand All @@ -619,7 +619,7 @@ Clawdstrike policies are versioned, deterministic policy-as-code artifacts desig
| **Posture state machine** | `1.2.0+` posture states, budgets, and transitions for runtime containment/escalation flows |
| **Fail-closed runtime semantics** | Load or evaluation ambiguity resolves to deny rather than implicit allow |

Built-in rulesets: `permissive` | `default` | `strict` | `ai-agent` | `ai-agent-posture` | `cicd` | `remote-desktop` | `remote-desktop-permissive` | `remote-desktop-strict`
Built-in rulesets: `permissive` | `default` | `strict` | `ai-agent` | `ai-agent-posture` | `cicd` | `remote-desktop` | `remote-desktop-permissive` | `remote-desktop-strict` | `spider-sense`

Operational policy loop:

Expand Down
1 change: 0 additions & 1 deletion crates/libs/clawdstrike/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ full = [
]
ipfs = ["full"]
llm-judge-openai = ["full"]
clawdstrike-spider-sense = ["full"]
wasm-plugin-runtime = ["full", "dep:wasmtime"]

[lints]
Expand Down
26 changes: 21 additions & 5 deletions crates/libs/clawdstrike/src/async_guards/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ use std::sync::Arc;
use std::time::Duration;

use crate::async_guards::threat_intel::{
SafeBrowsingGuard, SafeBrowsingPolicyConfig, SnykGuard, SnykPolicyConfig, VirusTotalGuard,
VirusTotalPolicyConfig,
SafeBrowsingGuard, SafeBrowsingPolicyConfig, SnykGuard, SnykPolicyConfig, SpiderSenseGuard,
SpiderSensePolicyConfig, VirusTotalGuard, VirusTotalPolicyConfig,
};
#[cfg(feature = "clawdstrike-spider-sense")]
use crate::async_guards::threat_intel::{SpiderSenseGuard, SpiderSensePolicyConfig};
use crate::async_guards::types::{
AsyncGuard, AsyncGuardConfig, CircuitBreakerConfig, RateLimitConfig, RetryConfig,
};
Expand All @@ -24,6 +22,21 @@ const DEFAULT_CACHE_MAX_SIZE_MB: u64 = 64;
pub fn build_async_guards(policy: &Policy) -> Result<Vec<Arc<dyn AsyncGuard>>> {
let mut out: Vec<Arc<dyn AsyncGuard>> = Vec::new();

// First-class spider_sense field.
if let Some(ref ss_cfg) = policy.guards.spider_sense {
let async_cfg = async_config_for_spec(ss_cfg.async_config.as_ref())?;
// Resolve env-var placeholders (${VAR}) in the config, matching the
// guards.custom path which calls resolve_placeholders_in_json.
let json = serde_json::to_value(ss_cfg)
.map_err(|e| Error::ConfigError(format!("spider-sense serialize: {e}")))?;
let resolved = resolve_placeholders_in_json(json)?;
let resolved_cfg: SpiderSensePolicyConfig = serde_json::from_value(resolved)
.map_err(|e| Error::ConfigError(format!("spider-sense deserialize: {e}")))?;
let guard = SpiderSenseGuard::new(resolved_cfg, async_cfg)
.map_err(|e| Error::ConfigError(format!("spider-sense init: {e}")))?;
out.push(Arc::new(guard));
}

for spec in &policy.guards.custom {
if !spec.enabled {
continue;
Expand Down Expand Up @@ -52,8 +65,11 @@ fn build_guard(spec: &CustomGuardSpec) -> Result<Arc<dyn AsyncGuard>> {
let typed: SnykPolicyConfig = serde_json::from_value(config)?;
Ok(Arc::new(SnykGuard::new(typed, async_cfg)))
}
#[cfg(feature = "clawdstrike-spider-sense")]
"clawdstrike-spider-sense" => {
tracing::warn!(
"guards.custom[package=\"clawdstrike-spider-sense\"] is deprecated; \
use guards.spider_sense instead"
);
let typed: SpiderSensePolicyConfig = serde_json::from_value(config)?;
let guard = SpiderSenseGuard::new(typed, async_cfg)
.map_err(|e| Error::ConfigError(format!("spider-sense init: {e}")))?;
Expand Down
8 changes: 2 additions & 6 deletions crates/libs/clawdstrike/src/async_guards/threat_intel/mod.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
pub mod safe_browsing;
pub mod snyk;
pub mod virustotal;

#[cfg(feature = "clawdstrike-spider-sense")]
pub mod spider_sense;
pub mod virustotal;

pub use safe_browsing::{SafeBrowsingGuard, SafeBrowsingPolicyConfig};
pub use snyk::{SnykGuard, SnykPolicyConfig};
pub use virustotal::{VirusTotalGuard, VirusTotalPolicyConfig};

#[cfg(feature = "clawdstrike-spider-sense")]
pub use spider_sense::{SpiderSenseGuard, SpiderSensePolicyConfig};
pub use virustotal::{VirusTotalGuard, VirusTotalPolicyConfig};
Loading
Loading