The SDK transparently governs calls made through the official openai Python
package. After egisai.init() runs, every supported method on OpenAI /
AsyncOpenAI clients is policy-checked, audited, and (where applicable)
sanitized before reaching the provider.
Supported surface
Streaming responses are wrapped in a generator that audits the assembled
output without materialising it for your code — your existing for chunk in stream: loop continues to work.
Minimum version
openai>=1.40 is recommended. Older releases do not expose the modern
Chat/Responses API surface the patcher targets.
Install
Use
The call is intercepted before it leaves your process, evaluated against your
active policies, and only then forwarded to OpenAI.
Async usage
Streaming
When the model returns tool calls, output-side policies (for example tool/
connector restrictions) are evaluated against the structured response. If a
tool call is blocked, the verdict is recorded with the offending tool name.
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 object:
Read Blocking behavior for the full picture.
Notes
- The SDK detects vision parts in
messages and ignores image content for
text-based PII checks. Text fields elsewhere in the payload are still
evaluated.
- The patcher runs only when the
openai package is importable; if you
uninstall it, the integration silently disables itself.
What’s next