Skip to content
المشاريع

Jiapeng-Pei/LLMSensitiveDataGoverance

عرض على GitHub

حول

A C# system for managing sensitivity labels for LLM grounding data, designed to provide comprehensive data protection and governance for AI Agent development.

الذكاء الاصطناعي وتعلّم الآلة

كيف تُقاس هذه الأرقام

ما يمكنك فعله

  • Privacy-compliant sensitivity labels with encryption and access controls
  • Visual label indicators in AI responses
  • Copy/paste protection with label preservation
  • Grounding data protection based on sensitivity levels

النمو المقاس للنجوم

خلال 24 ساعة
٠
خلال 7 أيام
٠
خلال 15 يومًا
٠
خلال شهر
جارٍ جمع السجل

تغيّر صافي النجوم خلال فترات متداخلة، وليس مجموعًا يوميًا. تبقى القياسات المفقودة فارغة. النجوم تقيس الاهتمام لا جودة البرمجيات.

README.md

الأصل

LLM Sensitive Data Governance

A C# system for managing sensitivity labels for LLM grounding data, designed to provide comprehensive data protection and governance for AI Agent development.

Features

  • Privacy-compliant sensitivity labels with encryption and access controls
  • Visual label indicators in AI responses
  • Copy/paste protection with label preservation
  • Grounding data protection based on sensitivity levels
  • Configurable label hierarchy (Public → Internal → Confidential → Highly Confidential → Restricted)
  • Local standalone operation with no network dependencies
  • Agent integration for seamless AI development workflow

Quick Start

Installation

git clone https://github.com/your-org/LLMSensitiveDataGoverance.git
cd LLMSensitiveDataGoverance
dotnet build

Basic Usage

// Initialize the service
var services = new ServiceCollection();
services.AddSensitivityLabelServices();
var provider = services.BuildServiceProvider();

var labelService = provider.GetRequiredService<ISensitivityLabelService>();

// Classify grounding data
var groundingData = new GroundingData
{
    Content = "Company financial data",
    Source = "quarterly-report.pdf"
};

var response = await labelService.ClassifyAsync(groundingData);
Console.WriteLine($"Label: {response.Label.Name}");
Console.WriteLine($"Can use for grounding: {response.AllowGrounding}");

CLI Usage

# Classify content
dotnet run --project src/LLMSensitiveDataGoverance.CLI -- classify --content "sensitive data"

# List available labels
dotnet run --project src/LLMSensitiveDataGoverance.CLI -- list-labels

# Validate configuration
dotnet run --project src/LLMSensitiveDataGoverance.CLI -- validate

Architecture

The system consists of four main components:

  1. Core Library (LLMSensitiveDataGoverance.Core) - Core models, services, and interfaces
  2. CLI Application (LLMSensitiveDataGoverance.CLI) - Command-line interface
  3. Agent Integration (LLMSensitiveDataGoverance.AgentIntegration) - AI Agent integration utilities
  4. Configuration - JSON-based label and system configuration

Configuration

Labels Configuration (config/labels.json)

Define custom sensitivity labels with protection settings:

{
  "labels": [
    {
      "id": "confidential",
      "name": "Confidential",
      "priority": 2,
      "protection": {
        "requireEncryption": true,
        "preventExtraction": true,
        "preventGrounding": false
      }
    }
  ]
}

Application Settings (config/appsettings.json)

Configure system behavior:

{
  "SensitivityLabels": {
    "DefaultProvider": "InMemory",
    "EnableEncryption": true,
    "ValidateOnStartup": true
  }
}

AI Agent Integration

Integrate with your AI Agent projects:

services.AddSensitivityLabelServices();
services.AddAgentIntegration();

// Use in your agent
var processor = serviceProvider.GetRequiredService<LLMResponseProcessor>();
var processedResponse = await processor.ProcessResponseAsync(llmResponse, groundingData);

Documentation

Examples

See the examples directory for:

  • Basic usage examples
  • Agent integration samples
  • Custom label configurations
  • Performance optimization examples

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Add tests for new functionality
  4. Ensure all tests pass
  5. Submit a pull request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

For issues and questions:

Requirements

  • .NET 8.0 or later
  • No external dependencies required for core functionality
  • Optional: JSON configuration files for custom labels

استكشف مشاريع مشابهة ومرتبطة

جارٍ التحميل…