litellm/tests/test_litellm/proxy/guardrails/guardrail_hooks
Harshit Jain d15c2d546e
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>
2026-03-16 22:24:29 -07:00
..
azure azure content enhancement... (#22581) 2026-03-04 10:22:30 -08:00
content_filter feat: Add Canadian PII protection (PIPEDA) (#22951) 2026-03-06 18:27:31 -08:00
guardrails_ai GuardrailsAI: use validatedOutput to allow usage of "fix" guards. Previously "fix" guards had no effect in llmOutput mode. (#12891) 2025-07-24 22:07:06 -07:00
openai fix: openai moderation guardrails (#20718) 2026-02-12 21:03:11 -08:00
unified_guardrails Add OCR guardrail_translation handler and support (#22145) 2026-02-28 17:39:36 -08:00
code_execution_compliance_dataset.json feat(add-new-block_code_execution-guardrail): prevent agent from executing code (#22154) 2026-02-25 22:02:14 -08:00
test_bedrock_guardrails.py Revert "Revert "Litellm bedrock guardrails block precedence over masking (#17…" (#18023) 2025-12-16 08:42:10 +05:30
test_block_code_execution.py feat(add-new-block_code_execution-guardrail): prevent agent from executing code (#22154) 2026-02-25 22:02:14 -08:00
test_block_code_execution_compliance.py feat(add-new-block_code_execution-guardrail): prevent agent from executing code (#22154) 2026-02-25 22:02:14 -08:00
test_crowdstrike_aidr.py Add CrowdStrike AIDR guardrail hook (#17876) 2026-03-02 17:26:54 -08:00
test_dynamoai.py fix: Register DynamoAI guardrail initializer and enum entry (#23752) 2026-03-16 22:24:29 -07:00
test_enkryptai.py TestEnkryptAIGuardrailHooks 2025-10-10 19:59:41 -07:00
test_generic_guardrail_api.py feat(guardrails): team-based guardrail registration and approval workflow (#22459) 2026-03-02 22:06:49 -08:00
test_grayswan.py Fix: litellm/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_grayswan.py 2026-02-04 17:35:26 +05:30
test_hiddenlayer.py Guardrails API - support LLM tool call response checks on /chat/completions, /v1/responses, /v1/messages on regular + streaming calls (#17619) 2025-12-15 18:19:52 +05:30
test_lakera_ai_v2.py Add Lakera v2 post-call hook and tests (fixed PII masking) (#21783) 2026-02-25 17:20:38 -08:00
test_lasso.py Fix session consistency, move Lasso API version away from source code (#17316) 2025-12-01 10:03:51 -08:00
test_mcp_end_user_permission.py Mcp user permissions (#21462) 2026-02-18 18:53:59 -08:00
test_mcp_security.py Add MCP Security guardrail to block unregistered MCP servers (#21429) 2026-02-17 21:19:13 -08:00
test_model_armor.py fix guardrail status error (#20972) 2026-02-12 20:19:13 -08:00
test_noma.py Add Noma guardrails v2 based on custom guardrails (#21400) 2026-02-23 05:05:27 -08:00
test_noma_v2.py Add Noma guardrails v2 based on custom guardrails (#21400) 2026-02-23 05:05:27 -08:00
test_onyx.py add timeout to onyx guardrail (#19731) 2026-01-25 23:13:46 -08:00
test_pangea.py fix: respect pangea guardrail default_on during initialization 2026-01-11 08:33:31 +09:00
test_panw_prisma_airs.py feat(panw-prisma-airs): PANW Prisma AIRS guardrail with apply_guardrail support (#22999) 2026-03-10 12:31:31 -07:00
test_presidio.py fix: req changes on feedback from greptile 2026-03-10 16:46:18 +05:30
test_presidio_union_fix.py fix: add return type annotation for full mypy compliance 2025-09-25 12:52:12 -04:00
test_qualifire.py Hotfix - docs qualifire (#18724) 2026-01-07 17:23:12 +05:30
test_response_rejection_guardrail_code.py Agent Builder - improve rejected response detection based on agent response (#21850) 2026-02-21 15:34:42 -08:00
test_tool_permission.py fix: normalize case for tool permission guardrail fields to prevent validation errors (#18662) 2026-01-05 11:24:19 -08:00
test_tool_policy_guardrail.py [Feat] Add Tool Policies for AI Gateway (#22732) 2026-03-03 20:22:20 -08:00