Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Aegis — the self-hosted AI gateway that shows its work

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

Aegis is alpha software, licensed under AGPL-3.0-or-later.

Metadata

Release files for aegis-gateway 2.0.0a2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aegis-gateway 2.0.0a2
File Size Uploaded
aegis_gateway-2.0.0a2.tar.gz 15.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aegis-gateway 2.0.0a2
File Interpreter ABI Platform
aegis_gateway-2.0.0a2-py3-none-any.whl Python 3 none any Details

Total release size: 31.0 kB

Release files / aegis_gateway-2.0.0a2.tar.gz

Download URL aegis_gateway-2.0.0a2.tar.gz
Size 15.6 kB
Tags Source
SHA-256 checksum
How to use checksums
295a5b2d83a9a8b317073cb377a1232a198fa251bd7339825062321e1bdd9568
BLAKE2b-256 checksum
How to use checksums
15b697401d3222cdf1d9bca0b7555448112a780673676f8119110c50395e8c28
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

Release files / aegis_gateway-2.0.0a2-py3-none-any.whl

Download URL aegis_gateway-2.0.0a2-py3-none-any.whl
Size 15.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
36723368f1e70d330fffa106ad49fbb71540d02f9d289ff1dc254d9ee9894b8e
BLAKE2b-256 checksum
How to use checksums
6d4f5736efba0f5e1293908c194fa97428b5459c579faca02672a42759f9d50f
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
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page