Skip to content

NightfallAI

Nuget package dotnet License: MIT Discord

Features 🔥

  • Fully generated C# SDK based on official NightfallAI OpenAPI specification using AutoSDK
  • Same day update to support new features
  • Updated and supported automatically if there are no breaking changes
  • All modern .NET features - nullability, trimming, NativeAOT, etc.
  • Support .Net Framework/.Net Standard 2.0

Usage

1
2
3
using NightfallAI;

using var client = new NightfallAIClient(apiKey);

Scanning Text

Example showing how to scan text for sensitive data using the Nightfall AI API.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using var client = new NightfallAIClient(apiKey);

// Create a scan request with inline detection rules
var request = new ScanTextRequest
{
    Payload = ["My email is test@example.com and my SSN is 123-45-6789"],
    Policy = new ScanPolicy
    {
        DetectionRules =
        [
            new DetectionRule
            {
                Detectors =
                [
                    new Detector
                    {
                        DetectorType = DetectorType.NightfallDetector,
                        NightfallDetector = "EMAIL_ADDRESS",
                        MinConfidence = Confidence.Possible,
                    },
                    new Detector
                    {
                        DetectorType = DetectorType.NightfallDetector,
                        NightfallDetector = "US_SOCIAL_SECURITY_NUMBER",
                        MinConfidence = Confidence.Possible,
                    },
                ],
                LogicalOp = LogicalOp.Any,
            },
        ],
    },
};

// Send the scan request
var response = await client.Scanning.ScanTextAsync(
    request: request);

Support

Priority place for bugs: https://github.com/tryAGI/NightfallAI/issues
Priority place for ideas and general questions: https://github.com/tryAGI/NightfallAI/discussions
Discord: https://discord.gg/Ca2xhfBf3v

Acknowledgments

JetBrains logo

This project is supported by JetBrains through the Open Source Support Program.