KeyClaw is a local security tool for AI developer workflows. Contributions should preserve the trust boundary, fail-closed behavior, and operator clarity that make the project usable in real environments.
- Check existing issues to avoid duplicate work.
- Open an issue before starting large behavioral or architectural changes.
- Read the README, docs/, and SECURITY.md so your changes stay aligned with the published operating model.
git clone https://github.com/GuthL/KeyClaw.git
cd KeyClaw
cargo build
cargo test
cargo run -- --help- Rust 1.75+ via rustup
- No external detector binaries are required for the default runtime
KeyClaw now uses an in-process sensitive-data engine centered on src/sensitive.rs: typed structured detectors plus opaque high-entropy token detection, all backed by a session-scoped resolver.
src/: runtime implementationtests/: unit and integration coveragedocs/: user-facing documentation beyond the README.github/: CI, release automation, and community templatesscripts/: release packaging and verification helpers
For the codebase module map, see AGENTS.md or CLAUDE.md.
Use this as the default local loop:
cargo fmt --check
cargo clippy --all-targets --all-features -- -D warnings
cargo build --locked
cargo test --locked
cargo doc --no-depsRun the slow daemon/proxy tier explicitly before you open a pull request:
cargo test --locked --test e2e_cli -- --ignored --test-threads=1The default cargo test --locked path skips the slow daemon/proxy lifecycle e2e scenarios so day-to-day iteration stays tighter. CI still runs that ignored tier explicitly.
If you are changing release packaging, also run:
scripts/package-release.sh 0.1.0 x86_64-unknown-linux-gnu target/release/keyclaw dist
scripts/verify-release-contract.sh 0.1.0 distWhen you change public behavior, keep the public docs in sync:
README.mdfor first-run setup, quickstart, positioning, and operator-facing guidancedocs/for deeper reference material such as configuration, architecture, and threat modelSECURITY.mdfor scope, trust boundary, and reporting guidance- CLI help text when commands, flags, or workflows change
When you change setup guidance, keep these contracts intact unless the implementation changes intentionally:
keyclaw proxystarts the daemonsource ~/.keyclaw/env.shwires the shell to the proxy- Linux autostart keeps the daemon alive across login or reboot, but does not reconfigure existing shells
keyclaw doctoris the primary operator verification path
- Add or update tests close to the changed behavior.
- Prefer focused tests over broad incidental coverage.
- Preserve fail-closed behavior unless the change is explicitly about relaxing that policy.
When adding or adjusting detection behavior:
- Edit
src/sensitive.rs. - Add tests in
tests/placeholder.rsandtests/pipeline.rs. - Add
tests/integration_proxy.rscoverage when the behavior changes end-to-end proxy rewriting or response reinjection.
Suggested verification:
cargo test placeholder
cargo test --test pipeline
cargo test --test integration_proxyIn short: src/sensitive.rs is the normal path for new detector work.
- Keep PRs focused and explain the operator or maintainer impact clearly.
- Include the validation commands you ran.
- Update docs and screenshots or SVG assets when the repo-facing experience changes.
- Do not include real secrets, private certificates, or local machine state in commits.
GitHub Actions is the release gate for this repository.
CIruns formatting, clippy, build, and test checks on pushes and pull requestsReleasebuilds the supported Linux/macOS archives on version tags and publishes the GitHub release artifacts used by downstream packaging
Maintainers are responsible for keeping all public distribution channels aligned on the same version:
- crates.io package:
cargo publish --locked - GitHub release artifacts: version tag
vX.Y.Z - Homebrew tap:
GuthL/homebrew-tap
The release workflow also updates the Homebrew tap automatically. Configure HOMEBREW_TAP_GITHUB_TOKEN in the KeyClaw repo secrets with a token that has write access to GuthL/homebrew-tap.
Maintainers should use docs/release/maintainer-checklist.md as the release source of truth for versioning, verification, publication, and rollback.
Treat scripts/package-release.sh, scripts/verify-release-contract.sh, scripts/render-homebrew-formula.sh, and .github/workflows/release.yml as the implementation backing that checklist.
If you discover a security vulnerability, follow SECURITY.md. Do not open a public issue for vulnerabilities.
By contributing, you agree that your contributions will be licensed under the MIT License.