Local-first, agent-native inbound gate runtime.
Project description
OpenGates
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.
What It Does
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
Why This Exists
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
Status
- Source-available under Elastic License 2.0
- Python 3.10+
- Install from source today
- PyPI package name:
opengates
Quick Start
git clone https://github.com/nvsudo/opengates
cd opengates
uv sync
uv run opengates serve --host 127.0.0.1 --port 8000
Open 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.
Install Options
With uv:
uv sync
uv run opengates serve
With pip:
python -m venv .venv
source .venv/bin/activate
pip install -e .
opengates serve
How It Works
- 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.
Gate Bundle
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.com
Supported 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-gate
Providers
OpenGates 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=1
Notes:
.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
Escalation Email
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=OpenGates
CLI
opengates serve
opengates list-gates
opengates init-gate --from demo-investor --to my-gate
Project Layout
gates/
demo-investor/
src/opengates/
app.py
runtime.py
gates.py
storage.py
schemas.py
providers/
starter_gates/
templates/
tests/
Development
Run tests:
uv run python -m pytest
Build the package:
uv build
License
OpenGates is source-available under Elastic License 2.0.
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file opengates-0.1.0.tar.gz.
File metadata
- Download URL: opengates-0.1.0.tar.gz
- Upload date:
- Size: 29.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1b07bedc465e8b10226f71228d6e75d64ec78271462b8bd29ba856fba7be728
|
|
| MD5 |
e22d0668a2fccc427ec6ba239bca7b6d
|
|
| BLAKE2b-256 |
e719b8a51cff152d2b741e80dd4c422b57c37fcac426bfcba3468081ac472627
|
Provenance
The following attestation bundles were made for opengates-0.1.0.tar.gz:
Publisher:
release.yml on nvsudo/opengates
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
opengates-0.1.0.tar.gz -
Subject digest:
e1b07bedc465e8b10226f71228d6e75d64ec78271462b8bd29ba856fba7be728 - Sigstore transparency entry: 1095815742
- Sigstore integration time:
-
Permalink:
nvsudo/opengates@6f0567823c7717555ea43a85721e35558b3c5ee2 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/nvsudo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6f0567823c7717555ea43a85721e35558b3c5ee2 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file opengates-0.1.0-py3-none-any.whl.
File metadata
- Download URL: opengates-0.1.0-py3-none-any.whl
- Upload date:
- Size: 33.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ef8b3a9689ddef413f664703c602661f710cbe4f6b518b48c51d09ede2a78a7
|
|
| MD5 |
94d234e0a6e838f2a72745df2a441510
|
|
| BLAKE2b-256 |
794fa6abb22a7d69af9364d58100c2d284b313f826b226dda4fb40496958b148
|
Provenance
The following attestation bundles were made for opengates-0.1.0-py3-none-any.whl:
Publisher:
release.yml on nvsudo/opengates
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
opengates-0.1.0-py3-none-any.whl -
Subject digest:
2ef8b3a9689ddef413f664703c602661f710cbe4f6b518b48c51d09ede2a78a7 - Sigstore transparency entry: 1095815820
- Sigstore integration time:
-
Permalink:
nvsudo/opengates@6f0567823c7717555ea43a85721e35558b3c5ee2 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/nvsudo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6f0567823c7717555ea43a85721e35558b3c5ee2 -
Trigger Event:
workflow_dispatch
-
Statement type: