Skip to main content
The SDK transparently governs calls made through both Google Gemini Python SDKs:
  • google-genaifrom google import genai.
  • google-generativeaiimport google.generativeai.
After egisai.init() runs, calls through either SDK are policy-checked, audited, and (where applicable) sanitized before reaching the provider.

Supported surface

google-genai

google-generativeai

Install

The two extras are independent. You can install both when an application uses both SDKs.

Use — google-genai

Async

Streaming

Use — google-generativeai

Streaming

System instructions

Both SDKs allow attaching a system instruction. The egisai SDK reads it for sub-agent fingerprinting on the dashboard. To override identity explicitly, use set_context().

When a call is blocked

By default a blocked call raises PermissionError. Switch modes at init if you’d rather receive a refusal-shaped response:

What’s next

OpenAI

Anthropic