You can guide Gemini's behavior using System Instructions, and control its strictness using Safety Settings.
from vertexai.generative_models import GenerativeModel, SafetySetting
model = GenerativeModel(
"gemini-3.1-flash",
system_instruction="You are a strict data parser.",
safety_settings=[
SafetySetting(
category=SafetySetting.HarmCategory.HARM_CATEGORY_HATE_SPEECH,
threshold=SafetySetting.HarmBlockThreshold.BLOCK_ONLY_HIGH
)
]
)
Safety settings allow enterprise customers to loosen or tighten the default filters based on their specific use case.