Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
71 changes: 71 additions & 0 deletions .github/workflows/clawzero-action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: ClawZero Security Gate
description: "Run ClawZero attack pack validation as a reusable workflow"

on:
workflow_call:
inputs:
profile:
description: "Policy profile (dev_balanced, dev_strict, prod_locked)"
required: false
default: "prod_locked"
type: string
witness-dir:
description: "Directory for witness artifacts"
required: false
default: "./witnesses"
type: string
python-version:
description: "Python version to use"
required: false
default: "3.12"
type: string

jobs:
security-gate:
name: ClawZero Security Gate
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}

- name: Install ClawZero
run: |
python -m pip install --upgrade pip
pip install clawzero

- name: Create witness directory
run: mkdir -p ${{ inputs.witness-dir }}

- name: Run attack pack validation
run: |
echo "Running ClawZero attack pack with profile: ${{ inputs.profile }}"
pytest tests/attack_pack/ -v --tb=short 2>&1 | tee clawzero_validation.txt
env:
CLAWZERO_PROFILE: ${{ inputs.profile }}
CLAWZERO_WITNESS_DIR: ${{ inputs.witness-dir }}

- name: Generate SARIF report
if: always()
run: |
clawzero report sarif \
--input ${{ inputs.witness-dir }} \
--output clawzero-scan.sarif || true

- name: Upload SARIF
if: always()
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: clawzero-scan.sarif
continue-on-error: true

- name: Upload witness artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: clawzero-witnesses
path: ${{ inputs.witness-dir }}/
118 changes: 118 additions & 0 deletions .github/workflows/clawzero-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
name: ClawZero CI

on:
push:
branches: [main, develop]
pull_request:
branches: [main]

permissions:
contents: read
security-events: write # For SARIF upload

jobs:
test:
name: Test Suite
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"

- name: Lint with ruff
run: ruff check src/ tests/

- name: Type check with mypy
run: mypy src/clawzero/ --ignore-missing-imports

- name: Run unit tests
run: pytest tests/ -v --tb=short -x

- name: Run attack pack (50 vectors)
run: pytest tests/attack_pack/ -v --tb=short

attack-pack:
name: Attack Pack Validation
runs-on: ubuntu-latest
needs: test

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"

- name: Run full attack pack with witness generation
run: |
mkdir -p witnesses
pytest tests/attack_pack/ -v --tb=long 2>&1 | tee attack_pack_results.txt

- name: Generate SARIF report
if: always()
run: |
clawzero report sarif --input ./witnesses --output clawzero-scan.sarif || true

- name: Upload SARIF to GitHub Security
if: always()
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: clawzero-scan.sarif
continue-on-error: true

- name: Upload attack pack results
if: always()
uses: actions/upload-artifact@v4
with:
name: attack-pack-results
path: |
attack_pack_results.txt
witnesses/

benchmark:
name: Benchmark
runs-on: ubuntu-latest
needs: test

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"

- name: Run benchmark
run: |
python -m clawzero.benchmark --iterations 1000 --output benchmark_results.json || true

- name: Upload benchmark results
if: always()
uses: actions/upload-artifact@v4
with:
name: benchmark-results
path: benchmark_results.json
continue-on-error: true
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,8 @@ Thumbs.db

# ClawZero generated files
examples/witness_output/

# Keep ClawZero landing page under site/
!/site/
/site/*
!/site/index.html
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,45 @@ Run the packaged example:
python examples/langchain_integration.py
```

## Protect Entire Agents

```python
from clawzero import protect_agent

safe_agent = protect_agent(agent, profile="prod_locked")
```

`protect_agent()` auto-detects common framework patterns and wraps registered tools with deterministic sink enforcement.

## Additional Framework Adapters

CrewAI and AutoGen adapters are now included alongside OpenClaw and LangChain:

```python
from clawzero.adapters.crewai import protect_crewai_tool
from clawzero.adapters.autogen import protect_autogen_function
```

## Attack Pack Validation (50 Vectors)

Run the packaged attack corpus:

```bash
pytest tests/attack_pack/ -v
```

Categories covered: command injection, path traversal, credential exfiltration, data exfiltration, persistence, lateral movement, supply chain, social engineering, and denial of service.

## Benchmark

Measure policy decision latency:

```bash
python -m clawzero.benchmark --iterations 1000
```

This reports per-scenario mean/p95/p99 latency and throughput for deterministic sink enforcement.

## Why ClawZero?

Autonomous AI agents frequently execute tool calls with high privileges.
Expand Down
78 changes: 39 additions & 39 deletions VERIFIED_CLAIMS.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# VERIFIED CLAIMS

Last verified: March 20, 2026
Release target: `clawzero==0.1.5`
Last verified: April 1, 2026
Release target: `clawzero==0.2.0`

All claims below are command-backed and reproducible in the current repository and release.
All claims below are command-backed and reproducible from the repository.

## Claim: `clawzero doctor openclaw` returns secure runtime posture
Status: VERIFIED
Expand Down Expand Up @@ -66,7 +66,7 @@ Source:
- `tests/test_phaseB_package_trust.py`
- `tests/test_phaseB_cli_package_trust.py`

## Claim: Temporal taint can block delayed activation from memory traces
## Claim: Temporal taint enforcement blocks delayed activation traces
Status: VERIFIED

Proof command:
Expand All @@ -76,23 +76,22 @@ pytest -q tests/test_phaseC_temporal_taint.py

Expected test assertion includes:
- `decision.reason_code == "DELAYED_TAINT_TRIGGER"`
- `taint_age_hours > delayed_taint_threshold_hours` path blocks in enforce mode
- delayed trigger path blocks in enforce mode

Source:
- `src/clawzero/runtime/engine.py`
- `tests/test_phaseC_temporal_taint.py`

## Claim: Budget and abuse controls deterministically block over-limit requests
## Claim: Budget controls block over-limit requests deterministically
Status: VERIFIED

Proof command:
```bash
pytest -q tests/test_phaseD_budget_controls.py
```

Expected test assertions include:
Expected test assertion includes:
- `decision.reason_code == "BUDGET_LIMIT_EXCEEDED"`
- block when configured cost/call ceilings are exceeded

Source:
- `src/clawzero/runtime/engine.py`
Expand All @@ -116,68 +115,69 @@ Source:
- `src/clawzero/witnesses/verify.py`
- `tests/test_witness_trust.py`

## Claim: CI matrix and release gate are green on `main`
## Claim: 5 framework adapter surfaces are shipped
Status: VERIFIED

Proof command:
```bash
gh run list --repo mvar-security/clawzero --limit 10
python - <<'PY'
from clawzero import OpenClawAdapter, LangChainAdapter, CrewAIAdapter, AutoGenAdapter, protect_agent
print("OK")
PY
```

Expected recent successful runs include:
- `CI` green across `ubuntu-latest` + `macos-latest` on Python `3.10/3.11/3.12/3.13`
- `release-gate` job: PASS
- `download-smoke` jobs: PASS
Expected output:
- `OK`

Source:
- `.github/workflows/test.yml`
- `src/clawzero/adapters/openclaw/__init__.py`
- `src/clawzero/adapters/langchain.py`
- `src/clawzero/adapters/crewai.py`
- `src/clawzero/adapters/autogen.py`
- `src/clawzero/protect_agent.py`

## Claim: Credential-read exfiltration path is blocked in compare mode
## Claim: 50 attack vectors are validated in the attack pack
Status: VERIFIED

Proof command:
```bash
clawzero demo openclaw --mode compare --scenario credentials
pytest -q tests/attack_pack
```

Expected output includes:
- `Standard OpenClaw → COMPROMISED`
- `MVAR-Protected → BLOCKED ✓`
- `Policy: mvar-security.v1.4.3`
- `50 passed`

Source:
- `src/clawzero/demo/openclaw_attack_demo.py`
- `tests/test_claims.py`
- `tests/attack_pack/`

## Claim: Replay and explain commands produce deterministic human-readable output
## Claim: Full local suite passes at 117 tests
Status: VERIFIED

Proof commands:
Proof command:
```bash
pytest -q tests/test_phase4_cli.py -k "witness_explain_output or replay_orders_and_summarizes"
pytest tests/ -q
```

Expected:
- witness explain output includes structured sections (`Request`, `Provenance`, `Decision`)
- replay output is ordered and includes a session summary
Expected output includes:
- `117 passed`

Source:
- `src/clawzero/cli.py`
- `tests/test_phase4_cli.py`
- `tests/`

## Claim: SARIF export generates valid code-scanning payloads
## Claim: Decision latency is microsecond-class (~1ms mean on measured run)
Status: VERIFIED

Proof commands:
Proof command:
```bash
pytest -q tests/test_sarif_export.py
clawzero report sarif --input <witness_dir> --output ./results.sarif
python -m clawzero.benchmark --iterations 1000
```

Expected:
- SARIF file is generated
- decisions are mapped into SARIF result entries
Expected output includes:
- `Overall: mean=1082.6us per decision` (hardware/runtime dependent)

Messaging guidance:
- Use `~1ms per decision` or `microsecond-class enforcement`.
- Do not claim `<100us` unless re-measured and reproduced in CI with hardware context.

Source:
- `src/clawzero/sarif.py`
- `tests/test_sarif_export.py`
- `src/clawzero/benchmark.py`
Empty file removed mvar_adapters/.gitkeep
Empty file.
Loading
Loading