[python] migrate python weblog to ddtrace.aiguard imports#7334
Merged
Conversation
Migrate the AI Guard imports in the Flask weblog from the old ddtrace.appsec.ai_guard / ddtrace.internal.settings.asm locations to the new ddtrace.aiguard / ddtrace.internal.settings.aiguard packages (dd-trace-py#18754, #19110). The new import paths are tried first and fall back to the old ones so the weblog stays compatible with every tracer version under test. JIRA: APPSEC-67628 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
|
|
avara1986
marked this pull request as ready for review
July 17, 2026 09:48
avara1986
requested review from
mabdinur and
ncybul
and removed request for
a team
July 17, 2026 09:48
cbeauchesne
approved these changes
Jul 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
AI Guard in
dd-trace-pywas moved out of AppSec into a dedicated top-level package:ddtrace.appsec.ai_guard→ddtrace.aiguard(dd-trace-py#18754, #19110)ddtrace.internal.settings.asm.ai_guard_config→ddtrace.internal.settings.aiguard.aiguard_configThis updates the Python Flask weblog to use the new import locations.
Changes
utils/build/docker/python/flask/app.py: the/ai_guard/evaluateendpoint now imports from the newddtrace.aiguard/ddtrace.internal.settings.aiguardlocations.To keep the weblog working against every tracer version under test (old and new), the new import paths are attempted first and fall back to the legacy paths on
ImportError. This retrocompatibility is required because system-tests runs against a matrix of tracer versions.Jira
https://datadoghq.atlassian.net/browse/APPSEC-67628
🤖 Generated with Claude Code