Spaces:
Sleeping
Sleeping
Commit
Β·
557d023
1
Parent(s):
adf80ee
update the readme file
Browse files- README.md +3 -1
- backend/README.md +15 -0
- frontend/README.md +16 -0
README.md
CHANGED
|
@@ -91,6 +91,7 @@ Then access:
|
|
| 91 |
- Regex-based red-flag pattern matching with severity levels (low/medium/high/critical)
|
| 92 |
- Automatic admin alerts for violations
|
| 93 |
- **LLM-Enhanced Rules**: Rules are automatically analyzed and enhanced to identify edge cases, improve regex patterns, and suggest appropriate severity levels
|
|
|
|
| 94 |
- **File Upload Support**: Upload rules from TXT, PDF, DOC, or DOCX files with drag-and-drop interface
|
| 95 |
- **Chunk Processing**: Large rule sets processed in manageable chunks (5 rules at a time) to prevent timeouts
|
| 96 |
- **Rule-Based Behavior Control**: Rules checked FIRST - brief response rules return quick answers, blocking rules prevent requests
|
|
@@ -114,7 +115,7 @@ Then access:
|
|
| 114 |
### Enterprise Features
|
| 115 |
|
| 116 |
- π **Regex-Based Red-Flag Detection** β Support for complex regex patterns with keyword fallback and semantic scoring
|
| 117 |
-
- π€ **LLM-Enhanced Rule Management** β Rules automatically enhanced by LLM to identify edge cases, improve patterns, and suggest severity levels
|
| 118 |
- π **File Upload & Drag-and-Drop** β Upload rules from files (TXT, PDF, DOC, DOCX) with intuitive drag-and-drop interface
|
| 119 |
- β‘ **Chunk-Wise Processing** β Large rule sets processed in chunks to prevent timeouts and ensure reliable processing
|
| 120 |
- π **Real-Time Analytics Dashboard** β Per-tenant analytics with configurable time windows (7, 30, 90 days)
|
|
@@ -869,6 +870,7 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
|
|
| 869 |
### Admin Rules System (Latest)
|
| 870 |
- **File Upload Support**: Upload rules from TXT, PDF, DOC, DOCX files with drag-and-drop interface
|
| 871 |
- **LLM Enhancement**: Automatic rule enhancement identifies edge cases, improves regex patterns, and suggests severity levels
|
|
|
|
| 872 |
- **Chunk Processing**: Large rule sets processed in chunks of 5 to prevent timeouts (handles 100+ rules efficiently)
|
| 873 |
- **Comment Filtering**: Comment lines (starting with #) automatically ignored when uploading rules
|
| 874 |
- **Rule-First Processing**: Admin rules checked before intent classification - enables behavior control (brief responses vs blocking)
|
|
|
|
| 91 |
- Regex-based red-flag pattern matching with severity levels (low/medium/high/critical)
|
| 92 |
- Automatic admin alerts for violations
|
| 93 |
- **LLM-Enhanced Rules**: Rules are automatically analyzed and enhanced to identify edge cases, improve regex patterns, and suggest appropriate severity levels
|
| 94 |
+
- **LLM-Guided Rule Explanations**: Automatic generation of human-readable explanations, concrete examples, and missing pattern suggestions. Includes intelligent fallback when LLM is unavailable - uses keyword extraction to provide useful explanations even during timeouts
|
| 95 |
- **File Upload Support**: Upload rules from TXT, PDF, DOC, or DOCX files with drag-and-drop interface
|
| 96 |
- **Chunk Processing**: Large rule sets processed in manageable chunks (5 rules at a time) to prevent timeouts
|
| 97 |
- **Rule-Based Behavior Control**: Rules checked FIRST - brief response rules return quick answers, blocking rules prevent requests
|
|
|
|
| 115 |
### Enterprise Features
|
| 116 |
|
| 117 |
- π **Regex-Based Red-Flag Detection** β Support for complex regex patterns with keyword fallback and semantic scoring
|
| 118 |
+
- π€ **LLM-Enhanced Rule Management** β Rules automatically enhanced by LLM to identify edge cases, improve patterns, and suggest severity levels. Includes intelligent fallback explanations when LLM is unavailable - uses keyword extraction to generate useful explanations, examples, and pattern suggestions even during timeouts
|
| 119 |
- π **File Upload & Drag-and-Drop** β Upload rules from files (TXT, PDF, DOC, DOCX) with intuitive drag-and-drop interface
|
| 120 |
- β‘ **Chunk-Wise Processing** β Large rule sets processed in chunks to prevent timeouts and ensure reliable processing
|
| 121 |
- π **Real-Time Analytics Dashboard** β Per-tenant analytics with configurable time windows (7, 30, 90 days)
|
|
|
|
| 870 |
### Admin Rules System (Latest)
|
| 871 |
- **File Upload Support**: Upload rules from TXT, PDF, DOC, DOCX files with drag-and-drop interface
|
| 872 |
- **LLM Enhancement**: Automatic rule enhancement identifies edge cases, improves regex patterns, and suggests severity levels
|
| 873 |
+
- **Intelligent Fallback Explanations**: When LLM enhancement times out or fails, the system automatically generates basic explanations using keyword extraction, providing useful examples and pattern suggestions without requiring LLM availability
|
| 874 |
- **Chunk Processing**: Large rule sets processed in chunks of 5 to prevent timeouts (handles 100+ rules efficiently)
|
| 875 |
- **Comment Filtering**: Comment lines (starting with #) automatically ignored when uploading rules
|
| 876 |
- **Rule-First Processing**: Admin rules checked before intent classification - enables behavior control (brief responses vs blocking)
|
backend/README.md
CHANGED
|
@@ -161,6 +161,21 @@ Use the helper scripts in the repo root when validating backend changes:
|
|
| 161 |
- Improved error handling and status messages
|
| 162 |
- Responsive layout with proper component scaling
|
| 163 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 164 |
### Real-Time Visualization Components (Next.js Frontend)
|
| 165 |
|
| 166 |
The Next.js frontend includes three powerful visualization components:
|
|
|
|
| 161 |
- Improved error handling and status messages
|
| 162 |
- Responsive layout with proper component scaling
|
| 163 |
|
| 164 |
+
### LLM-Guided Rule Explanation
|
| 165 |
+
|
| 166 |
+
The rule enhancement system includes intelligent fallback mechanisms:
|
| 167 |
+
|
| 168 |
+
- **LLM Enhancement**: When available, rules are enhanced with comprehensive explanations, examples, missing patterns, edge cases, and improvements
|
| 169 |
+
- **Intelligent Fallback**: When LLM times out or fails, the system automatically generates basic explanations using keyword extraction:
|
| 170 |
+
- Detects keywords (password, API key, credit card, sensitive data, etc.)
|
| 171 |
+
- Generates contextual explanations based on detected keywords
|
| 172 |
+
- Provides relevant examples (5-8 examples) based on rule type
|
| 173 |
+
- Suggests missing patterns (3-5 suggestions) for rule improvement
|
| 174 |
+
- **Timeout Protection**: 30-second timeout per rule with graceful fallback
|
| 175 |
+
- **Chunk Processing**: Bulk rule processing handles failures gracefully - one rule failure doesn't block others
|
| 176 |
+
|
| 177 |
+
This ensures users always receive useful rule explanations even when the LLM service is unavailable or slow.
|
| 178 |
+
|
| 179 |
### Real-Time Visualization Components (Next.js Frontend)
|
| 180 |
|
| 181 |
The Next.js frontend includes three powerful visualization components:
|
frontend/README.md
CHANGED
|
@@ -90,6 +90,20 @@ The frontend includes three powerful visualization components:
|
|
| 90 |
- **Per-tool usage trends** with visual bar charts
|
| 91 |
- **Access**: All roles can view analytics (viewer, editor, admin, owner)
|
| 92 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 93 |
### Components
|
| 94 |
|
| 95 |
- `chat-panel.tsx` - Real-time chat interface with streaming responses and visualization integration
|
|
@@ -102,6 +116,8 @@ The frontend includes three powerful visualization components:
|
|
| 102 |
- `reasoning-visualizer.tsx` - Real-time reasoning path visualizer component
|
| 103 |
- `tool-timeline.tsx` - Tool invocation timeline component
|
| 104 |
- `tenant-heatmap.tsx` - Tenant activity heatmap component
|
|
|
|
|
|
|
| 105 |
|
| 106 |
## Deploy
|
| 107 |
|
|
|
|
| 90 |
- **Per-tool usage trends** with visual bar charts
|
| 91 |
- **Access**: All roles can view analytics (viewer, editor, admin, owner)
|
| 92 |
|
| 93 |
+
### Admin Rules Page (`/admin-rules`)
|
| 94 |
+
- **Rule management** with bulk upload and individual rule deletion
|
| 95 |
+
- **File upload support** for TXT, PDF, DOC, DOCX, MD files with drag-and-drop
|
| 96 |
+
- **LLM-Guided Rule Explanations**:
|
| 97 |
+
- Automatic generation of human-readable explanations
|
| 98 |
+
- Concrete examples of what would trigger the rule
|
| 99 |
+
- Missing pattern suggestions for rule improvement
|
| 100 |
+
- Edge cases and improvements identified by LLM
|
| 101 |
+
- **Intelligent fallback**: When LLM times out, uses keyword extraction to generate useful explanations, examples, and suggestions
|
| 102 |
+
- **Expandable explanations** with "Explain" button for each rule
|
| 103 |
+
- **Auto-expand** for newly added rules with explanations
|
| 104 |
+
- **Role-based access**: Requires Admin or Owner role to manage rules
|
| 105 |
+
- **Real-time updates** with refresh functionality
|
| 106 |
+
|
| 107 |
### Components
|
| 108 |
|
| 109 |
- `chat-panel.tsx` - Real-time chat interface with streaming responses and visualization integration
|
|
|
|
| 116 |
- `reasoning-visualizer.tsx` - Real-time reasoning path visualizer component
|
| 117 |
- `tool-timeline.tsx` - Tool invocation timeline component
|
| 118 |
- `tenant-heatmap.tsx` - Tenant activity heatmap component
|
| 119 |
+
- `rule-explanation.tsx` - LLM-generated rule explanation component with examples and pattern suggestions
|
| 120 |
+
- `admin-rules-panel.tsx` - Admin rules management panel component
|
| 121 |
|
| 122 |
## Deploy
|
| 123 |
|