Skip to content

[feature] Initial Cognitive Firewall MVP — FastAPI façade + Python SDK + rule-based detection #27

@RachanaB5

Description

@RachanaB5

Summary

Deliver a minimal end-to-end “Cognitive Firewall” MVP that is easy to run and demo: an HTTP API (FastAPI) in front of the existing Python SDK and UDS sidecar, with rule-based detection/signals on the evaluation path (regex / pattern lists / simple scoring — exact scope in PR).

This issue is scoped to MVP: correctness and clear contracts over full Phase 2–3 pipeline parity.

Motivation

  • Lower the barrier to try ACF without wiring UDS-only clients.
  • Provide a stable /validate-style contract for tools and integrations without replacing the sidecar or IPC design from Phase 1.
  • Align with #6 by not proposing FastAPI as the production PEP↔PDP transport; the hot path remains SDK → UDS → sidecar.

Scope (proposed)

  • FastAPI app: health + at least one endpoint that accepts hook + payload and returns ALLOW / SANITISE / BLOCK (and optional sanitised body) matching existing SDK semantics.
  • Uses acf Python SDK (Firewall) against the running sidecar (ACF_HMAC_KEY, socket path).
  • Rule-based layer: configurable patterns/rules (YAML or JSON) applied in-process before or after sidecar round-trip — to be clarified in PR (prefer one clear story, e.g. “pre-filter + sidecar” or “sidecar-only + HTTP wrapper”).
  • README or short doc section: how to run sidecar + API + example curl/HTTP client.
  • Tests: FastAPI route tests with mocks or integration behind a flag.

Non-goals (for this MVP)

  • Replacing UDS with HTTP for the PEP↔PDP path.
  • Full OPA/Rego or full pipeline parity (tracked in roadmap phases).

Related

Acceptance criteria

  • One-command or documented sequence to run sidecar + FastAPI + successful validation of a sample payload.
  • CI passes; new code is tested.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions