No API key needed — runs entirely in-process with 86 regex-based entity types.
using Blindfold.Sdk;using var client = new BlindfoldClient(); // no API key neededvar result = await client.DetectAsync("Email john@acme.com, SSN 123-45-6789");foreach (var entity in result.DetectedEntities){ Console.WriteLine($"{entity.Type}: {entity.Text}");}// Email Address: john@acme.com// Social Security Number: 123-45-6789
For NLP-powered detection (names, addresses, organizations), compliance policies, and audit logs:
using Blindfold.Sdk;// Simple initializationusing var client = new BlindfoldClient("your-api-key");// Full configurationusing var client = new BlindfoldClient(new BlindfoldOptions{ ApiKey = "your-api-key", Region = "eu", // "eu" (default) or "us" MaxRetries = 3, Timeout = TimeSpan.FromSeconds(30), UserId = "user-123", // optional user tracking});
var result = await client.DetectAsync("Contact John Doe at john@example.com");Console.WriteLine(result.EntitiesCount); // 2foreach (var entity in result.DetectedEntities){ Console.WriteLine($"{entity.Type}: {entity.Text} ({entity.Score:F2})");}
// Tokenizevar response = await client.TokenizeAsync( "Contact John Doe at john@example.com");Console.WriteLine(response.Text);// "Contact <Person_1> at <Email Address_1>"Console.WriteLine(response.Mapping);// {<Person_1>: John Doe, <Email Address_1>: john@example.com}// Detokenize (sync — runs client-side, no API call)var original = client.Detokenize( response.Text, response.Mapping);Console.WriteLine(original.Text);// "Contact John Doe at john@example.com"
Partially hide PII while keeping some characters visible.
var result = await client.MaskAsync( "Card: 4532-7562-9102-3456", charsToShow: 4, // chars to show fromEnd: true, // from end maskChar: "*", // masking character entities: null // entities filter (null = all));Console.WriteLine(result.Text);// "Card: ***************3456"
var result = await client.SynthesizeAsync( "John Doe lives in New York", language: "en", // language entities: null // entities filter);Console.WriteLine(result.Text);// "Michael Smith lives in Boston" (example - will vary)
var texts = new[]{ "Contact John Doe", "Email jane@example.com", "No PII here"};var result = await client.TokenizeBatchAsync(texts);Console.WriteLine(result.Total); // 3Console.WriteLine(result.Succeeded); // 3foreach (var item in result.Results){ Console.WriteLine(item.Text);}
All methods have batch variants: DetectBatchAsync, TokenizeBatchAsync, RedactBatchAsync, MaskBatchAsync, HashBatchAsync, EncryptBatchAsync, SynthesizeBatchAsync.
var result = await client.DetectAsync( "John Doe, SSN 123-45-6789, email john@example.com", entities: new[] { "Social Security Number", "Email Address" });// Only SSN and email detected, name is ignored