Skip to content

Commit 0557f84

Browse files
GeneAIclaude
authored andcommitted
feat: Release v3.5.0 - Memory API Security Hardening
## Security Hardening - Input validation for pattern IDs, agent IDs, and classifications - Prevents path traversal attacks (../, ..\) - Validates format with regex patterns - Rejects null bytes and dangerous characters - API Key authentication (Bearer token or X-API-Key header) - Set via --api-key CLI flag or EMPATHY_MEMORY_API_KEY env var - Constant-time comparison using SHA-256 hash - Rate limiting (default: 100 requests/minute per IP) - Configurable via --rate-limit and --no-rate-limit CLI flags - Returns X-RateLimit-Remaining and X-RateLimit-Limit headers - HTTPS support via --ssl-cert and --ssl-key CLI flags - CORS restricted to localhost by default (configurable via --cors-origins) - Request body size limit (1MB) prevents DoS attacks ## Memory Control Panel - View Patterns button displays pattern list with classification badges - Project-level auto_start_redis config in empathy.config.yml - Visual feedback for button actions (Check Status, Export) - Fixed config key mismatch (empathyMemory → empathy.memory) - Fixed API response parsing for Redis status display ## Tests - Added 37 unit tests for security features - Input validation, rate limiting, API key auth tests 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent 10d6c3e commit 0557f84

File tree

10 files changed

+1158
-64
lines changed

10 files changed

+1158
-64
lines changed

CHANGELOG.md

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,54 @@ All notable changes to the Empathy Framework will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [Unreleased]
8+
## [3.5.0] - 2025-12-29
9+
10+
### Added
11+
12+
- Memory Control Panel: View Patterns button now displays pattern list with classification badges
13+
- Memory Control Panel: Project-level `auto_start_redis` config option in `empathy.config.yml`
14+
- Memory Control Panel: Visual feedback for button actions (Check Status, Export show loading states)
15+
- Memory Control Panel: "Check Status" button for manual status refresh (renamed from Refresh)
16+
- VSCode Settings: `empathy.memory.autoRefresh` - Enable/disable auto-refresh (default: true)
17+
- VSCode Settings: `empathy.memory.autoRefreshInterval` - Refresh interval in seconds (default: 30)
18+
- VSCode Settings: `empathy.memory.showNotifications` - Show operation notifications (default: true)
19+
20+
### Security
21+
22+
**Memory API Security Hardening** (v2.2.0)
23+
24+
- **Input Validation**: Pattern IDs, agent IDs, and classifications are now validated on both client and server
25+
- Prevents path traversal attacks (`../`, `..\\`)
26+
- Validates format with regex patterns
27+
- Length bounds checking (3-64 chars)
28+
- Rejects null bytes and dangerous characters
29+
- **API Key Authentication**: Optional Bearer token or X-API-Key header authentication
30+
- Set via `--api-key` CLI flag or `EMPATHY_MEMORY_API_KEY` environment variable
31+
- Constant-time comparison using SHA-256 hash
32+
- **Rate Limiting**: Per-IP rate limiting (default: 100 requests/minute)
33+
- Configurable via `--rate-limit` and `--no-rate-limit` CLI flags
34+
- Returns `X-RateLimit-Remaining` and `X-RateLimit-Limit` headers
35+
- **HTTPS Support**: Optional TLS encryption
36+
- Set via `--ssl-cert` and `--ssl-key` CLI flags
37+
- **CORS Restrictions**: CORS now restricted to localhost by default
38+
- Configurable via `--cors-origins` CLI flag
39+
- **Request Body Size Limit**: 1MB limit prevents DoS attacks
40+
- **TypeScript Client**: Added input validation matching backend rules
41+
42+
### Fixed
43+
44+
- Memory Control Panel: Fixed config key mismatch (`empathyMemory``empathy.memory`) preventing settings from loading
45+
- Memory Control Panel: Fixed API response parsing for Redis status display
46+
- Memory Control Panel: Fixed pattern statistics not updating correctly
47+
- Memory Control Panel: View Patterns now properly displays pattern list instead of just count
48+
49+
### Tests
50+
51+
- Added 37 unit tests for Memory API security features
52+
- Input validation tests (pattern IDs, agent IDs, classifications)
53+
- Rate limiter tests (limits, window expiration, per-IP tracking)
54+
- API key authentication tests (enable/disable, env vars, constant-time comparison)
55+
- Integration tests for security features
956

1057
---
1158

empathy.config.yml

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Empathy Framework Configuration
2-
# Generated by Initialize Wizard on 2025-12-28T20:24:33.996Z
2+
# Generated by Initialize Wizard on 2025-12-29T05:50:14.865Z
33

44
# Primary LLM provider
55
provider: google
@@ -18,11 +18,55 @@ workflows:
1818
# Enable XML-structured outputs for workflows
1919
xml_enhanced: true
2020

21+
# =============================================================================
22+
# COMPLIANCE MODE & PII SCRUBBING
23+
# =============================================================================
24+
# Choose from: "standard" (default) or "hipaa" (healthcare)
25+
#
26+
# standard mode:
27+
# - PII scrubbing: DISABLED by default
28+
# - All workflows enabled (test-gen, code-review, etc.)
29+
# - Audit level: standard
30+
#
31+
# hipaa mode (for healthcare applications):
32+
# - PII scrubbing: ENABLED by default (HIPAA-compliant data handling)
33+
# - Audit level: hipaa (enhanced logging for compliance)
34+
# - 90-day data retention policies enforced
35+
#
36+
compliance_mode: standard
37+
38+
# =============================================================================
39+
# PII SCRUBBING (Security Feature)
40+
# =============================================================================
41+
# PII scrubbing removes sensitive data (SSNs, emails, medical records, etc.)
42+
# from LLM prompts and responses.
43+
#
44+
# - In standard mode: disabled by default (opt-in below)
45+
# - In hipaa mode: enabled by default (required for compliance)
46+
#
47+
# To enable PII scrubbing without full HIPAA mode, uncomment:
48+
# pii_scrubbing_enabled: true
49+
50+
# =============================================================================
51+
# WORKFLOW CONTROLS
52+
# =============================================================================
53+
# All workflows are enabled by default, including test-gen.
54+
# Use disabled_workflows to turn off specific workflows:
55+
#
56+
# disabled_workflows:
57+
# - bug-predict
58+
# - perf-audit
59+
60+
# Audit logging level: "standard", "enhanced", or "hipaa"
61+
# audit_level: standard
62+
2163
# Memory settings
2264
memory:
2365
# Enable Redis-backed short-term memory
2466
enabled: true
2567
redis_url: redis://localhost:6379
68+
# Auto-start Redis when Memory panel opens (project-level setting)
69+
auto_start_redis: true
2670

2771
# Telemetry settings
2872
telemetry:

pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "empathy-framework"
7-
version = "3.4.0"
7+
version = "3.5.0"
88
description = "AI collaboration framework with persistent memory, anticipatory intelligence, code inspection, and multi-agent orchestration"
99
readme = {file = "README.md", content-type = "text/markdown"}
1010
requires-python = ">=3.10"
@@ -379,6 +379,8 @@ branch = true
379379
precision = 2
380380
show_missing = true
381381
skip_covered = false
382+
# Coverage threshold - increase as tests improve (target: 75%)
383+
fail_under = 40
382384
exclude_lines = [
383385
"pragma: no cover",
384386
"def __repr__",

0 commit comments

Comments
 (0)