Skip to content

Add support for content parts and image URLs in AI Guard#10449

Merged
smola merged 1 commit intomasterfrom
smola/ai-guard-content-parts
Jan 30, 2026
Merged

Add support for content parts and image URLs in AI Guard#10449
smola merged 1 commit intomasterfrom
smola/ai-guard-content-parts

Conversation

@smola
Copy link
Member

@smola smola commented Jan 27, 2026

What Does This Do

  • Add support for content parts in LLM messages sent with the AI Guard SDK. See docs. See also the PR for system-tests. The syntax here is a subset of OpenAI's Chat Completion API to send images (docs).
  • This lets customers send multi-modal prompts (text + images) to AI Guard. These images can be either HTTP URLs, or base64-encoded images in data URLs.

Motivation

Support multi-modal prompts (text + images) in AI Guard.

Additional Notes

Validated with system tests at DataDog/system-tests#6131

Reference PR for dd-trace-py at DataDog/dd-trace-py#15939

Contributor Checklist

Jira ticket: APPSEC-60264

@smola smola changed the title [ai-guard] add support for content parts and image URLs Add support for content parts and image URLs Jan 27, 2026
@smola smola added the comp: asm waf Application Security Management (WAF) label Jan 27, 2026
@smola smola changed the title Add support for content parts and image URLs Add support for content parts and image URLs in AI Guard Jan 27, 2026
@smola smola added the type: enhancement Enhancements and improvements label Jan 27, 2026
@pr-commenter
Copy link

pr-commenter bot commented Jan 27, 2026

Benchmarks

Startup

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master smola/ai-guard-content-parts
git_commit_date 1769604948 1769608760
git_commit_sha 708daf3 4180892
release_version 1.59.0-SNAPSHOT~708daf39d2 1.59.0-SNAPSHOT~4180892f39
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1769610799 1769610799
ci_job_id 1383289029 1383289029
ci_pipeline_id 93275768 93275768
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-zfyrx7zua-project-304-concurrent-0-bycb35ey 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-zfyrx7zua-project-304-concurrent-0-bycb35ey 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
module Agent Agent
parent None None

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 64 metrics, 7 unstable metrics.

Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.59.0-SNAPSHOT~4180892f39, baseline=1.59.0-SNAPSHOT~708daf39d2

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.057 s) : 0, 1057114
Total [baseline] (8.684 s) : 0, 8683611
Agent [candidate] (1.056 s) : 0, 1056126
Total [candidate] (8.719 s) : 0, 8718537
section iast
Agent [baseline] (1.251 s) : 0, 1251330
Total [baseline] (9.423 s) : 0, 9422517
Agent [candidate] (1.232 s) : 0, 1231940
Total [candidate] (9.346 s) : 0, 9345909
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.057 s -
Agent iast 1.251 s 194.217 ms (18.4%)
Total tracing 8.684 s -
Total iast 9.423 s 738.906 ms (8.5%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.056 s -
Agent iast 1.232 s 175.815 ms (16.6%)
Total tracing 8.719 s -
Total iast 9.346 s 627.372 ms (7.2%)
gantt
    title insecure-bank - break down per module: candidate=1.59.0-SNAPSHOT~4180892f39, baseline=1.59.0-SNAPSHOT~708daf39d2

    dateFormat X
    axisFormat %s
section tracing
crashtracking [baseline] (1.176 ms) : 0, 1176
crashtracking [candidate] (1.175 ms) : 0, 1175
BytebuddyAgent [baseline] (622.115 ms) : 0, 622115
BytebuddyAgent [candidate] (623.305 ms) : 0, 623305
AgentMeter [baseline] (28.703 ms) : 0, 28703
AgentMeter [candidate] (28.781 ms) : 0, 28781
GlobalTracer [baseline] (256.41 ms) : 0, 256410
GlobalTracer [candidate] (256.991 ms) : 0, 256991
AppSec [baseline] (32.882 ms) : 0, 32882
AppSec [candidate] (32.834 ms) : 0, 32834
Debugger [baseline] (63.265 ms) : 0, 63265
Debugger [candidate] (59.623 ms) : 0, 59623
Remote Config [baseline] (615.222 µs) : 0, 615
Remote Config [candidate] (628.574 µs) : 0, 629
Telemetry [baseline] (11.225 ms) : 0, 11225
Telemetry [candidate] (9.831 ms) : 0, 9831
Flare Poller [baseline] (5.381 ms) : 0, 5381
Flare Poller [candidate] (7.634 ms) : 0, 7634
section iast
crashtracking [baseline] (1.231 ms) : 0, 1231
crashtracking [candidate] (1.188 ms) : 0, 1188
BytebuddyAgent [baseline] (808.615 ms) : 0, 808615
BytebuddyAgent [candidate] (797.168 ms) : 0, 797168
AgentMeter [baseline] (11.713 ms) : 0, 11713
AgentMeter [candidate] (11.391 ms) : 0, 11391
GlobalTracer [baseline] (252.071 ms) : 0, 252071
GlobalTracer [candidate] (248.068 ms) : 0, 248068
AppSec [baseline] (33.654 ms) : 0, 33654
AppSec [candidate] (33.743 ms) : 0, 33743
Debugger [baseline] (67.897 ms) : 0, 67897
Debugger [candidate] (65.633 ms) : 0, 65633
Remote Config [baseline] (556.762 µs) : 0, 557
Remote Config [candidate] (556.529 µs) : 0, 557
Telemetry [baseline] (8.694 ms) : 0, 8694
Telemetry [candidate] (8.497 ms) : 0, 8497
Flare Poller [baseline] (3.528 ms) : 0, 3528
Flare Poller [candidate] (3.417 ms) : 0, 3417
IAST [baseline] (27.545 ms) : 0, 27545
IAST [candidate] (26.827 ms) : 0, 26827
Loading
Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.59.0-SNAPSHOT~4180892f39, baseline=1.59.0-SNAPSHOT~708daf39d2

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.059 s) : 0, 1059494
Total [baseline] (10.916 s) : 0, 10915910
Agent [candidate] (1.059 s) : 0, 1059027
Total [candidate] (10.817 s) : 0, 10817206
section appsec
Agent [baseline] (1.237 s) : 0, 1237155
Total [baseline] (10.89 s) : 0, 10889671
Agent [candidate] (1.231 s) : 0, 1230538
Total [candidate] (10.923 s) : 0, 10923291
section iast
Agent [baseline] (1.225 s) : 0, 1225299
Total [baseline] (11.155 s) : 0, 11154645
Agent [candidate] (1.226 s) : 0, 1225986
Total [candidate] (11.143 s) : 0, 11143431
section profiling
Agent [baseline] (1.194 s) : 0, 1194014
Total [baseline] (10.864 s) : 0, 10864385
Agent [candidate] (1.19 s) : 0, 1190336
Total [candidate] (10.808 s) : 0, 10808486
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.059 s -
Agent appsec 1.237 s 177.661 ms (16.8%)
Agent iast 1.225 s 165.805 ms (15.6%)
Agent profiling 1.194 s 134.52 ms (12.7%)
Total tracing 10.916 s -
Total appsec 10.89 s -26.239 ms (-0.2%)
Total iast 11.155 s 238.735 ms (2.2%)
Total profiling 10.864 s -51.525 ms (-0.5%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.059 s -
Agent appsec 1.231 s 171.51 ms (16.2%)
Agent iast 1.226 s 166.959 ms (15.8%)
Agent profiling 1.19 s 131.309 ms (12.4%)
Total tracing 10.817 s -
Total appsec 10.923 s 106.085 ms (1.0%)
Total iast 11.143 s 326.226 ms (3.0%)
Total profiling 10.808 s -8.72 ms (-0.1%)
gantt
    title petclinic - break down per module: candidate=1.59.0-SNAPSHOT~4180892f39, baseline=1.59.0-SNAPSHOT~708daf39d2

    dateFormat X
    axisFormat %s
section tracing
crashtracking [baseline] (1.205 ms) : 0, 1205
crashtracking [candidate] (1.183 ms) : 0, 1183
BytebuddyAgent [baseline] (624.199 ms) : 0, 624199
BytebuddyAgent [candidate] (623.01 ms) : 0, 623010
AgentMeter [baseline] (28.84 ms) : 0, 28840
AgentMeter [candidate] (28.854 ms) : 0, 28854
GlobalTracer [baseline] (257.753 ms) : 0, 257753
GlobalTracer [candidate] (257.337 ms) : 0, 257337
AppSec [baseline] (33.044 ms) : 0, 33044
AppSec [candidate] (32.955 ms) : 0, 32955
Debugger [baseline] (60.835 ms) : 0, 60835
Debugger [candidate] (62.093 ms) : 0, 62093
Remote Config [baseline] (637.351 µs) : 0, 637
Remote Config [candidate] (634.779 µs) : 0, 635
Telemetry [baseline] (9.201 ms) : 0, 9201
Telemetry [candidate] (10.697 ms) : 0, 10697
Flare Poller [baseline] (8.439 ms) : 0, 8439
Flare Poller [candidate] (6.933 ms) : 0, 6933
section appsec
crashtracking [baseline] (1.188 ms) : 0, 1188
crashtracking [candidate] (1.177 ms) : 0, 1177
BytebuddyAgent [baseline] (656.245 ms) : 0, 656245
BytebuddyAgent [candidate] (651.72 ms) : 0, 651720
AgentMeter [baseline] (11.878 ms) : 0, 11878
AgentMeter [candidate] (11.785 ms) : 0, 11785
GlobalTracer [baseline] (257.989 ms) : 0, 257989
GlobalTracer [candidate] (256.805 ms) : 0, 256805
AppSec [baseline] (167.888 ms) : 0, 167888
AppSec [candidate] (167.217 ms) : 0, 167217
Debugger [baseline] (67.406 ms) : 0, 67406
Debugger [candidate] (67.58 ms) : 0, 67580
Remote Config [baseline] (680.291 µs) : 0, 680
Remote Config [candidate] (682.235 µs) : 0, 682
Telemetry [baseline] (9.244 ms) : 0, 9244
Telemetry [candidate] (9.248 ms) : 0, 9248
Flare Poller [baseline] (3.619 ms) : 0, 3619
Flare Poller [candidate] (3.693 ms) : 0, 3693
IAST [baseline] (25.643 ms) : 0, 25643
IAST [candidate] (25.372 ms) : 0, 25372
section iast
crashtracking [baseline] (1.185 ms) : 0, 1185
crashtracking [candidate] (1.186 ms) : 0, 1186
BytebuddyAgent [baseline] (789.688 ms) : 0, 789688
BytebuddyAgent [candidate] (790.187 ms) : 0, 790187
AgentMeter [baseline] (11.16 ms) : 0, 11160
AgentMeter [candidate] (11.132 ms) : 0, 11132
GlobalTracer [baseline] (247.779 ms) : 0, 247779
GlobalTracer [candidate] (247.815 ms) : 0, 247815
AppSec [baseline] (34.331 ms) : 0, 34331
AppSec [candidate] (35.526 ms) : 0, 35526
Debugger [baseline] (66.383 ms) : 0, 66383
Debugger [candidate] (65.212 ms) : 0, 65212
Remote Config [baseline] (555.771 µs) : 0, 556
Remote Config [candidate] (552.787 µs) : 0, 553
Telemetry [baseline] (8.574 ms) : 0, 8574
Telemetry [candidate] (8.586 ms) : 0, 8586
Flare Poller [baseline] (3.474 ms) : 0, 3474
Flare Poller [candidate] (3.479 ms) : 0, 3479
IAST [baseline] (26.81 ms) : 0, 26810
IAST [candidate] (26.958 ms) : 0, 26958
section profiling
crashtracking [baseline] (1.23 ms) : 0, 1230
crashtracking [candidate] (1.217 ms) : 0, 1217
BytebuddyAgent [baseline] (682.646 ms) : 0, 682646
BytebuddyAgent [candidate] (680.201 ms) : 0, 680201
AgentMeter [baseline] (8.69 ms) : 0, 8690
AgentMeter [candidate] (8.65 ms) : 0, 8650
GlobalTracer [baseline] (217.964 ms) : 0, 217964
GlobalTracer [candidate] (217.373 ms) : 0, 217373
AppSec [baseline] (32.854 ms) : 0, 32854
AppSec [candidate] (32.633 ms) : 0, 32633
Debugger [baseline] (68.063 ms) : 0, 68063
Debugger [candidate] (67.891 ms) : 0, 67891
Remote Config [baseline] (584.65 µs) : 0, 585
Remote Config [candidate] (590.051 µs) : 0, 590
Telemetry [baseline] (8.655 ms) : 0, 8655
Telemetry [candidate] (8.696 ms) : 0, 8696
Flare Poller [baseline] (3.749 ms) : 0, 3749
Flare Poller [candidate] (3.766 ms) : 0, 3766
ProfilingAgent [baseline] (99.284 ms) : 0, 99284
ProfilingAgent [candidate] (99.186 ms) : 0, 99186
Profiling [baseline] (99.866 ms) : 0, 99866
Profiling [candidate] (99.764 ms) : 0, 99764
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master smola/ai-guard-content-parts
git_commit_date 1769604948 1769608760
git_commit_sha 708daf3 4180892
release_version 1.59.0-SNAPSHOT~708daf39d2 1.59.0-SNAPSHOT~4180892f39
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1769611265 1769611265
ci_job_id 1383289031 1383289031
ci_pipeline_id 93275768 93275768
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-zfyrx7zua-project-304-concurrent-0-3kl07vmb 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-zfyrx7zua-project-304-concurrent-0-3kl07vmb 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

Summary

Found 2 performance improvements and 1 performance regressions! Performance is the same for 16 metrics, 17 unstable metrics.

scenario Δ mean agg_http_req_duration_p50 Δ mean agg_http_req_duration_p95 Δ mean throughput candidate mean agg_http_req_duration_p50 candidate mean agg_http_req_duration_p95 candidate mean throughput baseline mean agg_http_req_duration_p50 baseline mean agg_http_req_duration_p95 baseline mean throughput
scenario:load:insecure-bank:iast_GLOBAL:high_load better
[-211.620µs; -123.498µs] or [-7.320%; -4.272%]
unsure
[-545.337µs; -106.895µs] or [-6.733%; -1.320%]
unstable
[-62.677op/s; +189.802op/s] or [-5.020%; +15.201%]
2.723ms 7.773ms 1312.219op/s 2.891ms 8.099ms 1248.656op/s
scenario:load:insecure-bank:iast_FULL:high_load better
[-309.119µs; -119.506µs] or [-5.896%; -2.280%]
same
[-581.901µs; +22.796µs] or [-4.701%; +0.184%]
unstable
[-40.365op/s; +106.927op/s] or [-5.157%; +13.661%]
5.028ms 12.099ms 816.000op/s 5.243ms 12.379ms 782.719op/s
scenario:load:petclinic:iast:high_load unsure
[+175.396µs; +993.394µs] or [+1.039%; +5.884%]
worse
[+0.597ms; +2.809ms] or [+2.160%; +10.158%]
unstable
[-34.335op/s; +20.897op/s] or [-12.826%; +7.807%]
17.467ms 29.360ms 260.969op/s 16.882ms 27.657ms 267.688op/s
Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.59.0-SNAPSHOT~4180892f39, baseline=1.59.0-SNAPSHOT~708daf39d2
    dateFormat X
    axisFormat %s
section baseline
no_agent (18.214 ms) : 18026, 18401
.   : milestone, 18214,
appsec (19.575 ms) : 19374, 19776
.   : milestone, 19575,
code_origins (17.621 ms) : 17448, 17793
.   : milestone, 17621,
iast (17.431 ms) : 17260, 17602
.   : milestone, 17431,
profiling (18.485 ms) : 18298, 18671
.   : milestone, 18485,
tracing (17.664 ms) : 17487, 17842
.   : milestone, 17664,
section candidate
no_agent (17.589 ms) : 17413, 17765
.   : milestone, 17589,
appsec (18.795 ms) : 18602, 18987
.   : milestone, 18795,
code_origins (17.65 ms) : 17474, 17826
.   : milestone, 17650,
iast (17.878 ms) : 17696, 18060
.   : milestone, 17878,
profiling (18.678 ms) : 18490, 18865
.   : milestone, 18678,
tracing (17.719 ms) : 17541, 17897
.   : milestone, 17719,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 18.214 ms [18.026 ms, 18.401 ms] -
appsec 19.575 ms [19.374 ms, 19.776 ms] 1.361 ms (7.5%)
code_origins 17.621 ms [17.448 ms, 17.793 ms] -593.159 µs (-3.3%)
iast 17.431 ms [17.26 ms, 17.602 ms] -783.229 µs (-4.3%)
profiling 18.485 ms [18.298 ms, 18.671 ms] 270.611 µs (1.5%)
tracing 17.664 ms [17.487 ms, 17.842 ms] -549.45 µs (-3.0%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 17.589 ms [17.413 ms, 17.765 ms] -
appsec 18.795 ms [18.602 ms, 18.987 ms] 1.206 ms (6.9%)
code_origins 17.65 ms [17.474 ms, 17.826 ms] 61.191 µs (0.3%)
iast 17.878 ms [17.696 ms, 18.06 ms] 289.216 µs (1.6%)
profiling 18.678 ms [18.49 ms, 18.865 ms] 1.089 ms (6.2%)
tracing 17.719 ms [17.541 ms, 17.897 ms] 130.332 µs (0.7%)
Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.59.0-SNAPSHOT~4180892f39, baseline=1.59.0-SNAPSHOT~708daf39d2
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.189 ms) : 1177, 1200
.   : milestone, 1189,
iast (3.25 ms) : 3206, 3294
.   : milestone, 3250,
iast_FULL (5.905 ms) : 5846, 5965
.   : milestone, 5905,
iast_GLOBAL (3.673 ms) : 3610, 3736
.   : milestone, 3673,
profiling (2.029 ms) : 2011, 2046
.   : milestone, 2029,
tracing (1.833 ms) : 1817, 1849
.   : milestone, 1833,
section candidate
no_agent (1.167 ms) : 1155, 1178
.   : milestone, 1167,
iast (3.206 ms) : 3166, 3247
.   : milestone, 3206,
iast_FULL (5.664 ms) : 5609, 5720
.   : milestone, 5664,
iast_GLOBAL (3.493 ms) : 3436, 3551
.   : milestone, 3493,
profiling (2.011 ms) : 1994, 2029
.   : milestone, 2011,
tracing (1.809 ms) : 1793, 1824
.   : milestone, 1809,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.189 ms [1.177 ms, 1.2 ms] -
iast 3.25 ms [3.206 ms, 3.294 ms] 2.061 ms (173.4%)
iast_FULL 5.905 ms [5.846 ms, 5.965 ms] 4.716 ms (396.7%)
iast_GLOBAL 3.673 ms [3.61 ms, 3.736 ms] 2.484 ms (208.9%)
profiling 2.029 ms [2.011 ms, 2.046 ms] 839.793 µs (70.6%)
tracing 1.833 ms [1.817 ms, 1.849 ms] 644.044 µs (54.2%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.167 ms [1.155 ms, 1.178 ms] -
iast 3.206 ms [3.166 ms, 3.247 ms] 2.04 ms (174.8%)
iast_FULL 5.664 ms [5.609 ms, 5.72 ms] 4.498 ms (385.6%)
iast_GLOBAL 3.493 ms [3.436 ms, 3.551 ms] 2.327 ms (199.5%)
profiling 2.011 ms [1.994 ms, 2.029 ms] 844.915 µs (72.4%)
tracing 1.809 ms [1.793 ms, 1.824 ms] 642.309 µs (55.1%)

Dacapo

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master smola/ai-guard-content-parts
git_commit_date 1769604948 1769608760
git_commit_sha 708daf3 4180892
release_version 1.59.0-SNAPSHOT~708daf39d2 1.59.0-SNAPSHOT~4180892f39
See matching parameters
Baseline Candidate
application biojava biojava
ci_job_date 1769610873 1769610873
ci_job_id 1383289033 1383289033
ci_pipeline_id 93275768 93275768
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-zfyrx7zua-project-304-concurrent-0-pfmnv5dg 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-zfyrx7zua-project-304-concurrent-0-pfmnv5dg 6.8.0-1031-aws #33~22.04.1-Ubuntu SMP Thu Jun 26 14:22:30 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 1 unstable metrics.

Execution time for tomcat
gantt
    title tomcat - execution time [CI 0.99] : candidate=1.59.0-SNAPSHOT~4180892f39, baseline=1.59.0-SNAPSHOT~708daf39d2
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.476 ms) : 1465, 1488
.   : milestone, 1476,
appsec (3.76 ms) : 3538, 3981
.   : milestone, 3760,
iast (2.255 ms) : 2186, 2324
.   : milestone, 2255,
iast_GLOBAL (2.297 ms) : 2227, 2367
.   : milestone, 2297,
profiling (2.114 ms) : 2058, 2171
.   : milestone, 2114,
tracing (2.065 ms) : 2012, 2119
.   : milestone, 2065,
section candidate
no_agent (1.475 ms) : 1464, 1487
.   : milestone, 1475,
appsec (3.736 ms) : 3515, 3957
.   : milestone, 3736,
iast (2.252 ms) : 2184, 2321
.   : milestone, 2252,
iast_GLOBAL (2.302 ms) : 2232, 2371
.   : milestone, 2302,
profiling (2.122 ms) : 2064, 2179
.   : milestone, 2122,
tracing (2.073 ms) : 2019, 2127
.   : milestone, 2073,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.476 ms [1.465 ms, 1.488 ms] -
appsec 3.76 ms [3.538 ms, 3.981 ms] 2.283 ms (154.7%)
iast 2.255 ms [2.186 ms, 2.324 ms] 778.95 µs (52.8%)
iast_GLOBAL 2.297 ms [2.227 ms, 2.367 ms] 820.764 µs (55.6%)
profiling 2.114 ms [2.058 ms, 2.171 ms] 638.108 µs (43.2%)
tracing 2.065 ms [2.012 ms, 2.119 ms] 589.198 µs (39.9%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.475 ms [1.464 ms, 1.487 ms] -
appsec 3.736 ms [3.515 ms, 3.957 ms] 2.261 ms (153.2%)
iast 2.252 ms [2.184 ms, 2.321 ms] 777.172 µs (52.7%)
iast_GLOBAL 2.302 ms [2.232 ms, 2.371 ms] 826.547 µs (56.0%)
profiling 2.122 ms [2.064 ms, 2.179 ms] 646.454 µs (43.8%)
tracing 2.073 ms [2.019 ms, 2.127 ms] 597.749 µs (40.5%)
Execution time for biojava
gantt
    title biojava - execution time [CI 0.99] : candidate=1.59.0-SNAPSHOT~4180892f39, baseline=1.59.0-SNAPSHOT~708daf39d2
    dateFormat X
    axisFormat %s
section baseline
no_agent (14.901 s) : 14901000, 14901000
.   : milestone, 14901000,
appsec (14.822 s) : 14822000, 14822000
.   : milestone, 14822000,
iast (18.451 s) : 18451000, 18451000
.   : milestone, 18451000,
iast_GLOBAL (17.807 s) : 17807000, 17807000
.   : milestone, 17807000,
profiling (14.883 s) : 14883000, 14883000
.   : milestone, 14883000,
tracing (14.74 s) : 14740000, 14740000
.   : milestone, 14740000,
section candidate
no_agent (15.306 s) : 15306000, 15306000
.   : milestone, 15306000,
appsec (14.835 s) : 14835000, 14835000
.   : milestone, 14835000,
iast (18.051 s) : 18051000, 18051000
.   : milestone, 18051000,
iast_GLOBAL (17.922 s) : 17922000, 17922000
.   : milestone, 17922000,
profiling (14.836 s) : 14836000, 14836000
.   : milestone, 14836000,
tracing (14.568 s) : 14568000, 14568000
.   : milestone, 14568000,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 14.901 s [14.901 s, 14.901 s] -
appsec 14.822 s [14.822 s, 14.822 s] -79.0 ms (-0.5%)
iast 18.451 s [18.451 s, 18.451 s] 3.55 s (23.8%)
iast_GLOBAL 17.807 s [17.807 s, 17.807 s] 2.906 s (19.5%)
profiling 14.883 s [14.883 s, 14.883 s] -18.0 ms (-0.1%)
tracing 14.74 s [14.74 s, 14.74 s] -161.0 ms (-1.1%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.306 s [15.306 s, 15.306 s] -
appsec 14.835 s [14.835 s, 14.835 s] -471.0 ms (-3.1%)
iast 18.051 s [18.051 s, 18.051 s] 2.745 s (17.9%)
iast_GLOBAL 17.922 s [17.922 s, 17.922 s] 2.616 s (17.1%)
profiling 14.836 s [14.836 s, 14.836 s] -470.0 ms (-3.1%)
tracing 14.568 s [14.568 s, 14.568 s] -738.0 ms (-4.8%)

@smola smola force-pushed the smola/ai-guard-content-parts branch 3 times, most recently from add6730 to bf924ea Compare January 28, 2026 09:43
@smola smola added the tag: experimental Experimental changes label Jan 28, 2026
@smola smola force-pushed the smola/ai-guard-content-parts branch from bf924ea to e9063f6 Compare January 28, 2026 09:50
@smola smola marked this pull request as ready for review January 28, 2026 09:51
@smola smola requested review from a team as code owners January 28, 2026 09:51
final boolean hasToolCalls = isNotEmpty(value.getToolCalls(), size);

final boolean hasContentParts = isNotEmpty(value.getContentParts(), size);
final boolean hasContent = !hasContentParts && isNotBlank(value.getContent(), size);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we probably switch the var name to hasContentString? I was confused and I thought it was a boolean to check if there was any content (either content parts or content string)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I'll change it. Also reviewing this I realized there's an incorrect edge case here: it's ok to have empty / blank content, so that isNotBlank should probably be just != null.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although I will not touch the isNotBlank in this PR, since it's unrelated.

@smola smola force-pushed the smola/ai-guard-content-parts branch from e9063f6 to 4180892 Compare January 28, 2026 13:59
@smola smola removed the request for review from jandro996 January 29, 2026 08:17
Copy link
Contributor

@PerfectSlayer PerfectSlayer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good. Left a minor comment.

private final String role;
private final String content;
@Nullable private final String content;
@Nullable private final List<ContentPart> contentParts;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 suggestion: ‏What about enforcing non @Nullable collection and use empty ones instead? In particular for public API?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The thing is only one or the other should be set here, either a plain string content or a list of content parts. In serialization both will be within the content field. Most users will simply set a string instead of a list of content parts.

@smola smola merged commit 45e7904 into master Jan 30, 2026
545 checks passed
@smola smola deleted the smola/ai-guard-content-parts branch January 30, 2026 11:16
@github-actions github-actions bot added this to the 1.59.0 milestone Jan 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: asm waf Application Security Management (WAF) tag: experimental Experimental changes type: enhancement Enhancements and improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants