Skip to content

Add AI Guard and SCA rows to the security smoke grid - #8647

Draft
florentinl wants to merge 2 commits into
mainfrom
florentin.labelle/native-ai-guard-sca-smoke
Draft

florentinl wants to merge 2 commits into
mainfrom
florentin.labelle/native-ai-guard-sca-smoke

Conversation

@florentinl

@florentinl florentinl commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

What this covers

This PR adds AI Guard and SCA to the security smoke grid, so their backend intake checks run on every infrastructure we test, not only in their product scenarios.

The grid (documented in docs/understand/scenarios/security_smoke.md):

  • Rows are products: a Base*SmokeTests class in tests/appsec/smoke_tests/utils.py.
  • Columns are infrastructures: SECURITY_SMOKE (reference: classic Agent, native export), APPSEC_APM_STANDALONE, APPSEC_STANDALONE_APM_STANDALONE. Future columns such as OTLP/DDOT inherit every row.
  • Cells are Test_<Scenario>_<Product> classes that only inherit a row. If a cell fails while its SECURITY_SMOKE cell passes, the column's infrastructure is the cause.

New rows:

  • BaseAiGuardSmokeTests: an AI Guard evaluation (the ALLOW cassette, benign so AppSec can't be the one keeping the trace) reaches intake. It must be USER_KEEP and attributed to AI Guard, either _dd.p.dm=-13 or, with APM off, the AI Guard bit in _dd.p.ts. Its evaluation span, decision and structured messages must arrive unchanged. The evaluation span may be in another trace chunk.
  • BaseScaSmokeTests: the SDK reports SCA enabled, and the expected dependency inventory reaches telemetry intake unchanged for the same runtime. There is no CVE lookup, enrichment or reachability claim.

Supporting changes:

  • Product configuration shared by every column (the AI Guard SDK env, the SCA and telemetry env, and the VCR cassettes container) lives in utils/_context/_scenarios/_core/product_env.py. AI_GUARD_* scenarios reuse the AI Guard part.
  • MESSAGES and BLOCKING_HEADER move to tests/ai_guard/utils.py so the smoke rows can replay the same cassette.
  • The earlier version of this PR added these checks to AI_GUARD, AI_GUARD_STANDALONE and SCA_STANDALONE. They are reverted there, and the grid now covers them.
  • Manifests: each cell mirrors the gates of the equivalent existing AI Guard and SCA tests.

Validation

  • Java spring-boot (1.70.0-SNAPSHOT), live and replay:
    • SECURITY_SMOKE: all passed.
    • APPSEC_APM_STANDALONE: all passed, including tests/test_infra_disabled.py.
    • APPSEC_STANDALONE_APM_STANDALONE: all passed except the cells already marked flaky (APPSEC-60872) for Java, which are skipped.
  • TEST_THE_TEST (manifest, scenario declaration, deserializer) and ./format.sh passed.
  • system-tests-review: four lenses, no actionable findings.

🤖 Generated with Claude Code

Use the existing product scenarios and SDK fixtures. Correlate the kept AI Guard evaluation with its request across Agent trace chunks. Match SCA enablement and the expected dependency inventory to the reporting runtime at SDK egress and backend intake, without changing activation or transport.
@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

CODEOWNERS have been resolved as:

docs/understand/scenarios/security_smoke.md                             @DataDog/system-tests-core
tests/ai_guard/utils.py                                                 @DataDog/k9-ai-guard
utils/_context/_scenarios/_core/product_env.py                          @DataDog/system-tests-core
docs/understand/scenarios/README.md                                     @DataDog/system-tests-core
docs/understand/scenarios/ai_guard.md                                   @DataDog/k9-ai-guard
manifests/cpp_nginx.yml                                                 @DataDog/system-tests-reviewers
manifests/dotnet.yml                                                    @DataDog/system-tests-reviewers
manifests/golang.yml                                                    @DataDog/system-tests-reviewers
manifests/java.yml                                                      @DataDog/system-tests-reviewers
manifests/nodejs.yml                                                    @DataDog/system-tests-reviewers
manifests/php.yml                                                       @DataDog/system-tests-reviewers
manifests/python.yml                                                    @DataDog/system-tests-reviewers
manifests/ruby.yml                                                      @DataDog/system-tests-reviewers
tests/ai_guard/test_ai_guard_sdk.py                                     @DataDog/k9-ai-guard
tests/appsec/smoke_tests/test_apm_standalone.py                         @DataDog/asm-libraries
tests/appsec/smoke_tests/test_security.py                               @DataDog/asm-libraries
tests/appsec/smoke_tests/utils.py                                       @DataDog/asm-libraries
utils/_context/_scenarios/_core/__init__.py                             @DataDog/system-tests-core
utils/_context/_scenarios/ai_guard.py                                   @DataDog/system-tests-core
utils/_context/_scenarios/appsec_standalone.py                          @DataDog/system-tests-core
utils/_context/_scenarios/security_smoke.py                             @DataDog/system-tests-core

@florentinl
florentinl marked this pull request as ready for review November 23, 2026 17:18
@florentinl
florentinl requested review from a team as code owners November 23, 2026 17:18
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T17:20:24.555297Z 202e5b4 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@florentinl
florentinl marked this pull request as draft November 23, 2026 17:20
Move the AI Guard and SCA backend intake checks out of the product
scenarios and into BaseAiGuardSmokeTests and BaseScaSmokeTests rows.
SECURITY_SMOKE is the reference column, and APPSEC_APM_STANDALONE and
APPSEC_STANDALONE_APM_STANDALONE get the same rows. Any future
infrastructure column then inherits them.

The shared product configuration lives in _core/product_env.py, so
every column starts from the same weblog env and containers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@florentinl florentinl changed the title Verify native AI Guard traces and SCA telemetry at backend intake Add AI Guard and SCA rows to the security smoke grid Nov 23, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant