SWAYOM.AIv2.4
Security / Policy systems● Active development

Original project / Swayom Sharma

GateShield

AI Security Gateway & Policy Enforcement

Inspect the request.
Enforce the boundary.

An OpenAI-compatible gateway that inspects input, applies deterministic policies, validates output, authorizes tool requests, and preserves sanitized audit evidence.

  • Python
  • FastAPI
  • SQLAlchemy
  • JSON Schema
  • SQLite
Technical case studyReviewed 17 October 2026Static media / No hosted backend

01 / Genuine project captures

Inside GateShield.
Evidence you can inspect.

Actual captures from the current local implementation. Select a view, then enlarge it to read the interface or response in full.

Recorded demonstration

The real workflow,
recorded locally.

A silent capture of the running project, with explanatory English captions. The recording preserves actual UI states and their stated limitations.

Press play to load the walkthrough.

Open recording ↗Read captions ↗

02 / Project overview

Inspect the request.
Enforce the boundary.

Model applications need an inspectable boundary between untrusted context, a configured provider, and downstream tools. GateShield places deterministic decision-making at that boundary and records the evidence used by the gateway.

Input inspection and versioned policies determine whether a request can proceed. Output checks apply redaction or withholding before the response returns. Tool authorization is a separate explicit decision; the integrating application remains responsible for execution.

The current authenticated operations console presents persisted request, security-event, policy, tool, approval and administrative records. The portfolio captures that real console without exposing its administration API.

03 / Capabilities & evidence

Implemented work.
Clearly defined scope.

01Implemented

Compatible gateway contract

POST /v1/chat/completions forwards admitted requests to an explicitly configured compatible provider. Request and trace identifiers connect decisions to persisted records. Streaming is unsupported.

02Implemented

Versioned policy lifecycle

Exact-match rules use ENFORCE, MONITOR or OFF. Draft, active and retired versions support explicit activation and rollback, with role-protected authoring.

03Implemented

Input & output inspection

Deterministic injection and credential checks, output DLP, and bounded JSON object/schema validation feed policy decisions. Coverage is limited; pattern matching is not universal attack detection.

04Implemented

Scoped tool authorization

Application-scoped definitions, schema/argument checks and resource guards determine admission. High-risk requests use expiring, single-use, context-bound approval. Authorization does not execute the tool.

05Captured locally

Sanitized operational evidence

Console filters and inspectors read persisted decisions, security events and policy state. Sensitive snapshots are redacted before storage and console display.

06Configuration required

Optional routing signals

Classification-aware model routes and an optional semantic classifier require explicit operator configuration. A classifier cannot independently grant an action.

04 / Technical architecture

How the pieces connect.

  1. 01

    Client / compatible request

    Bounded JSON input, message roles, segment provenance and request correlation.

  2. 02

    Inspection + deterministic policy

    Input findings meet active policy versions. BLOCK and REQUIRE_APPROVAL prevent provider forwarding.

  3. 03

    Configured provider adapter

    Only admitted traffic reaches the selected endpoint. Missing or failed upstream service remains an explicit failure.

  4. 04

    Output validation + audit store

    DLP and structured-response checks precede sanitized return and SQLAlchemy persistence. The authenticated console reads those records.

Tool authorization and approvals form a separate admission path. The capture uses real denials and upstream failure; it does not demonstrate a successful external model integration.

05 / Verified technology

The actual building blocks.

Gateway
Python · FastAPI · httpx

Typed request handling and an explicitly configured provider transport.

Policies & validation
Pydantic · jsonschema

Validated policy definitions and bounded structured-response validation.

Persistence
SQLAlchemy · SQLite / PostgreSQL · Alembic

Local capture uses disposable SQLite; production settings require PostgreSQL.

Operations UI
Server-served HTML · CSS · JavaScript

Authenticated /console renders actual backend records; it is not a React application.

06 / Security & boundaries

Explicit safeguards.
Honest limits.

Controls described here are implementation details, not a blanket security certification.

  • Deterministic enforcement

    Active policies govern admission and response withholding. Detectors have bounded coverage and may produce false positives or miss attacks.

  • Separated credentials

    Console HTTP Basic authentication protects administrative views. Agent credentials cover registered agent calls; general caller authentication still belongs at trusted ingress.

  • Bounded disclosure

    Stored request/response copies and console output are sanitized. Redaction is not a guarantee that arbitrary content contains no sensitive information.

  • Deployment boundary

    The console and gateway remain local. TLS, correct ingress body limits, tenant boundaries and secret lifecycle controls require deployment review.

07 / Development status

Active development.
Known limitations, documented.

Repository roadmap material covers evaluation and operational hardening. This showcase does not claim those deployment-specific paths are certified.

Current local operations-console redesign includes uncommitted changes beyond the linked backend baseline.

Source baseline: d57844a ↗. Source inspection, local demonstration and production verification are different evidence levels.

08 / Source references

Inspect the implementation.

Continue exploring

Built to be inspected.

Read the source, explore another project, or discuss the engineering.