litellm/tests/guardrails_tests
Rohan bed44f5fe5
Add Akto Guardrails to LiteLLM (#23250)
* akto guardrails support in litellm

* docs(guardrails): add akto to supported values in types/guardrails.py

* frontend changes + fixes

* feat(akto): update Akto guardrail integration with new configuration options and modes

* docs(akto): enhance Akto documentation and configuration descriptions for clarity

* feat(tests): add proxy server request headers to sample request data

* refactor(akto): remove optional account and VXLAN IDs; update documentation and tests

* feat(akto): add event_type parameter for enhanced observability in guardrail logging

* refactor(akto): update environment variable references

* refactor the python codes

* refactor and fix linting

* refactor(akto): remove unused event hook and clean up imports

* refactor(akto): enhance AktoGuardrail with async support and improved logging

* fix: Register DynamoAI guardrail initializer and enum entry (#23752)

* fix: Register DynamoAI guardrail initializer and enum entry

Fix the "Unsupported guardrail: dynamoai" error by:
1. Adding DYNAMOAI to SupportedGuardrailIntegrations enum
2. Implementing initialize_guardrail() and registries in dynamoai/__init__.py

The DynamoAI guardrail was added in PR #15920 but never properly registered
in the initialization system. The __init__.py was missing the
guardrail_initializer_registry and guardrail_class_registry dictionaries
that the dynamic discovery mechanism looks for at module load time.

Fixes #22773

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* Update litellm/proxy/guardrails/guardrail_hooks/dynamoai/__init__.py

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* Update litellm/proxy/guardrails/guardrail_hooks/dynamoai/__init__.py

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* test: Add tests for DynamoAI guardrail registration

Verifies enum entry, initializer registry, class registry,
instance creation, and global registry discovery.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* docs: add v1.82.3 release notes and update provider_endpoints_support.json (#23816)

* Revert "docs: add v1.82.3 release notes and update provider_endpoints_support…" (#23817)

This reverts commit 966124966f.

* Refactor Akto guardrail configuration and tests; update UI description and tags

* add account and vxlan ID parameters to Akto guardrail initialization; update Akto logo format

* enhance Akto guardrail documentation and improve error handling for non-JSON responses

* address greptile issues

* fix: update payload handling to use 'data' instead of 'json' in AktoGuardrail and adjust tests accordingly

---------

Co-authored-by: Harshit Jain <48647625+Harshit28j@users.noreply.github.com>
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: Joe Reyna <joseph.reyna@gmail.com>
Co-authored-by: Krish Dholakia <krrishdholakia@gmail.com>
2026-03-17 14:38:04 -07:00
..
conftest.py Optimize CI: parallelize router and guardrails test jobs, fix test isolation 2026-03-14 22:54:44 -07:00
test_akto_guardrails.py Add Akto Guardrails to LiteLLM (#23250) 2026-03-17 14:38:04 -07:00
test_bedrock_guardrails.py fix: test_convert_to_bedrock_format_post_call_streaming_hook 2026-01-20 18:27:36 +05:30
test_custom_guardrail.py [Feat] Presidio Improvements - Allow adding presidio api base on UI, Test presidio on Test Key, fixes for running presidio hook (#10840) 2025-05-14 17:41:33 -07:00
test_dynamoai_guardrails.py [Fix] CI/CD #1 - mypy | check_code_and_doc_quality | guardrails_testing (#18195) 2025-12-18 06:31:01 -08:00
test_eu_ai_act_article5.py feat: EU AI Act Article 5 policy template for prohibited practices detection (#21342) 2026-02-16 15:33:07 -08:00
test_eu_ai_act_french_3_scenarios.py Add French language support for EU AI Act Article 5 guardrail (#21427) 2026-02-17 16:07:54 -08:00
test_guardrail_load_balancing.py [Feat] Guardrails Load Balancing - Allow Platform admins to load balance between guardrails (#18181) 2025-12-19 00:08:03 +05:30
test_guardrails_config.py fix: use fastuuid helper (#14903) 2025-09-25 15:47:01 -07:00
test_javelin_guardrails.py fix: reject status code and tests. 2025-09-28 16:56:28 +05:30
test_lakera_v2.py Add Lakera v2 post-call hook and tests (fixed PII masking) (#21783) 2026-02-25 17:20:38 -08:00
test_lasso_guardrails.py [Feat] New Guardrail - Dynamo AI Guardrail (#15920) 2025-10-24 17:11:04 -07:00
test_presidio_pii.py fix: address req changes 2026-03-10 15:51:10 +05:30
test_semantic_guard.py feat: prompt injection guardrail policy template (#21520) 2026-02-19 15:06:06 -08:00
test_sg_mas_ai_guardrails.py feat: Singapore guardrail policies (PDPA + MAS AI Risk Management) (#21948) 2026-02-23 12:08:22 -08:00
test_sg_pdpa_guardrails.py feat: Singapore guardrail policies (PDPA + MAS AI Risk Management) (#21948) 2026-02-23 12:08:22 -08:00
test_tracing_guardrails.py Fix test_standard_logging_payload_includes_guardrail_information 2026-02-26 12:13:26 +05:30
test_zscaler_ai_guard.py fix(guardrails): Zscaler AI Guard bug fixes and support during post-call (#20801) 2026-02-13 11:28:14 -08:00