# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.1.0] - 2026-02-13

### Added
- **Prompt Injection Detection**: Rule-based regex scanning + optional embedding-based semantic detection
- **Secret Detection**: API keys, credentials, JWT tokens, RSA keys, database URLs (16+ patterns)
- **PII Detection**: Email, phone numbers, credit cards (Luhn-validated), SSN, IP addresses
- **Dependency Auditing**: CVE detection via OSV API, PyPI freshness checks, typosquatting detection
- **Risk Scoring Engine**: Configurable weighted scoring (injection 40%, secrets 30%, PII 20%, entropy 10%)
- **Guard API**: Core `scan()`, `sanitize()`, `score()` interface
- **GuardedLLM Middleware**: Drop-in wrapper for OpenAI & Anthropic APIs
- **Audit Logging**: JSON-lines and SQLite backends with structured event tracking
- **CLI**: `contextguard scan|audit|report` commands
- **Comprehensive test suite**: 92 unit tests (all passing)
- **Optional features**: spaCy NER for PII, sentence-transformers for semantic injection detection

### Note
- Published on PyPI as `contextguard-ai` (the original `contextguard` name was already taken)

### Known Limitations
- Embedding-based detection optional (accuracy vs. speed trade-off)
- OSV API calls may be slow on first run
- No persistence for fine-tuned detection rules (yet)

## Future Roadmap
- [ ] FastAPI/Django middleware plugins
- [ ] Real-time monitoring dashboard
- [ ] CI/CD integration (GitHub Actions, GitLab, etc.)
- [ ] Adaptive ML-based injection detection
- [ ] Prompt mutation attack resistance
- [ ] Context-aware AI firewall
