Source-available runtime for filtering inbound through conversation.
OpenGates lets you define what you care about in a few files, then handles the inbound thread for you: decline, ask a bounded follow-up, or escalate with a clean summary. It is the runtime behind Ante, the hosted product.
OpenGates is built for attention gating:
- define a gate with Markdown files instead of a large config surface
- run a threaded decision loop over inbound messages
- return one of three outcomes:
decline,clarify, orescalate - keep decision guardrails and persistence outside the model
- ship with a minimal FastAPI UI and HTTP endpoints you can build on
Outbound is getting cheaper every month. More agents will write to you, not fewer. If every inbound message can be polished, the bottleneck becomes judgment.
OpenGates is the runtime for that judgment layer:
- local-first by default
- file-based and auditable
- useful without mailbox access
- usable with heuristics today and stronger model providers later
- Source-available under Elastic License 2.0 (
ELv2) - Not OSI open source
- Python 3.10+
- Published on PyPI as
opengates - PyPI package name:
opengates
pip install opengates
opengates serve --host 127.0.0.1 --port 8000Open http://127.0.0.1:8000/demo.
The repo includes a starter gate under gates/demo-investor. If you run from a clean working directory without a local ./gates, OpenGates falls back to the bundled starter gate packaged with the runtime.
pip install opengates
opengates serve --host 127.0.0.1 --port 8000Then:
- open http://127.0.0.1:8000/demo
- submit a test message
- watch the default heuristic provider return
decline,clarify, orescalate - copy the starter gate and customize it:
opengates init-gate --from demo-investor --to my-gateWhat you get by default:
- no API key required
- local file-based state
- bundled starter gate and reference UI
From PyPI with uv:
uv tool install opengates
opengates serveFrom source with uv:
git clone https://github.com/nvsudo/opengates
cd opengates
uv sync
uv run opengates serveFrom source with pip:
python -m venv .venv
source .venv/bin/activate
pip install -e .
opengates serve- A sender starts a thread through the built-in UI or an external client.
- OpenGates loads the gate bundle for that gate.
- A decision provider evaluates the current turn.
- The runtime enforces guardrails and returns
decline,clarify, orescalate. - Thread state, messages, decisions, and sender profile data are persisted locally.
- The built-in UI or your own frontend can render the next step.
Each gate lives in gates/<gate_id>/ and usually includes:
gates/my-gate/
focus.md
standards.md
voice.md
examples.md
gate.yaml
focus.md: what the gate is forstandards.md: what good looks likevoice.md: how replies should soundexamples.md: examples that sharpen judgmentgate.yaml: optional UI and runtime settings
Common gate.yaml fields:
title: Investor Gate
assistant_name: OpenGates
surface_label: gate
public_path: /investor
max_clarification_rounds: 2
principal_email: founder@example.comSupported UI fields include:
assistant_avatarassistant_statuswelcome_headlinewelcome_bodycomposer_placeholderinvited_topics
Create a new gate from the starter bundle:
opengates init-gate --from demo-investor --to my-gateOpenGates currently supports two decision paths:
heuristic: no API key required, good for obvious spam and explicit rulesopenai: uses the OpenAI Responses API for more ambiguous cases
Use the OpenAI provider by creating a .env file in your working directory:
OPENGATES_PROVIDER=openai
OPENAI_API_KEY=your_key_here
OPENGATES_OPENAI_MODEL=gpt-5-mini
OPENGATES_DEBUG_PROMPTS=1Notes:
.envand.env.localare read from the current working directory- if
OPENGATES_CONFIG_DIRis set, config is read from there instead - if the OpenAI call fails, the runtime falls back to heuristics
OpenGates can send an escalation email when:
principal_emailis set ingate.yaml- SMTP settings are configured
OPENGATES_SMTP_HOST=smtp.example.com
OPENGATES_SMTP_PORT=587
OPENGATES_SMTP_USERNAME=...
OPENGATES_SMTP_PASSWORD=...
OPENGATES_SMTP_USE_TLS=1
OPENGATES_SMTP_USE_SSL=0
OPENGATES_NOTIFICATION_FROM_EMAIL=gatekeeper@example.com
OPENGATES_NOTIFICATION_FROM_NAME=OpenGatesopengates serve
opengates list-gates
opengates init-gate --from demo-investor --to my-gategates/
demo-investor/
src/opengates/
app.py
runtime.py
gates.py
storage.py
schemas.py
providers/
starter_gates/
templates/
tests/
Run tests:
uv run python -m pytestBuild the package:
uv buildOpenGates is source-available under Elastic License 2.0 (ELv2). It is not released under an OSI-approved open source license.
That means:
- internal use is allowed, including inside commercial companies
- modification is allowed
- redistribution is allowed subject to the license terms
- offering OpenGates itself as a hosted or managed service is not allowed
See LICENSE for the full terms.