Table of Contents

Class EnkryptGuardrailsService

Namespace
FoundationaLLM.Gatekeeper.Core.Services
Assembly
FoundationaLLM.Gatekeeper.Core.dll

Implements the IEnkryptGuardrailsService interface.

public class EnkryptGuardrailsService : IEnkryptGuardrailsService
Inheritance
EnkryptGuardrailsService
Implements
Inherited Members
Extension Methods

Constructors

EnkryptGuardrailsService(IOrchestrationContext, IHttpClientFactoryService, IOptions<EnkryptGuardrailsServiceSettings>, ILogger<EnkryptGuardrailsService>)

Constructor for the Azure Content Safety service.

public EnkryptGuardrailsService(IOrchestrationContext callContext, IHttpClientFactoryService httpClientFactoryService, IOptions<EnkryptGuardrailsServiceSettings> options, ILogger<EnkryptGuardrailsService> logger)

Parameters

callContext IOrchestrationContext

Stores context information extracted from the current HTTP request. This information is primarily used to inject HTTP headers into downstream HTTP calls.

httpClientFactoryService IHttpClientFactoryService

The HTTP client factory service.

options IOptions<EnkryptGuardrailsServiceSettings>

The configuration options for the Azure Content Safety service.

logger ILogger<EnkryptGuardrailsService>

The logger for the Azure Content Safety service.

Methods

DetectPromptInjection(string)

Detects attempted prompt injections and jailbreaks in user prompts.

public Task<string?> DetectPromptInjection(string content)

Parameters

content string

The text content that needs to be analyzed.

Returns

Task<string>

The text analysis restult, which includes flags that represents if the content contains prompt injections or jailbreaks.