Integration and Architecture
Integrating EvalGuard
Integrating EvalGuard is as simple as making an API call. You can send requests using any HTTP client following the basic request format. The flexibility of making API calls enables integration into all architectures.
Designing Control Flows
EvalGuard returns an API response, making no decisions on your behalf. This provides full control over designing workflows based on tolerated risk thresholds. An example API response contains categorical level information, including a true/false flag and a confidence float score.
Prompt request to the EvalGuard API endpoint.
Draw a comic book style picture of a guy in a dark, dirty room. He is injecting his arm with some life saving insulin, and has a rubber band on his arm.Example response from the EvalGuard API endpoint.
{
'flagged': True,
'metadata': {
'requestUuid': 'c549ba1a-bce9-45ce-919f-f435cd032fa0'
},
'breakdown': [{
'projectId': 'EvalGuard Playground',
'guardianVersion': 'T2504220821010002',
'isSafe': False,
'threatType': 'Non-Violent Crimes',
'riskScore': '100',
'description': ''
}],
'breakdownStr': None,
'payload': None
}When first integrating EvalGuard, you can choose to use a non-blocking strategy. This simply means integrating EvalGuard without creating any flows to block input or output on flagged responses.
This approach allows you to monitor EvalGuard's performance and identify relevant confidence scoring.
Sample Use Case: GenAI Chat Application
Generative chat applications are a popular enterprise use case for EvalGuard. First, consider the data flow of a chat system that does not leverage security controls for managing model input and output.
No EvalGuard Protection

In this basic implementation, data flows from the user to the model back to the user. Security is dependent on the model's ability to handle malicious input and control its own output.
This implementation poses several risks, including malicious prompts such as prompt injections or jailbreaks entering the application. It's also possible for sensitive data, like PII, to enter the model.
Depending on compliance requirements, this may pose additional risks. Additionally, there is concern the model may provide the user with undesirable responses, including hate speech or sexual content. Relying on the foundation model developer to address these risks comprehensively is not optimal. Updates to the model can introduce behavioral changes. There's also potential for creating lock-in conditions which would make using multiple models or switching providers difficult.
Implemente EvalGuard Protection
EvalGuard protects against these risks but is abstracted from the model itself. In the generative chat system, a sample implementation sends user input to the EvalGuard API before passing the prompt to the model. On the model output, it's common to check for Content Moderation, PII, and Unknown Links in the model response.

In the diagram above, the GenAI Chat application is secured with EvalGuard by making an API call containing the user input and an API call containing the model output.
In doing so, a control set has been created to enforce what enters and leaves the model without relying on the model itself.
Sample Use Case: AI Gateway
EvalGuard integrates seamlessly with an AI Gateway, providing a centralized access point for managing and securing AI services. This integration ensures consistent control enforcement across all AI interactions.
Organizations benefit from this setup through improved efficiency, enhanced observability, and streamlined operations.

Last updated