Skip to content

feat(ai-guard): preserve tag probabilities in SDK responses#17191

Draft
smola wants to merge 1 commit intomainfrom
smola/APPSEC-61898-tag-probs
Draft

feat(ai-guard): preserve tag probabilities in SDK responses#17191
smola wants to merge 1 commit intomainfrom
smola/APPSEC-61898-tag-probs

Conversation

@smola
Copy link
Copy Markdown
Member

@smola smola commented Mar 30, 2026

Description

  • AI Guard REST API returns a tag_probs field with a dictionary, where each key is a tag, and each value is a probability (from 0.0 to 1.0) of that tag being present in the evaluated LLM call.
  • Propagate tag_probs to the result of the evaluate call.
  • Attach tag_probs to the AI Guard spans for later use in the UI.

Testing

Risks

Additional Notes

@pr-commenter
Copy link
Copy Markdown

pr-commenter bot commented Mar 30, 2026

Performance SLOs

Comparing candidate smola/APPSEC-61898-tag-probs (564508e) with baseline main (97d4f14)

📈 Performance Regressions (1 suite)
📈 iastaspectsospath - 24/24

✅ ospathbasename_aspect

Time: ✅ 510.415µs (SLO: <700.000µs 📉 -27.1%) vs baseline: 📈 +20.6%

Memory: ✅ 43.939MB (SLO: <46.000MB -4.5%) vs baseline: +4.9%


✅ ospathbasename_noaspect

Time: ✅ 432.919µs (SLO: <700.000µs 📉 -38.2%) vs baseline: +0.2%

Memory: ✅ 43.739MB (SLO: <46.000MB -4.9%) vs baseline: +4.7%


✅ ospathjoin_aspect

Time: ✅ 627.378µs (SLO: <700.000µs 📉 -10.4%) vs baseline: +0.2%

Memory: ✅ 43.912MB (SLO: <46.000MB -4.5%) vs baseline: +4.9%


✅ ospathjoin_noaspect

Time: ✅ 637.497µs (SLO: <700.000µs -8.9%) vs baseline: -0.4%

Memory: ✅ 43.819MB (SLO: <46.000MB -4.7%) vs baseline: +4.6%


✅ ospathnormcase_aspect

Time: ✅ 353.575µs (SLO: <700.000µs 📉 -49.5%) vs baseline: +0.5%

Memory: ✅ 43.885MB (SLO: <46.000MB -4.6%) vs baseline: +4.9%


✅ ospathnormcase_noaspect

Time: ✅ 357.767µs (SLO: <700.000µs 📉 -48.9%) vs baseline: -1.5%

Memory: ✅ 43.996MB (SLO: <46.000MB -4.4%) vs baseline: +5.1%


✅ ospathsplit_aspect

Time: ✅ 487.822µs (SLO: <700.000µs 📉 -30.3%) vs baseline: +0.7%

Memory: ✅ 43.965MB (SLO: <46.000MB -4.4%) vs baseline: +4.9%


✅ ospathsplit_noaspect

Time: ✅ 495.925µs (SLO: <700.000µs 📉 -29.2%) vs baseline: -0.1%

Memory: ✅ 43.835MB (SLO: <46.000MB -4.7%) vs baseline: +4.7%


✅ ospathsplitdrive_aspect

Time: ✅ 374.330µs (SLO: <700.000µs 📉 -46.5%) vs baseline: -0.2%

Memory: ✅ 43.823MB (SLO: <46.000MB -4.7%) vs baseline: +4.6%


✅ ospathsplitdrive_noaspect

Time: ✅ 72.651µs (SLO: <700.000µs 📉 -89.6%) vs baseline: -0.7%

Memory: ✅ 43.924MB (SLO: <46.000MB -4.5%) vs baseline: +5.1%


✅ ospathsplitext_aspect

Time: ✅ 460.168µs (SLO: <700.000µs 📉 -34.3%) vs baseline: -0.2%

Memory: ✅ 43.939MB (SLO: <46.000MB -4.5%) vs baseline: +5.2%


✅ ospathsplitext_noaspect

Time: ✅ 469.018µs (SLO: <700.000µs 📉 -33.0%) vs baseline: +0.3%

Memory: ✅ 44.031MB (SLO: <46.000MB -4.3%) vs baseline: +5.1%

✅ All Tests Passing (2 suites)
iastaspectssplit - 12/12

✅ rsplit_aspect

Time: ✅ 161.919µs (SLO: <250.000µs 📉 -35.2%) vs baseline: +4.6%

Memory: ✅ 43.913MB (SLO: <46.000MB -4.5%) vs baseline: +5.1%


✅ rsplit_noaspect

Time: ✅ 159.137µs (SLO: <250.000µs 📉 -36.3%) vs baseline: +1.7%

Memory: ✅ 43.822MB (SLO: <46.000MB -4.7%) vs baseline: +4.8%


✅ split_aspect

Time: ✅ 154.167µs (SLO: <250.000µs 📉 -38.3%) vs baseline: +1.1%

Memory: ✅ 43.827MB (SLO: <46.000MB -4.7%) vs baseline: +4.5%


✅ split_noaspect

Time: ✅ 160.917µs (SLO: <250.000µs 📉 -35.6%) vs baseline: +4.6%

Memory: ✅ 43.851MB (SLO: <46.000MB -4.7%) vs baseline: +4.9%


✅ splitlines_aspect

Time: ✅ 150.576µs (SLO: <250.000µs 📉 -39.8%) vs baseline: +1.7%

Memory: ✅ 43.787MB (SLO: <46.000MB -4.8%) vs baseline: +4.7%


✅ splitlines_noaspect

Time: ✅ 155.494µs (SLO: <250.000µs 📉 -37.8%) vs baseline: -0.2%

Memory: ✅ 43.856MB (SLO: <46.000MB -4.7%) vs baseline: +4.9%


iastpropagation - 8/8

✅ no-propagation

Time: ✅ 48.594µs (SLO: <60.000µs 📉 -19.0%) vs baseline: -0.1%

Memory: ✅ 40.029MB (SLO: <42.000MB -4.7%) vs baseline: +5.0%


✅ propagation_enabled

Time: ✅ 137.013µs (SLO: <190.000µs 📉 -27.9%) vs baseline: -0.3%

Memory: ✅ 39.970MB (SLO: <42.000MB -4.8%) vs baseline: +4.8%


✅ propagation_enabled_100

Time: ✅ 1.559ms (SLO: <2.300ms 📉 -32.2%) vs baseline: -1.2%

Memory: ✅ 40.069MB (SLO: <42.000MB -4.6%) vs baseline: +4.9%


✅ propagation_enabled_1000

Time: ✅ 29.139ms (SLO: <34.550ms 📉 -15.7%) vs baseline: -0.1%

Memory: ✅ 40.187MB (SLO: <42.000MB -4.3%) vs baseline: +4.9%

ℹ️ Scenarios Missing SLO Configuration (20 scenarios)

The following scenarios exist in candidate data but have no SLO thresholds configured:

  • iast_aspects-re_expand_aspect
  • iast_aspects-re_expand_noaspect
  • iast_aspects-re_findall_aspect
  • iast_aspects-re_findall_noaspect
  • iast_aspects-re_finditer_aspect
  • iast_aspects-re_finditer_noaspect
  • iast_aspects-re_fullmatch_aspect
  • iast_aspects-re_fullmatch_noaspect
  • iast_aspects-re_group_aspect
  • iast_aspects-re_group_noaspect
  • iast_aspects-re_groups_aspect
  • iast_aspects-re_groups_noaspect
  • iast_aspects-re_match_aspect
  • iast_aspects-re_match_noaspect
  • iast_aspects-re_search_aspect
  • iast_aspects-re_search_noaspect
  • iast_aspects-re_sub_aspect
  • iast_aspects-re_sub_noaspect
  • iast_aspects-re_subn_aspect
  • iast_aspects-re_subn_noaspect

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