![]() |
VOOZH | about |
Manual integrations require additional configuration to enable AI Guard protection. Follow the instructions for each framework to set up AI Guard evaluations.
| Framework | Supported Versions | SDK Version |
|---|---|---|
| Amazon Strands | >= 1.29.0 | >= 4.7.0 |
| LiteLLM Proxy | >= 1.78.5 | >= 4.8.0 |
SDKs use the Datadog Agent to send AI Guard data to Datadog. The Agent must be running and accessible to your application.
If you don't use the Datadog Agent, the AI Guard evaluator API still works, but you can't see AI Guard traces in Datadog.
Set the following environment variables in your application:
| Variable | Value |
|---|---|
DD_AI_GUARD_ENABLED | true |
DD_API_KEY | <YOUR_API_KEY> |
DD_APP_KEY | <YOUR_APPLICATION_KEY> |
DD_ENV | <YOUR_ENVIRONMENT> |
DD_SERVICE | <YOUR_SERVICE> |
The Amazon Strands integration enables AI Guard evaluations for applications built with the Amazon Strands Agents SDK.
Install dd-trace-py v4.7.0 or later:
pip install ddtrace>=4.7.0
Next, define the entry point for the integration with a plugin or hook provider:
from ddtrace.appsec.ai_guard import AIGuardStrandsPlugin
agent = Agent(
model=model,
plugins=[AIGuardStrandsPlugin()]
)
from ddtrace.appsec.ai_guard import AIGuardStrandsHookProvider
agent = Agent(
model=model,
hooks=[AIGuardStrandsHookProvider()]
)
The LiteLLM Proxy integration enables AI Guard evaluations for applications using the LiteLLM Proxy.
Install dd-trace-py v4.8.0 or later:
pip install ddtrace>=4.8.0
Import Datadog’s LiteLLM guardrail next to your configuration file (for example, guardrails.py):
from ddtrace.appsec.ai_guard.integrations.litellm import DatadogAIGuardGuardrail
__all__ = ["DatadogAIGuardGuardrail"]
Add the imported guardrail to your configuration file:
guardrails:- guardrail_name:datadog_ai_guardlitellm_params:guardrail:guardrails.DatadogAIGuardGuardrailmode:[pre_call, post_call]on_input:trueon_output:trueblock:trueThe guardrail supports all three modes: pre_call, post_call, and during_call.
By default, the guardrail follows the blocking configuration set in the AI Guard service settings. To disable blocking, set the block parameter to false (equivalent to the block option in the SDK and REST API).
Additional helpful documentation, links, and articles:
| |