feat(aiguard): send evaluations through the Agent when the service has no keys #21595
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
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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
eliottness
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.