Skip to content

Commit 9597380

Browse files
bb-connorclaude
andauthored
feat(cua): CUA Gateway — guards, rulesets, research, ecosystem integrations (#88)
* feat(cua): CUA Gateway passes #7-#14 — guards, rulesets, research, ecosystem integrations Complete CUA (Computer-Use Agent) Gateway implementation across 14 research and execution passes. This adds runtime security enforcement for AI agents operating in remote desktop, browser automation, and input injection contexts. Rust: - 3 CUA guards: computer_use (observe/guardrail/fail_closed modes), remote_desktop_side_channel (per-channel enable/disable + transfer size), input_injection_capability (input type allowlist + postcondition probes) - 7 CUA event types in PolicyEventType including remote.session_share - CuaEventData struct with serde support and snake_case aliases - 3 built-in rulesets: remote-desktop, remote-desktop-strict, remote-desktop-permissive - Fail-closed fixes: deny missing input_type (C2), deny unknown side channels (C3) TypeScript: - CuaEventData interface + 7 EventType variants in adapter-core - 7 factory methods in PolicyEventFactory (including createCuaSessionShareEvent) - OpenClaw CUA bridge handler (283 lines) with 43 tests - 3 stable error codes (OCLAW_CUA_UNKNOWN_ACTION, MISSING_METADATA, SESSION_MISSING) Research & fixtures: - 9 deep-dive topic files, execution backlog, review log (14 passes) - 17 Python validation harnesses (130+ fixture checks) - 21 fixture groups across policy-events, receipts, and benchmarks - trycua/cua connector evaluation with compatibility matrix - Pass #14 code review report with 3 critical issues resolved CI: 17 roadmap harnesses run on every PR/push. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(cua): address PR #88 review — camelCase field acceptance + input_type forwarding - InputInjectionCapabilityGuard now accepts both snake_case and camelCase for input_type/inputType and postcondition_probe_hash/postconditionProbeHash since the CUA pipeline serializes as camelCase via serde rename_all - OpenClaw CUA bridge buildCuaEvent now forwards input_type from tool params so the fail-closed guard receives it through canonical event data - Update pyo3 0.28.1 → 0.28.2 to resolve RUSTSEC-2026-0013 license check Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore(vendor): re-vendor pyo3 0.28.1 → 0.28.2 Fixes offline build/test CI job after Cargo.lock update for RUSTSEC-2026-0013. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat(cua): close runtime enforcement gaps and add fixture-backed bridge tests * fix(cua): enforce connect egress and plain computer_use bridge mapping * feat(cua): harden runtime parity, reason codes, and drift checks * docs(cua): reconcile roadmap status and TODO consistency * fix(cua): resolve side-channel review gaps and dedupe reason taxonomy * fix(agent): align OpenClaw gateway device auth handshake * test(hush-cli): harden abuse harness stability in CI * chore(cua): add pass18 notarization and soak execution playbook * docs(cua): add notarization credential discovery checklist * fix(cua): harden soak and rdp matrix harness stability * docs(cua): align roadmap status with pass18 release gates * fix(cua): add hush-cli CUA parity and sync remote desktop rulesets * docs(cua): refresh pass18 roadmap and readiness status * fix(cua): close remaining policy parity review gaps * docs(cua): track post-pass policy_event dedupe follow-up * fix(cua): align computer_use default allowlist with 10-action surface * style(rust): format cua_rulesets test for ci * fix(cua): resolve identity fallback and guardrail warn semantics * docs(readme): refresh computer-use gateway positioning * fix(taxonomy): preserve deny/warn reason-code precedence --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent f0b843d commit 9597380

File tree

251 files changed

+42340
-427
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

251 files changed

+42340
-427
lines changed

.github/workflows/ci.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -880,6 +880,29 @@ jobs:
880880
run: |
881881
python -m pip install --upgrade pip
882882
python -m pip install -e ".[dev]"
883+
python -m pip install "jsonschema>=4,<5"
884+
885+
- name: Run CUA roadmap fixture harnesses
886+
working-directory: ${{ github.workspace }}
887+
run: |
888+
python docs/roadmaps/cua/research/verify_cua_migration_fixtures.py
889+
python docs/roadmaps/cua/research/verify_remote_desktop_policy_matrix.py
890+
python docs/roadmaps/cua/research/verify_remote_desktop_ruleset_alignment.py
891+
python docs/roadmaps/cua/research/verify_injection_capabilities.py
892+
python docs/roadmaps/cua/research/verify_policy_event_mapping.py
893+
python docs/roadmaps/cua/research/verify_postcondition_probes.py
894+
python docs/roadmaps/cua/research/verify_remote_session_continuity.py
895+
python docs/roadmaps/cua/research/verify_envelope_semantic_equivalence.py
896+
python docs/roadmaps/cua/research/verify_repeatable_latency_harness.py
897+
python docs/roadmaps/cua/research/verify_verification_bundle.py
898+
python docs/roadmaps/cua/research/verify_browser_action_policy.py
899+
python docs/roadmaps/cua/research/verify_session_recording_evidence.py
900+
python docs/roadmaps/cua/research/verify_orchestration_isolation.py
901+
python docs/roadmaps/cua/research/verify_cua_policy_evaluation.py
902+
python docs/roadmaps/cua/research/verify_canonical_adapter_contract.py
903+
python docs/roadmaps/cua/research/verify_provider_conformance.py
904+
python docs/roadmaps/cua/research/verify_openclaw_cua_bridge.py
905+
python docs/roadmaps/cua/research/verify_trycua_connector.py
883906
884907
- name: Run tests
885908
run: python -m pytest

Cargo.lock

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 61 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262

6363
> **Alpha software** — APIs and import paths may change between releases. See GitHub Releases and the package registries (crates.io / npm / PyPI) for published versions.
6464
65-
Clawdstrike provides runtime security enforcement for agents, designed for developers building EDR solutions and security infrastructure on top of OpenClaw.
65+
Clawdstrike is a fail-closed policy + attestation runtime for AI agents and computer-use systems, designed for developers building EDR solutions and security infrastructure for autonomous agent swarms. It sits at the boundary between intent and execution: normalize actions, enforce policy, and sign what happened.
6666

6767
<img src=".github/assets/sigils/boundary-light.svg#gh-light-mode-only" width="16" height="16" alt="" style="vertical-align:-3px;margin-right:6px;" /> <img src=".github/assets/sigils/boundary-dark.svg#gh-dark-mode-only" width="16" height="16" alt="" style="vertical-align:-3px;margin-right:6px;" />**Guards** — Block sensitive paths, control network egress, detect secrets, validate patches, restrict tools, catch jailbreaks
6868

@@ -72,8 +72,42 @@ Clawdstrike provides runtime security enforcement for agents, designed for devel
7272

7373
<img src=".github/assets/sigils/ruleset-light.svg#gh-light-mode-only" width="16" height="16" alt="" style="vertical-align:-3px;margin-right:6px;" /> <img src=".github/assets/sigils/ruleset-dark.svg#gh-dark-mode-only" width="16" height="16" alt="" style="vertical-align:-3px;margin-right:6px;" />**Multi-framework** — OpenClaw, Vercel AI, LangChain, Claude, OpenAI, and more
7474

75+
## Computer Use Gateway
76+
77+
Clawdstrike now includes dedicated CUA gateway coverage for real runtime paths (not just static policy checks):
78+
79+
- Canonical CUA action translation across providers/runtimes.
80+
- Side-channel policy controls for remote desktop surfaces (`clipboard`, `audio`, `drive_mapping`, `printing`, `session_share`, file transfer bounds).
81+
- Deterministic decision metadata (`reason_code`, guard, severity) for machine-checkable analytics.
82+
- Fixture-driven validator suites plus runtime bridge tests for regression safety.
83+
84+
## Architecture At A Glance
85+
86+
```mermaid
87+
flowchart LR
88+
A[Provider Runtime<br/>OpenAI / Claude / OpenClaw] --> B[Clawdstrike Adapter]
89+
B --> C[Canonical Action Event]
90+
C --> D[Policy Engine + Guard Evaluation]
91+
D -->|allow| E[Gateway / Tool / Remote Action]
92+
D -->|deny| F[Fail-Closed Block]
93+
D --> G[Signed Receipt + reason_code]
94+
```
95+
7596
## Quick Start
7697

98+
### Computer use gateway smoke (agent-owned OpenClaw path)
99+
100+
```bash
101+
scripts/openclaw-agent-smoke.sh \
102+
--start-local-gateway \
103+
--gateway-url ws://127.0.0.1:18789 \
104+
--gateway-token dev-token
105+
```
106+
107+
Runbook and flow details:
108+
- `docs/src/guides/agent-openclaw-operations.md`
109+
- `apps/desktop/docs/openclaw-gateway-testing.md`
110+
77111
### CLI (Rust)
78112

79113
```bash
@@ -120,18 +154,22 @@ if (!preflight.proceed) throw new Error("Blocked by policy");
120154

121155
### OpenClaw plugin
122156

123-
See `packages/adapters/clawdstrike-openclaw/docs/getting-started.md`.
157+
- Quick start: `packages/adapters/clawdstrike-openclaw/docs/getting-started.md`
158+
- Integration guide: `docs/src/guides/openclaw-integration.md`
124159

125160
## Highlights
126161

127-
| Feature | Description |
128-
| ------------------------------- | ----------------------------------------------------------------------------- |
129-
| **7 Built-in Guards** | Path, egress, secrets, patches, tools, prompt injection, jailbreak |
162+
| Feature | Description |
163+
| --- | --- |
164+
| **Computer Use Gateway Controls** | Canonical CUA policy evaluation for click/type/scroll/key-chord and remote side-channel actions |
165+
| **Provider Translation Layer** | Runtime translators for OpenAI/Claude/OpenClaw flows into a unified policy surface |
166+
| **7 Built-in Guards** | Path, egress, secrets, patches, tools, prompt injection, jailbreak |
130167
| **4-Layer Jailbreak Detection** | Heuristic + statistical + ML + optional LLM-as-judge with session aggregation |
131-
| **Output Sanitization** | Redact secrets, PII, internal data from LLM output with streaming support |
132-
| **Prompt Watermarking** | Embed signed provenance markers for attribution and forensics |
133-
| **Fail-Closed Design** | Invalid policies reject at load time; errors deny access |
134-
| **Signed Receipts** | Tamper-evident audit trail with Ed25519 signatures |
168+
| **Deterministic Decisions** | Stable `reason_code` + severity metadata for enforcement analytics and regression checks |
169+
| **Fail-Closed Design** | Invalid policies reject at load time; evaluation errors deny access |
170+
| **Signed Receipts** | Tamper-evident audit trail with Ed25519 signatures |
171+
| **Output Sanitization** | Redact secrets/PII/internal data from model output with streaming support |
172+
| **Prompt Watermarking** | Embed signed provenance markers for attribution and forensics |
135173

136174
## Performance
137175

@@ -147,13 +185,20 @@ No external API calls required for core detection. [Full benchmarks →](docs/sr
147185

148186
## Documentation
149187

150-
- [Design Philosophy](docs/src/concepts/design-philosophy.md) — Fail-closed, defense in depth
151-
- [Enforcement Tiers & Integration Contract](docs/src/concepts/enforcement-tiers.md) — What is enforceable at the tool boundary (and what requires a sandbox/broker)
152-
- [Guards Reference](docs/src/reference/guards/README.md) — All 7 guards documented
153-
- [Policy Schema](docs/src/reference/policy-schema.md) — YAML configuration
154-
- [Framework Integrations](docs/src/concepts/multi-language.md) — OpenClaw, Vercel AI, LangChain
155-
- [Repository Map](docs/REPO_MAP.md) — Newcomer guide to project layout and component maturity
156-
- [Documentation Map](docs/DOCS_MAP.md) — Canonical source-of-truth guide for docs
188+
- [Quick Start (Rust)](docs/src/getting-started/quick-start.md)
189+
- [Quick Start (TypeScript)](docs/src/getting-started/quick-start-typescript.md)
190+
- [Quick Start (Python)](docs/src/getting-started/quick-start-python.md)
191+
- [OpenClaw Integration Guide](docs/src/guides/openclaw-integration.md)
192+
- [Agent OpenClaw Operations Runbook](docs/src/guides/agent-openclaw-operations.md)
193+
- [OpenClaw Gateway Testing Guide](apps/desktop/docs/openclaw-gateway-testing.md)
194+
- [CUA Production Readiness Test Plan](production-readiness-test-plan.md)
195+
- [CUA Roadmap Index](docs/roadmaps/cua/INDEX.md)
196+
- [Design Philosophy](docs/src/concepts/design-philosophy.md)
197+
- [Enforcement Tiers & Integration Contract](docs/src/concepts/enforcement-tiers.md)
198+
- [Guards Reference](docs/src/reference/guards/README.md)
199+
- [Policy Schema](docs/src/reference/policy-schema.md)
200+
- [Repository Map](docs/REPO_MAP.md)
201+
- [Documentation Map](docs/DOCS_MAP.md)
157202

158203
## Security
159204

apps/agent/src-tauri/Cargo.lock

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/agent/src-tauri/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ which = "6"
5757

5858
# Shared crypto/data primitives
5959
hush-core = { path = "../../../crates/libs/hush-core" }
60+
base64 = "0.22"
61+
ed25519-dalek = { version = "2.2", features = ["pem", "pkcs8"] }
6062

6163
# Logging
6264
tracing = "0.1"

0 commit comments

Comments
 (0)