Implement Barrikade security client and pluggable framework#464
Open
Ishaan005 wants to merge 10 commits into
Open
Implement Barrikade security client and pluggable framework#464Ishaan005 wants to merge 10 commits into
Ishaan005 wants to merge 10 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR introduces a Security Plugin Registry to
jentic-mini's gateway and integrates Barrikade as the primary security plugin.Instead of hardcoding security logic or relying on redundant, high-latency request-body scans at the egress broker layer (which are already captured by the global
SecurityIngressMiddlewareat ingress), jentic-mini now implements a modular registry interface that intercepts and scans API response bodies returned by third-party services. This provides critical protection against data leaks, PII exfiltration, and indirect prompt injections before they reach the agent or Arazzo workflow runner.Architectural Refactor
security_registry.scan_ingressbefore routing or database execution.broker.pyright after_upstream_body = await upstream_response.read()and scans them viasecurity_registry.scan_responsebefore delivery.Summary of Changes
1. Security Registry & Interfaces (
src/security/)src/security/plugin.py:SecurityVerdictfor lightweight, high-performance classifications.SecurityPluginabstract base class with default ingress filter (should_scan_ingress), response filter (should_scan_response), and delegatingscan_responsemethods.src/security/registry.py:SecurityRegistrysingleton coordinating active plugins.src/security/barrikade.py:SecurityPluginsubclassingSecurityPlugin. Encapsulates direct HTTP calls to Barrikade’s stateless/v1/detectAPI.should_scan_ingressto target only Jentic’s/search,/workflows/{slug}, and broker routing paths.src/security/utils.py:2. Router Integration (
src/routers/)src/routers/broker.py:policy_deniedtrace and short-circuit with a structured403 Forbiddenresponse-block verdict.src/main.py:SecurityIngressMiddlewareto delegate directly tosecurity_registrywithout carrying any vendor-specific imports.BarrikadePlugindynamically in lifespan ifBARRIKADE_URLis set in the environment.3. Tooling & Orchestration
compose.barrikade.yml: Added a new Docker Compose stack configuration file overlayingcompose.ymlto define the localbarrikade/apiservice and link it to Jentic Mini internally.scripts/start-stack.sh: Created an interactive shell script to spin up the Jentic Mini + Barrikade containers (Standard or Full Vite UI Dev stack) instantly.docs/security.md: Created exhaustive system design, lifecycle, configuration, and custom plugin development documentation, linked indocs/README.md.This change requires real-world testing with live APIs. The foundation is in place and should be reiterated on.