googleapis / googleapis/java-genai

HARM_CATEGORY_JAILBREAK not supported in Gemini API

Open
#775 6 comments 0 reactions 1 assignee Claimed by @hemasekhar-p View on GitHub
priority: p3 type: feature request
Dominant language
Java
Stars
397
Forks
125
Avg merge
2d 8h
Merged PRs (30d)
41

Description

## 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
```java
List 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.