This release is a pre-release and may not be stable for production use.
aegis-gateway
Aegis is a self-hosted AI gateway. It sits between your applications and any LLM provider, runs every request through guardrails you declare in one YAML file, and records every decision in a hash-chained audit ledger — so "why was this blocked, masked or paused, and who signed off?" always has an answer.
This is the umbrella package: the aegis CLI, the server, the kernel and all
first-party policy packs.
Install
pip install aegis-gateway
python -m spacy download en_core_web_sm # model used by the PII pack
Requires Python 3.12+.
Sixty seconds to a governed endpoint
aegis init # aegis.yaml: fake provider + PII masking
aegis serve --config aegis.yaml --no-auth # http://localhost:8000
Point any OpenAI client at it — the model field selects an Aegis route:
from openai import OpenAI
client = OpenAI(base_url="http://localhost:8000/v1", api_key="dev")
reply = client.chat.completions.create(
model="default",
messages=[{"role": "user", "content": "Email jane@example.com the summary"}],
)
print(reply.choices[0].message.content) # the model only ever saw <EMAIL_ADDRESS_0>
Then read the trail:
export AEGIS_SERVER_URL=http://localhost:8000
aegis explain --last # verdict-by-verdict trail
aegis audit export -o ledger.jsonl && aegis audit verify ledger.jsonl
Four verdicts, nothing else
| Verdict | What happens |
|---|---|
allow |
Continue unchanged. |
sanitize |
Continue with rewritten content. |
block |
Stop. The client gets a refusal; the ledger gets the reason. |
require_approval |
Checkpoint and pause until a named human approves or denies. |
What's included
| Package | Provides |
|---|---|
aegis-gateway-core |
Kernel: config, plugin registry, pipeline, contracts, test kits |
aegis-gateway-server |
FastAPI server: OpenAI-compatible and native APIs, auth, ledger |
aegis-gateway-cli |
The aegis command |
aegis-gateway-sdk |
Python client (sync + async) |
aegis-gateway-pack-pii |
PII masking with Presidio |
aegis-gateway-pack-residency |
Data-residency enforcement |
aegis-gateway-pack-classification |
Content labelling |
aegis-gateway-pack-budgets |
Per-principal monthly spend caps |
aegis-gateway-pack-llm-guard |
LLM Guard scanners |
Install a subset instead if you only need part of it — e.g. pip install aegis-gateway-core to build a plugin.
Learn more
- Documentation — guide, policy packs, plugin development, reference
- Changelog · Releases
- Source & issues
Aegis is alpha software, licensed under AGPL-3.0-or-later.
Release files for aegis-gateway 2.0.0a1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| aegis_gateway-2.0.0a1-py3-none-any.whl | Python 3 | none | any | Details |
Release files / aegis_gateway-2.0.0a1-py3-none-any.whl
| Download URL | aegis_gateway-2.0.0a1-py3-none-any.whl |
|---|---|
| Size | 15.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ce675c415857a99748bc9debde0da8a0fc60f3400e8ac38c0f8536bad0ee0f01
|
|
BLAKE2b-256 checksum How to use checksums |
a767105d9b5d53bf2040969302fbc354743c220dff3e9b3c2be7171bb2abe740
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 26, 2026.
Transparency log