← Back to Pull requests

feat(aiguard): send evaluations through the Agent when the service has no keys #21595

Open
unknown opened this pull request with 174 lines diff across 2 files
View on GitHub
unknown unknown commented on Nov 09, 2026 10:04 UTC
Author

Description

Allow services without both Datadog credentials to send AI Guard evaluations through the local Agent when it advertises the proxy route. Services with both keys continue calling AI Guard directly. Discovery is shared across clients, evaluations wait within the Agent timeout for pending discovery, and transient failures can be retried on the next evaluation. Includes Unix socket support and transport telemetry.

Original PR: https://github.com/DataDog/dd-trace-py/pull/21569 by @eliottness. Eliott Bouhana remains credited as co-author.

Testing

All 561 AI Guard API and Agent-helper tests pass on Python 3.12, including concurrent startup, bounded waits, invalidation, transient recovery, a forked-child regression, advertised endpoint normalization, native HTTP requests through reverse-proxy paths, unsupported /info responses, cross-client isolation, and background-thread resource failures. All local repository checks pass, including typing, security, spelling, and ast-grep. Import analysis found no new cycles or dependency-direction violations.

Discovery performance has not been benchmarked.

Risks

Requires an Agent that supports the AI Guard proxy route. Missing credentials now produce evaluation-time errors instead of preventing client initialization. Evaluations fail if discovery cannot complete within the Agent timeout or no supported route exists.

Diff: 174 lines (+130 / -44) across 2 files Reviewer: eliottness Review duration: 30587m
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.35) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.35 · 174 lines diff across 2 files
0.35
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.309
Real PR Conversation Timeline
1 comments
"Review active on #21595"
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: 35.4% (MEDIUM) · Higher = larger blast radius
35.4%
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: 18.8% · Safe to merge
18.8%