Skip to content

feat(ctxSegments): surface brand-safety classifications - #352

Merged
mosherBT merged 1 commit into
masterfrom
contextual-brand-safety
Sep 28, 2026
Merged

mosherBT merged 1 commit into
masterfrom
contextual-brand-safety

Conversation

@pierluc-codes

@pierluc-codes pierluc-codes commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Why

The DCN classifies pages against the Brand Safety Floor + Suitability Framework, but ctxSegments() had no way to read the result or pass it to an ad server.

What Changed

  • contextual_segments: add brandSafety: { assessed, categories: [{ name, riskLevel }] } to the response, plus ContextualBrandSafetyOf() and ContextualMaxRiskLevel().

  • sdk: add ctxBrandSafety() and ctxMaxRiskLevel(). Risk tiers order low < medium < high < floor.

  • ctxTargetingKeyValues(): emit the most severe tier under ctx_bs_max by default, with no_flags (assessed, nothing flagged) and not_assessed (nothing known) as distinct values so a line item can separate them. Rename via brandSafetyKey, opt out with "".

  • README + ctx_segments demos document the above.

  • Breaking change

  • Requires release

🤖 Generated with Claude Code

Add `brandSafety` to the contextual segments response, along with
`ctxBrandSafety()` and `ctxMaxRiskLevel()` on the SDK, and emit the page's
most severe tier to ad servers under `ctx_bs_max`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@pierluc-codes
pierluc-codes requested review from a team as code owners September 28, 2026 16:52
@pierluc-codes pierluc-codes self-assigned this Sep 28, 2026
@mosherBT
mosherBT merged commit 0d7bdfe into master Sep 28, 2026
7 checks passed
@mosherBT
mosherBT deleted the contextual-brand-safety branch September 28, 2026 17:51
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.

3 participants