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
- Configurable label hierarchy (Public → Internal → Confidential → Highly Confidential → Restricted)
- Local standalone operation with no network dependencies
- Agent integration for seamless AI development workflow
git clone https://github.com/your-org/LLMSensitiveDataGoverance.git
cd LLMSensitiveDataGoverance
dotnet build// 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}");# 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 -- validateThe system consists of four main components:
- Core Library (
LLMSensitiveDataGoverance.Core) - Core models, services, and interfaces - CLI Application (
LLMSensitiveDataGoverance.CLI) - Command-line interface - Agent Integration (
LLMSensitiveDataGoverance.AgentIntegration) - AI Agent integration utilities - Configuration - JSON-based label and system configuration
Define custom sensitivity labels with protection settings:
{
"labels": [
{
"id": "confidential",
"name": "Confidential",
"priority": 2,
"protection": {
"requireEncryption": true,
"preventExtraction": true,
"preventGrounding": false
}
}
]
}Configure system behavior:
{
"SensitivityLabels": {
"DefaultProvider": "InMemory",
"EnableEncryption": true,
"ValidateOnStartup": true
}
}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);See the examples directory for:
- Basic usage examples
- Agent integration samples
- Custom label configurations
- Performance optimization examples
- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For issues and questions:
- Create an issue in the GitHub repository
- Check the documentation
- Review the examples
- .NET 8.0 or later
- No external dependencies required for core functionality
- Optional: JSON configuration files for custom labels