Skip to content

FIX: Handle bio/cyber refusals - #2714

Open
Roman Lutz (romanlutz) wants to merge 1 commit into
microsoft:mainfrom
romanlutz:romanlutz-provider-policy-block-handling
Open

Roman Lutz (romanlutz) wants to merge 1 commit into
microsoft:mainfrom
romanlutz:romanlutz-provider-policy-block-handling

Conversation

@romanlutz

Copy link
Copy Markdown
Contributor

Description

Provider HTTP 400 refusals with bio_policy or cyber_policy currently propagate as SDK errors instead of being recorded as blocked responses. Add these two codes to the existing shared content-filter markers so callers retain the refusal and its original error details. Malformed requests, invalid parameters, and schema errors still raise; attack branching, retry policies, and provider safeguards are unchanged.

bio_policy is listed in the OpenAI Responses API reference. Both codes have explicit handling in OpenAI Codex and HTTP 400 tests that assert no retry. The documentation distinguishes this official client behavior from a universal API contract.

Tests and Documentation

  • 287 focused offline tests passed across shared exceptions, OpenAI error handling, Chat targets, and Responses targets. New cases cover payload extraction, preservation of error details, exactly one SDK HTTP request, and propagation of unrelated 400s.
  • Ruff lint/format, the production ty check, documentation validation, and the other applicable commit hooks passed. The large-file hook passed independently; only its commit-time invocation was skipped because its git check-attr subprocess fails on Windows.
  • Updated the target guide with the handling behavior, verified provider sources, and related codes already covered by existing markers. No live provider requests or attacks were run.

JupyText: N/A; no notebooks or executable documentation examples changed.

Preserve explicit provider refusals through shared content-filter handling and cover SDK HTTP 400 behavior with offline transport tests.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
It does not bypass provider safeguards or change attack branching or retry policies.
Malformed requests, invalid parameters, and schema errors still raise.

The shared `CONTENT_FILTER_MARKERS` set includes `bio_policy` and `cyber_policy`, both observed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this seems a bit verbose; I don't think we need a separate doc section for this?

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.

2 participants