Skip to content

Commit a1b8911

Browse files
author
ConnorWhelan11
committed
Docs: align integrations + add platform test script
1 parent 013d233 commit a1b8911

File tree

27 files changed

+571
-2710
lines changed

27 files changed

+571
-2710
lines changed

README.md

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
</p>
44

55
<p align="center">
6-
<a href="https://github.com/medica/clawdstrike/actions"><img src="https://img.shields.io/github/actions/workflow/status/medica/clawdstrike/ci.yml?branch=main&style=flat-square&logo=github&label=CI" alt="CI Status"></a>
6+
<a href="https://github.com/backbay-labs/hushclaw/actions"><img src="https://img.shields.io/github/actions/workflow/status/backbay-labs/hushclaw/ci.yml?branch=main&style=flat-square&logo=github&label=CI" alt="CI Status"></a>
77
<a href="https://crates.io/crates/clawdstrike"><img src="https://img.shields.io/crates/v/clawdstrike?style=flat-square&logo=rust" alt="crates.io"></a>
88
<a href="https://docs.rs/clawdstrike"><img src="https://img.shields.io/docsrs/clawdstrike?style=flat-square&logo=docs.rs" alt="docs.rs"></a>
99
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue?style=flat-square" alt="License: MIT"></a>
@@ -69,42 +69,40 @@ Runtime security enforcement for AI agents. Composable guards, cryptographic rec
6969

7070
## Quick Start
7171

72-
```typescript
73-
// openclaw.config.ts
74-
import { clawdstrike } from "@clawdstrike/openclaw";
75-
76-
export default {
77-
plugins: [
78-
clawdstrike({
79-
ruleset: "ai-agent",
80-
signing: { enabled: true },
81-
}),
82-
],
83-
};
72+
### CLI (Rust)
73+
74+
```bash
75+
cargo install --path crates/hush-cli
76+
77+
hush policy list
78+
hush check --action-type file --ruleset strict ~/.ssh/id_rsa
8479
```
8580

86-
Or use standalone:
81+
### TypeScript (tool boundary)
8782

88-
```typescript
89-
import { HushEngine, JailbreakDetector } from "@clawdstrike/sdk";
83+
TypeScript does not ship a full policy engine; use the Rust CLI/daemon for evaluation. `@clawdstrike/hush-cli-engine` requires `hush` on your PATH (or pass `hushPath`).
9084

91-
const engine = new HushEngine({ ruleset: "strict" });
92-
const detector = new JailbreakDetector();
85+
```typescript
86+
import { createHushCliEngine } from "@clawdstrike/hush-cli-engine";
87+
import { BaseToolInterceptor, createSecurityContext } from "@clawdstrike/adapter-core";
9388

94-
// Check file access
95-
const result = await engine.checkFileAccess("~/.ssh/id_rsa", ctx);
96-
if (!result.allowed) throw new Error("Blocked by policy");
89+
const engine = createHushCliEngine({ policyRef: "default" });
90+
const interceptor = new BaseToolInterceptor(engine, { blockOnViolation: true });
91+
const ctx = createSecurityContext({ sessionId: "session-123" });
9792

98-
// Detect jailbreaks
99-
const detection = await detector.detect(userMessage, sessionId);
100-
if (detection.blocked) return "I can't process that request.";
93+
const preflight = await interceptor.beforeExecute("bash", { cmd: "echo hello" }, ctx);
94+
if (!preflight.proceed) throw new Error("Blocked by policy");
10195
```
10296

97+
### OpenClaw plugin
98+
99+
See `packages/clawdstrike-openclaw/docs/getting-started.md`.
100+
103101
## Highlights
104102

105103
| Feature | Description |
106104
|---------|-------------|
107-
| **9 Built-in Guards** | Path, egress, secrets, patches, tools, prompt injection, jailbreak, output sanitization, watermarking |
105+
| **7 Built-in Guards** | Path, egress, secrets, patches, tools, prompt injection, jailbreak |
108106
| **4-Layer Jailbreak Detection** | Heuristic + statistical + ML + optional LLM-as-judge with session aggregation |
109107
| **Output Sanitization** | Redact secrets, PII, internal data from LLM output with streaming support |
110108
| **Prompt Watermarking** | Embed signed provenance markers for attribution and forensics |
@@ -123,7 +121,7 @@ if (detection.blocked) return "I can't process that request.";
123121
We take security seriously. If you discover a vulnerability:
124122

125123
- **For sensitive issues**: Email [connor@backbay.io](mailto:connor@backbay.io) with details. We aim to respond within 48 hours.
126-
- **For non-sensitive issues**: Open a [GitHub issue](https://github.com/backbay-labs/clawdstrike/issues) with the `security` label.
124+
- **For non-sensitive issues**: Open a [GitHub issue](https://github.com/backbay-labs/hushclaw/issues) with the `security` label.
127125

128126
## Contributing
129127

docs/src/concepts/architecture.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ The intended integration is at the **tool boundary** (your agent runtime calls C
77

88
## System Overview
99

10-
```
10+
```text
1111
┌─────────────────────────────────────────────────────────────────────────────────────┐
1212
│ HushEngine │
1313
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
@@ -56,7 +56,7 @@ The intended integration is at the **tool boundary** (your agent runtime calls C
5656

5757
| Package | Description |
5858
|---------|-------------|
59-
| `@clawdstrike/sdk` | Core TypeScript SDK with full guard parity |
59+
| `@clawdstrike/sdk` | Crypto/receipts + a subset of guards + prompt-security utilities (no full policy engine) |
6060
| `@clawdstrike/adapter-core` | Framework-agnostic adapter interfaces |
6161
| `@clawdstrike/openclaw` | OpenClaw plugin |
6262
| `@clawdstrike/vercel-ai` | Vercel AI SDK integration |
@@ -67,7 +67,7 @@ The intended integration is at the **tool boundary** (your agent runtime calls C
6767

6868
| Package | Description |
6969
|---------|-------------|
70-
| `hush-py` | Pure Python SDK with optional PyO3 bindings |
70+
| `hush` | Pure Python SDK (repo: `packages/hush-py`) |
7171

7272
## Data flow (typical integration)
7373

@@ -127,7 +127,7 @@ For deeper integration scenarios, Clawdstrike provides Inline Reference Monitors
127127

128128
IRMs integrate with the guard pipeline:
129129

130-
```rust
130+
```rust,ignore
131131
use clawdstrike::irm::{IrmRouter, FilesystemIrm, NetworkIrm};
132132
133133
let router = IrmRouter::new()

docs/src/concepts/design-philosophy.md

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ guards:
2626
2727
Clawdstrike is one layer in a defense-in-depth strategy. It enforces policy at the **tool boundary**—the interface between your agent runtime and the actions it performs.
2828
29-
```
29+
```text
3030
┌─────────────────────────────────────────────────────────────┐
3131
│ Your Agent Runtime │
3232
│ ┌─────────────────────────────────────────────────────┐ │
@@ -66,7 +66,7 @@ These are distinct concepts that should not be conflated:
6666

6767
Receipts prove what Clawdstrike observed and decided under a specific policy. They do not prove that the underlying OS prevented all side effects. A signed receipt is only as strong as the integration.
6868

69-
```rust
69+
```rust,ignore
7070
// Enforcement: your runtime decides based on GuardResult
7171
let result = engine.check_file_access("/etc/passwd", &ctx).await?;
7272
if !result.allowed {
@@ -93,7 +93,7 @@ This composability lets you:
9393
2. **Layer multiple checks.** A file write might pass `ForbiddenPathGuard` but fail `SecretLeakGuard`.
9494
3. **Add custom guards.** Extend `HushEngine` with your own guards via the `Guard` trait.
9595

96-
```rust
96+
```rust,ignore
9797
// Guards evaluate in order, fail-fast or aggregate
9898
let report = engine.check_action_report(&action, &context).await?;
9999
for evidence in &report.evidence {
@@ -129,26 +129,19 @@ When detecting sensitive content (jailbreaks, secrets, PII), Clawdstrike:
129129
}
130130
```
131131

132-
## Multi-Language Parity
133-
134-
Clawdstrike maintains functional parity across Rust, TypeScript, and Python:
132+
## Multi-language support
135133

136-
| Feature | Rust | TypeScript | Python |
137-
|---------|------|------------|--------|
138-
| Guards | Full | Full | Full |
139-
| Policy Engine | Full | Full | Full |
140-
| Receipts & Signing | Full | Full | Full |
141-
| Jailbreak Detection | Full | Full | Full |
142-
| Output Sanitization | Full | Full | Full |
134+
Rust is the reference implementation for policy evaluation and enforcement. TypeScript and Python focus on:
143135

144-
The Rust implementation is the reference. TypeScript and Python implementations use the same algorithms and produce compatible outputs.
136+
- **Interop** (crypto/receipts)
137+
- **Integration glue** (framework adapters)
145138

146-
## Explicit Over Implicit
139+
See [Multi-Language & Multi-Framework Support](./multi-language.md) for the current status by language and package.
147140

148-
Clawdstrike prefers explicit configuration over magic behavior:
141+
## Explicit over implicit
149142

150-
- **No `enabled: false`.** To disable a guard, configure it to allow everything explicitly.
151-
- **No hidden defaults.** Default patterns are documented in each guard's reference.
152-
- **No silent failures.** Invalid configuration fails loudly at load time.
143+
Clawdstrike prefers explicit, auditable configuration:
153144

154-
This explicitness makes policies auditable. You can read a policy file and understand exactly what it permits and denies.
145+
- **Unknown fields are rejected** (fail-closed) where parsing is security-critical.
146+
- **Invalid patterns fail at load time** (glob/regex validation), not at check time.
147+
- **Policy linting** (`hush policy lint`) catches risky defaults and common mistakes early.

docs/src/concepts/guards.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Guards are small, focused checks that evaluate a single action against policy/co
66

77
In Rust:
88

9-
```rust
9+
```rust,ignore
1010
#[async_trait]
1111
pub trait Guard: Send + Sync {
1212
fn name(&self) -> &str;
@@ -37,5 +37,6 @@ Clawdstrike ships with:
3737
- `PatchIntegrityGuard`
3838
- `McpToolGuard`
3939
- `PromptInjectionGuard`
40+
- `JailbreakGuard`
4041

4142
See the [Guards reference](../reference/guards/README.md) for configs and details.

0 commit comments

Comments
 (0)