Skip to main content

DBL Gateway

Project description

dbl-gateway

pytest PyPI Python >=3.11

When organizations deploy LLM systems, they quickly need to answer three questions: Who asked what, what was permitted, and what actually happened.

dbl-gateway is the reference runtime implementation of the DBL execution boundary for the Deterministic Boundary Layer. It accepts declared intents, enforces policy decisions, and records everything as an append-only, digest-pinned event stream.

Part of the Deterministic Boundary Layer architecture.

Model

Every request passes through the same deterministic chain:

INTENT  ->  DECISION  ->  PROOF  ->  EXECUTION

INTENT records what was asked.
DECISION records what policy allowed.
PROOF records what will be sent.
EXECUTION records what happened.

Only DECISION events are normative. Execution output never feeds back into policy.

Example

Send an intent through POST /ingress/intent and read events through GET /tail?stream_id=default&since=0.

See docs/QUICKSTART.md for the full envelope example.

Zero-Config Demo

No API keys, no .env editing. See the full governance pipeline in 60 seconds:

docker compose --profile demo up --build

Open http://localhost:8010/ui/ and click Start Demo.

Or locally:

GATEWAY_DEMO_MODE=1 dbl-gateway serve

The stub provider generates synthetic responses through the full INTENT, DECISION, PROOF, EXECUTION chain. Demo mode also enables context resolution by default so observer replay works without extra env setup.

One-Command Start

Configure .env once from ​.env.example, set one provider key or local Ollama, then start the gateway with:

docker compose up --build

Open http://localhost:8010/ui/ to watch the event chain in real time.

On Windows, use:

.\run_demo.ps1

Observer UI

Install

pip install dbl-gateway

Or from source:

pip install -e .

Run With Docker

cp .env.example .env
# add one provider key or configure local Ollama in .env
docker compose up --build

Supports OpenAI, Anthropic, or local Ollama. One active provider is enough to run the gateway.

.env is local and must not be committed. Copy .env.example and configure it for your environment.

Run Locally

export DBL_GATEWAY_DB=./data/trail.sqlite
export DBL_GATEWAY_POLICY_MODULE=dbl_policy.allow_all
export DBL_GATEWAY_POLICY_OBJECT=policy
export OPENAI_API_KEY=sk-...

dbl-gateway serve --host 127.0.0.1 --port 8010

Observer

Open /ui to watch the event chain in real time.

The built-in observer includes the event stream, decision replay, chain verification, a policy inspector for DECISION events, manual intent submission, and the integrated demo controller.

Discovery

The runtime exposes three machine-readable discovery surfaces:

  • GET /capabilities
  • GET /surfaces
  • GET /intent-template

Together they describe what the gateway can do, which surfaces exist, and how to speak valid ingress envelopes.

Documentation

See:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dbl_gateway-0.9.10.tar.gz (111.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dbl_gateway-0.9.10-py3-none-any.whl (94.5 kB view details)

Uploaded Python 3

File details

Details for the file dbl_gateway-0.9.10.tar.gz.

File metadata

  • Download URL: dbl_gateway-0.9.10.tar.gz
  • Upload date:
  • Size: 111.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for dbl_gateway-0.9.10.tar.gz
Algorithm Hash digest
SHA256 7057e4780121354811045412e51d00847af935fdcebf881f51598c32314ce768
MD5 93383326553ba9fd21c1c29a2d7ecf90
BLAKE2b-256 866cc8b96449779b876dcc4e715e30bf4397258e8ac11db25caa6a222129d9f6

See more details on using hashes here.

File details

Details for the file dbl_gateway-0.9.10-py3-none-any.whl.

File metadata

  • Download URL: dbl_gateway-0.9.10-py3-none-any.whl
  • Upload date:
  • Size: 94.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for dbl_gateway-0.9.10-py3-none-any.whl
Algorithm Hash digest
SHA256 184fb1ced5d390b75a07b9177d25a78a0a4af555a8203bd0609671dd13d1ea78
MD5 9735759715a0f3fa3842ff73bc3777e4
BLAKE2b-256 f34b537d450040fa210b8344b026425108f55f3009a4b5941c8a720d37ff175f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page