Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
e3292e7
feat: add safety hardening spec addressing red team review (issue #4)
jeremymanning Apr 16, 2026
fbed04a
feat: Phase 1 setup — new safety modules with tests (T001-T010)
jeremymanning Apr 16, 2026
b790053
feat: Phase 2 attestation enforcement — replace stubs with real verif…
jeremymanning Apr 16, 2026
3f18001
feat: Phase 3 sandbox enforcement — real VM lifecycle + egress + pree…
jeremymanning Apr 16, 2026
398bb27
ci: add GitHub Actions workflow for Principle V safety verification
jeremymanning Apr 16, 2026
c09cddc
feat: Phase 4 attestation dispatch — wire verification into broker (T…
jeremymanning Apr 16, 2026
2b6f1b8
feat: Phase 5 governance hardening — quorum, time-lock, halt auth (T0…
jeremymanning Apr 16, 2026
f690c30
fix(ci): install protoc on all CI runners
jeremymanning Apr 16, 2026
012926b
feat: Phase 6 policy engine completion — data classification + LLM gu…
jeremymanning Apr 16, 2026
2385f45
feat: Phase 7 incident response — quarantine wired into policy engine…
jeremymanning Apr 16, 2026
2625202
feat: Phase 8 identity — DonorId type, format enforcement, uniqueness…
jeremymanning Apr 16, 2026
edddc4f
feat: Phase 9 supply chain — provenance, release channels, build meta…
jeremymanning Apr 16, 2026
0bdbc20
docs: Phase 10 polish — README, whitepaper, session notes (T099-T107)
jeremymanning Apr 16, 2026
1ab167d
test: Principle V hardware verification on Linux AMD EPYC (T022, T098)
jeremymanning Apr 16, 2026
0086c9c
test: add 24 standalone integration test files (T023-T085)
jeremymanning Apr 16, 2026
9a7f868
feat: T091 wire identity verification into enrollment flow
jeremymanning Apr 16, 2026
4e9c398
feat: T036/T045/T086/T087 — Firecracker on KVM, swtpm dispatch, BrightID
jeremymanning Apr 16, 2026
aec8363
docs: update README honesty notice — no usable agent yet
jeremymanning Apr 16, 2026
dcc2462
feat: update agent tracking with new scientist agents and adjust totals
jeremymanning Apr 16, 2026
1f25a8e
feat: complete all 110 tasks — red team exercise + remaining tests
jeremymanning Apr 16, 2026
1a80a33
docs: update README, CLAUDE.md, whitepaper with verified facts + carg…
jeremymanning Apr 16, 2026
3b184b9
fix(ci): resolve clippy warnings under RUSTFLAGS=-Dwarnings
jeremymanning Apr 17, 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
223 changes: 223 additions & 0 deletions .github/workflows/safety-hardening-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,223 @@
name: Safety Hardening — Principle V Tests

on:
push:
branches: [002-safety-hardening, main]
pull_request:
branches: [main]

env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1

jobs:
# ─── Standard tests (all platforms) ─────────────────────────────────
test-linux:
name: Tests (Linux)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2

- name: Install protoc
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler

- name: Build
run: cargo build --lib

- name: Run unit + integration tests
run: cargo test --lib

- name: Clippy (zero warnings)
run: cargo clippy --lib -- -D warnings

- name: Verify attestation rejects forged quotes
run: cargo test --lib verification::attestation::tests -- --nocapture

- name: Verify policy engine rejects invalid submissions
run: cargo test --lib policy::engine::tests -- --nocapture

- name: Verify governance separation of duties
run: cargo test --lib governance::roles::tests -- --nocapture

- name: Verify egress IP blocking
run: cargo test --lib sandbox::egress::tests -- --nocapture

- name: Verify incident containment auth
run: cargo test --lib incident::containment::tests -- --nocapture

- name: Verify artifact registry separation
run: cargo test --lib registry::tests -- --nocapture

test-macos:
name: Tests (macOS)
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2

- name: Install protoc
run: brew install protobuf

- name: Build
run: cargo build --lib

- name: Run all tests
run: cargo test --lib

- name: Verify macOS idle detection works
run: cargo test --lib preemption::triggers::tests::system_idle_ms_returns_something_on_macos -- --nocapture

- name: Verify sandbox cleanup removes work dir
run: cargo test --lib sandbox::apple_vf::tests -- --nocapture

test-windows:
name: Tests (Windows)
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2

- name: Install protoc
run: choco install protoc -y

- name: Build
run: cargo build --lib

- name: Run all tests
run: cargo test --lib

# ─── KVM sandbox tests (Linux with KVM) ─────────────────────────────
sandbox-linux-kvm:
name: Sandbox (Linux KVM)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2

- name: Install protoc
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler

- name: Check KVM availability
id: kvm
run: |
if [ -e /dev/kvm ]; then
echo "available=true" >> "$GITHUB_OUTPUT"
echo "KVM is available"
else
echo "available=false" >> "$GITHUB_OUTPUT"
echo "KVM not available — sandbox tests will be skipped"
fi

- name: Install Firecracker
if: steps.kvm.outputs.available == 'true'
run: |
FC_VERSION="1.6.0"
curl -fsSL "https://github.com/firecracker-microvm/firecracker/releases/download/v${FC_VERSION}/firecracker-v${FC_VERSION}-x86_64.tgz" | tar xz
sudo mv "release-v${FC_VERSION}-x86_64/firecracker-v${FC_VERSION}-x86_64" /usr/local/bin/firecracker
sudo chmod +x /usr/local/bin/firecracker
firecracker --version

- name: Run sandbox tests (KVM)
if: steps.kvm.outputs.available == 'true'
run: |
cargo test --lib sandbox::firecracker::tests -- --nocapture
echo "Firecracker sandbox tests passed"

- name: Run egress enforcement tests
run: cargo test --lib sandbox::egress::tests -- --nocapture

- name: Generate Principle V evidence artifact
if: always()
env:
KVM_AVAILABLE: ${{ steps.kvm.outputs.available }}
run: |
mkdir -p evidence
echo "# Principle V Test Evidence" > evidence/sandbox-linux.md
echo "Date: $(date -u)" >> evidence/sandbox-linux.md
echo "Runner: $(uname -a)" >> evidence/sandbox-linux.md
echo "KVM available: ${KVM_AVAILABLE}" >> evidence/sandbox-linux.md
cargo test --lib sandbox 2>&1 | tail -1 >> evidence/sandbox-linux.md

- uses: actions/upload-artifact@v4
if: always()
with:
name: evidence-sandbox-linux
path: evidence/

# ─── Software TPM attestation tests ──────────────────────────────────
attestation-swtpm:
name: Attestation (swtpm)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2

- name: Install protoc and swtpm
run: |
sudo apt-get update
sudo apt-get install -y protobuf-compiler swtpm swtpm-tools tpm2-tools || echo "swtpm install failed — using built-in test helpers"

- name: Run attestation verification tests
run: |
cargo test --lib verification::attestation::tests -- --nocapture
echo "All attestation tests passed"

- name: Run manifest signature tests
run: |
cargo test --lib scheduler::manifest::tests -- --nocapture
echo "Manifest signature verification tests passed"

- name: Generate Principle V evidence artifact
if: always()
run: |
mkdir -p evidence
echo "# Principle V Test Evidence — Attestation" > evidence/attestation.md
echo "Date: $(date -u)" >> evidence/attestation.md
echo "Runner: $(uname -a)" >> evidence/attestation.md
which swtpm > /dev/null 2>&1 && swtpm --version >> evidence/attestation.md || echo "swtpm: not available" >> evidence/attestation.md
cargo test --lib verification::attestation 2>&1 | tail -1 >> evidence/attestation.md

- uses: actions/upload-artifact@v4
if: always()
with:
name: evidence-attestation
path: evidence/

# ─── Full safety audit summary ───────────────────────────────────────
safety-audit:
name: Safety Audit Summary
runs-on: ubuntu-latest
needs: [test-linux, test-macos, test-windows, sandbox-linux-kvm, attestation-swtpm]
if: always()
env:
LINUX_RESULT: ${{ needs.test-linux.result }}
MACOS_RESULT: ${{ needs.test-macos.result }}
WINDOWS_RESULT: ${{ needs.test-windows.result }}
SANDBOX_RESULT: ${{ needs.sandbox-linux-kvm.result }}
ATTEST_RESULT: ${{ needs.attestation-swtpm.result }}
steps:
- name: Check all jobs passed
run: |
echo "=== Safety Hardening CI Results ==="
echo "test-linux: ${LINUX_RESULT}"
echo "test-macos: ${MACOS_RESULT}"
echo "test-windows: ${WINDOWS_RESULT}"
echo "sandbox-linux-kvm: ${SANDBOX_RESULT}"
echo "attestation-swtpm: ${ATTEST_RESULT}"
echo ""
if [ "${LINUX_RESULT}" != "success" ] || \
[ "${MACOS_RESULT}" != "success" ] || \
[ "${WINDOWS_RESULT}" != "success" ]; then
echo "FAIL: Core tests failed on one or more platforms"
exit 1
fi
echo "PASS: All core platform tests passed"
echo "Note: KVM/swtpm tests may skip if hardware unavailable"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ Thumbs.db

# Evidence artifacts (generated, not committed)
evidence/
.credentials
Loading
Loading