Skip to main content
Production guardrails for Python AI applications. Install the SDK, call egisai.init(), and continue using OpenAI, Anthropic, Google Gemini, or plain HTTP clients as you do today — policy evaluation and audit logging wrap those calls automatically. This site is the canonical SDK guide for the egisai package on PyPI.
Prefer enforcement on the network path — or can’t install a Python SDK at all (Node service, low-code platform, vendor tool)? The same policies apply through the inline Gateway. In Python, egisai.Client sends governed chat completions with a single import; every other stack points any OpenAI-compatible client (or plain HTTP) at https://app.egisai.co/v1/agent. One policy set, one audit trail, two integration paths.

Quickstart

Install, initialize, and make your first governed call in five minutes.

How it works

Understand how policy evaluation slots into your model call path.

Gateway

Govern on the network path — egisai.Client in Python, plain HTTP everywhere else.

API reference

Detailed reference for init(), Client, set_context(), and policy types.

Troubleshooting

Common symptoms, what they mean, and how to fix them.

Overview

What you need

  1. Python 3.11+
  2. An EgisAI account and an SDK API key (dashboard → API Keys → create). Keys look like egis_live_….
  3. The AI SDK(s) you already use (openai, anthropic, google-genai, …).

Installation

Optional extras (smaller installs):
Only frameworks present in your environment are activated at runtime. See the installation guide for more options.

Getting started

1

Initialize once per process

Call egisai.init() as early as possible in your application lifecycle — for example, right after loading configuration. Use your SDK API key from the dashboard.
2

Use your LLM client normally

No changes to your calling convention — the SDK intercepts supported APIs after initialization.
3

Review activity

Open Dashboard → Requests to see governed calls, verdicts, and supporting metadata for your organization.

How governance fits your call path

  1. Evaluation — Before the upstream model runs, the SDK applies your organization’s active policies (cached locally). Rules such as PII detection, regex denylists, model allowlists, and intent-oriented policies are evaluated in a fixed order defined by the product.
  2. Outcomes — A call may be allowed, sanitized (payload adjusted per policy, then forwarded), or blocked. Blocked calls never reach the provider when enforcement raises or returns a stub, depending on configuration.
  3. Telemetry — Non-blocking delivery of audit metadata to EgisAI so your dashboard stays current without slowing customer-facing inference.
Sensitive pattern detection intended to catch regulated data is performed locally so raw values are not sent to third-party models as part of governance. Intent-oriented policies operate only after applicable local checks have run on the text that will be judged. Read How it works for the full call-path diagram.

When a call is blocked

Configure at init:
See Blocking behavior for guidance on when to choose each mode.

Configuration at a glance

Treat API keys as secrets — use environment variables or a secrets manager, never commit them to source control.
The full reference lives in Configuration and the init API reference.

Policies (operator concepts)

Organizations configure policies in the dashboard. Typical categories include: Exact rule shape and ordering are managed in the product; the SDK consumes the published configuration and does not require you to embed policy documents in your repository. See Policies for the SDK-side picture.

Advanced: explicit context (optional)

For multi-tenant or test scenarios, you may override auto-detected context (for example agent identity) with egisai.set_context(**kwargs) as described in the set_context reference. This is optional — the default path fingerprints agents from your application’s behavior. See Multi-agent context for patterns.

Performance and availability

  • Steady-state overhead is designed to stay on the order of a fraction of a millisecond for policy lookup per call after initialization and cache warm-up.
  • Control plane connectivity — If the SDK cannot reach EgisAI at startup, your process can still run; policy enforcement may be limited until a successful connection and policy fetch. Local checks remain in force where the engine can evaluate them. For your specific deployment’s behavior, refer to your contract and SECURITY.md.
  • Audit delivery is asynchronous so network latency does not sit on the critical path of every model call.

Privacy and security

  • Do not embed secrets in repository copies of this README.
  • For vulnerability reporting, see SECURITY.md — please use the disclosed channel rather than public issues for security-sensitive matters.
A short summary suitable for architecture reviews:
  • Governance evaluates prompts with respect to your organization’s policies before upstream invocation where applicable.
  • Sensitive-content handling is architected so that raw regulated values are not sent to third-party LLMs as part of policy enforcement workflows described here.

Supported Python libraries

Minimum versions are guidance; pin in your own requirements.txt for reproducible builds. Only frameworks actually importable in your environment are patched at runtime — uninstalled frameworks are silently skipped. Per-library walkthroughs:

OpenAI

Anthropic

Google Gemini

AWS Bedrock

Claude Agent SDK

Agent frameworks

httpx / requests

For the full per-framework enforcement matrix — what’s blocked before a tool runs vs. what’s recorded after the fact — see Enforcement matrix in the SDK README.

Resources

License

Apache License 2.0 — see the LICENSE file in the source repository.
EgisAI — runtime governance for AI agents.