Skip to content

fix(library)!: reject inputs exceeding detector coverage in jailbreak detection - #2560

Merged
Pouyanpi merged 6 commits into
developfrom
pouyanpi/jailbreak-truncation-bypass
Nov 6, 2026
Merged

Pouyanpi merged 6 commits into
developfrom
pouyanpi/jailbreak-truncation-bypass

Conversation

@Pouyanpi

@Pouyanpi Pouyanpi commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

Description

Block inputs over 2,048 tokens, including special tokens, before cache lookup or local/remote classification. Use a bundled, pinned Snowflake tokenizer for offline validation, and block on validation failures or detector HTTP 413 responses.

This protects calls through Guardrails; direct calls to the hosted NIM still depend on its own input handling.

Related Issue(s)

Verification

  • Real Snowflake tokenizer integration: 10 passed, with Hugging Face offline mode enabled. Confirmed the original truncation and whitespace-cache behavior fails the regression checks.
  • Recorded live NVIDIA allow/block/invalid-key responses and the late-suffix bypass. Verified both engines block the oversized input without another HTTP request; replayed offline and checked cassettes contain no credentials.
  • Built the wheel; verified tokenizer/license inclusion and token boundaries from its extracted installation layout. Verified tokenizer checksum and that lockfile regeneration changes no package versions or sources.

@github-actions github-actions Bot added status: needs triage New issues that have not yet been reviewed or categorized. needs: rebase size: L labels Nov 4, 2026
Signed-off-by: Pouyanpi <13303554+Pouyanpi@users.noreply.github.com>
Signed-off-by: Pouyanpi <13303554+Pouyanpi@users.noreply.github.com>
@Pouyanpi
Pouyanpi force-pushed the pouyanpi/jailbreak-truncation-bypass branch from 98f575e to 664390c Compare November 4, 2026 10:55
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Signed-off-by: Pouyanpi <13303554+Pouyanpi@users.noreply.github.com>
@Pouyanpi
Pouyanpi force-pushed the pouyanpi/jailbreak-truncation-bypass branch from 664390c to c07f1d6 Compare November 4, 2026 11:25

@tgasser-nv tgasser-nv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good, just a few nits to clean up before merging. High level item:

  1. Should the PR description be fix(library)!: .... since prior to the PR inputs > 2,048 tokens were classified using the first 2,048 tokens and now they'll be rejected before the model runs?

Signed-off-by: Pouyanpi <13303554+Pouyanpi@users.noreply.github.com>
Signed-off-by: Pouyanpi <13303554+Pouyanpi@users.noreply.github.com>
BREAKING CHANGE: The jailbreak model rail rejects messages over 2048 Snowflake tokens, including special tokens, instead of classifying only their truncated prefix.

Signed-off-by: Pouyanpi <13303554+Pouyanpi@users.noreply.github.com>
@Pouyanpi Pouyanpi changed the title fix(library): reject inputs exceeding detector coverage in jailbreak detection fix(library)!: reject inputs exceeding detector coverage in jailbreak detection Nov 6, 2026
@Pouyanpi
Pouyanpi merged commit 6cd3808 into develop Nov 6, 2026
28 checks passed
@Pouyanpi
Pouyanpi deleted the pouyanpi/jailbreak-truncation-bypass branch November 6, 2026 09:05
@Pouyanpi Pouyanpi removed the status: needs triage New issues that have not yet been reviewed or categorized. label Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants