# Contributing to openclaw-security-guardrails

Thank you for your interest in making OpenClaw more secure!

## How to Contribute

### Adding Detection Patterns

1. Choose the appropriate pattern file in `src/rules/`
2. Add your pattern with a descriptive name and appropriate severity
3. Add test cases in the corresponding `tests/` file — both detection and false-positive tests
4. Run `npm test` and ensure all tests pass
5. Keep each file under 300 lines

### Reporting False Positives

If a detection rule triggers on legitimate content, please open an issue with:

- The text that caused the false positive
- Which rule was triggered
- Why you believe it's a false positive

### Development Setup

```bash
git clone https://github.com/shanggqm/openclaw-security-guardrails
cd openclaw-security-guardrails
npm install
npm test
```

### Code Standards

- **TypeScript** strict mode
- **Zero dependencies** — only Node.js built-in APIs
- **Performance** — all detection under 20ms
- **Error isolation** — handlers never throw; use try-catch internally
- **Conventional Commits** — `feat:`, `fix:`, `docs:`, `test:`, etc.

### Pull Request Process

1. Fork and create a feature branch from `main`
2. Make your changes with tests
3. Ensure `npm test` passes with zero failures
4. Submit a PR with a clear description

## License

By contributing, you agree that your contributions will be licensed under the MIT License.
