Skip to content

fix(redteam): interpolate severity placeholders in report summary#216

Merged
cdot65 merged 1 commit into
mainfrom
cdot65/fix/redteam-report-interpolate-summary-placeholders
May 28, 2026
Merged

fix(redteam): interpolate severity placeholders in report summary#216
cdot65 merged 1 commit into
mainfrom
cdot65/fix/redteam-report-interpolate-summary-placeholders

Conversation

@cdot65

@cdot65 cdot65 commented May 28, 2026

Copy link
Copy Markdown
Owner

Summary

  • Maps known severity tokens ({{CRITICAL_RISK}}, {{HIGH_RISK}}, {{MEDIUM_RISK}}, {{LOW_RISK}}, {{INFORMATIONAL_RISK}}) to readable strings (e.g. high risk) before airs redteam report prints them.
  • Fix lives at the SDK normalizer (getStaticReport() in src/airs/redteam.ts) so any future --output json/yaml for redteam report inherits the cleaned string automatically.
  • Unknown {{...}} tokens are left intact so future upstream leaks remain visible (no blanket regex strip).
  • New exported helper interpolateReportSummary<T>() (generic preserves caller nullability).

Test plan

  • RED: 11 new tests in tests/unit/airs/redteam.spec.ts (5-severity table-driven, double-occurrence, unknown passthrough, no-placeholder identity, null/undefined safe, empty string, integration via getStaticReport) — all failed before implementation
  • GREEN: same 11 tests pass after implementation; full suite 677/677
  • pnpm lint clean
  • pnpm tsc --noEmit clean
  • pnpm test 677 passed
  • pnpm docs:check clean

Closes #203

Map known Mustache tokens ({{CRITICAL_RISK}} etc.) to readable strings
at the SDK normalizer boundary so `airs redteam report` summaries no
longer leak uninterpolated upstream tokens. Unknown {{...}} tokens are
left intact so future leaks remain visible.

Closes #203
@cdot65 cdot65 merged commit ed60961 into main May 28, 2026
5 checks passed
@cdot65 cdot65 deleted the cdot65/fix/redteam-report-interpolate-summary-placeholders branch May 28, 2026 01:55
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.

redteam report: uninterpolated {{HIGH_RISK}} placeholder in summary narrative

1 participant