← Back to Pull requests

chore(aiguard): request-local MCP server IDs and WHATWG MCP server URLs [backport 4.18] #22160

Open
unknown opened this pull request with 218 lines diff across 2 files
View on GitHub
unknown unknown commented on Nov 27, 2026 14:12 UTC
Author

Description

Jira: APPSEC-71995

Backport of #22123 to 4.18. The automatic cherry-pick conflicted because #22123 was built on three AI Guard changes that are not on 4.18, so they come along, in their order on main (each commit is cherry-pick -x of the merge commit, no other change):

1. #21842 chore(aiguard): protected client method for AI Guard policy evaluation.
3. #22123 chore(aiguard): request-local MCP server IDs, WHATWG MCP server URLs, and Anthropic client-managed MCP calls checked when they run.

Without #22123, 4.18.0 would ship the fingerprint server IDs and origin-only URLs that main has already replaced, and the system tests for these MCP payloads (DataDog/system-tests#8646, gated from 4.18.0rc1) would fail against 4.18 builds.

Testing

All four commits applied cleanly on origin/4.18 with no conflict to resolve. scripts/run-tests on this branch:

| Suite | Environment | Result |
|-------|-------------|--------|
| ai_guard_api | 99afb0a2db05 | 601 passed |
| ai_guard_anthropic | 5316c60f847a py3.13, anthropic==0.84.0 | 215 passed |
| ai_guard_litellm_guardrail | 1227021fb1a6 | 255 passed |
| ai_guard_openai | 29481ef723f0 | 248 passed, 81 skipped |
| ai_guard_openai_agents | f5ff4733b90f | 27 passed |

Risks

Two chore changes on a release branch, kept because #22113 and #22123 do not apply without them. The code is the same as on main.

Additional Notes

None.

🤖 Generated with Claude Code

[APPSEC-71995]: https://datadoghq.atlassian.net/browse/APPSEC-71995?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

Diff: 218 lines (+163 / -55) across 2 files Reviewer: gnufede Review duration: 5339m
All Vouch review confidence checks passed
Residual risk 0.20 = Change Risk (0.37) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 218 lines diff across 2 files
0.37
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
0.02
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
46%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth shallow_review_depth
0.344
Diff Size diff_size
0.322
Real PR Conversation Timeline
1 comments
"Review active on #22160"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 46.7% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 36.7% (MEDIUM) · Higher = larger blast radius
36.7%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 46.7% · Lower = rushed or shallow review
46.7%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 19.6% · Safe to merge
19.6%