Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

HARM_CATEGORY_JAILBREAK not supported in Gemini API

オープン
#775 コメント 6 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@hemasekhar-p がすでに取り組んでいます。

2026年1月16日 から。

評価

この issue はまだ評価されていません。

説明

priority: p3 type: feature request

Description

The HarmCategory.Known.HARM_CATEGORY_JAILBREAK enum value exists in the Java SDK (v1.32.0) but is explicitly marked as unsupported in the Javadoc:

"The harm category is for jailbreak prompts. This enum value is not supported in Gemini API."

Code Example

List<SafetySetting> safetySettings = List.of(
    SafetySetting.builder()
        .category(HarmCategory.Known.HARM_CATEGORY_JAILBREAK) // Exists but not supported
        .threshold(HarmBlockThreshold.Known.BLOCK_MEDIUM_AND_ABOVE)
        .build()
);

Questions

  1. Is this feature planned for future releases? If yes, what is the expected timeline?
  2. Is there currently an alternative approach to prevent jailbreak attempts?

Environment

  • SDK Version: google-genai 1.32.0 (Maven)
  • Language: Java

Expected Behavior

  • A roadmap/timeline should be provided for when this feature will be supported

Additional Context

This would help developers make informed decisions about security settings implementation.

主要言語
Java
スター
398
フォーク
126
平均マージ
1日 12時間
マージ済み PR(30日)
71

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

googleapis/java-genai のほかの issue

googleapis/java-genai の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。