Open Source

Catalog building blocks, examples, and reusable patterns.

View GitHub

Open Source

The AISecOps runtime enforcement layer — available now as an open-source reference implementation.

aisecops.net · Last updated March 2026 · ~6 min read


What Is Here

AISecOps Interceptor is the open-source implementation of the AISecOps reference architecture. It is a framework-agnostic runtime security layer for agentic AI systems — covering prompt inspection, output inspection, policy-based tool governance, human approval workflows, and structured audit telemetry.

This is not a demo or a prototype. It is the working product core — the same implementation described in the architecture and threat model pages, in runnable Python.

License: Apache 2.0


The Repository

github.com/viplavfauzdar/aisecops-interceptor ↗

Python · Apache 2.0 · Works with Python 3.11–3.13


What the Interceptor Covers

The implementation addresses both critical enforcement layers of an agentic AI system.

Prompt and Output Layer

Everything that enters the model and everything the model returns is inspected before the agent runtime sees it.

Tool Execution Layer

Every tool call is evaluated against policy before execution is permitted.


Audit and Event Telemetry

Every enforcement decision emits a structured RuntimeEvent. The audit system is not a log of what happened — it is a forensic record of the decision chain.

Events are emitted at every enforcement boundary:

EventStage
prompt_allowed / prompt_blockedPrompt guard
output_allowed / output_blockedOutput guard
tool_allowed / tool_blockedPolicy + execution gate
tool_approval_requiredApproval workflow
approval_issued / approval_granted / approval_rejectedApproval workflow

Every event carries agent_name, tool_name, matched_rule, sensitivity_level, data_classification, correlation_id, and timestamp.

The correlation_id field traces a complete decision chain — from prompt inspection through output inspection to tool execution — as a single forensic record.

Multi-Sink Delivery

AuditLogger supports simultaneous delivery to multiple sinks:

Sink delivery is isolated per sink — one failing sink does not block delivery to others. Sink failures are recorded in-memory and exposed via /audit/failures for local inspection.

Queryable Audit API

The /audit endpoint supports filtering by: event_type, stage, agent_name, tool_name, correlation_id, and limit.


Quick Start

# create environment
python3.13 -m venv .venv
source .venv/bin/activate

# install dependencies
pip install -r requirements.txt

# run tests
pytest -q
# → 47 passed

# run the API
uvicorn aisecops_interceptor.api.main:app --reload

# run demos
python -m examples.agent_demo
python examples/demo.py
python -m examples.langgraph_style_demo
python examples/openclaw_demo.py
python -m examples.policy_bundle_demo

Python 3.11 through 3.13. Python 3.14 currently fails on pydantic-core build.


Policy Bundle Example

Define runtime policy as a YAML file — no code required:

rules:
  - tool_name: restart_service
    agent_name: ops_agent
    action: require_approval

  - tool_name: read_customer
    sensitivity_level: high
    action: block

  - tool_name: send_email
    action: require_approval

Load at runtime:

policy = PolicyEngine.from_yaml("policies/production.yaml")

Bundles are validated on load. Invalid bundles raise before any agent executes.


Repository Structure

aisecops_interceptor/

  core/           interceptor, policy, approval, audit,
                  context, decision, execution, events

  guard/          detectors, input inspector, output inspector

  llm/            pipeline, providers (OpenAI, Anthropic, Ollama),
                  factory, config, models

  policy/         rule engine, rules, schema, loader

  integrations/   LangGraph adapter, OpenClaw adapter, generic adapter

  api/            FastAPI wrapper (testing + local development)

examples/         agent_demo, demo, langgraph_style_demo,
                  openclaw_demo, policy_bundle_demo

tests/            47 tests across all layers

What Is Coming Next

The interceptor is in active development. Current engineering focus:


Framework Integration

The interceptor integrates with any agent framework via thin adapters. Current adapters: LangGraph-style, OpenClaw-style, and a generic example. All adapters translate framework-specific tool call representations into the common AISecOps execution contract — they do not contain security logic.

flowchart LR

A[LangGraph]
B[OpenClaw]
C[CrewAI / AutoGen]
D[Custom]

A --> E[Adapter]
B --> E
C --> E
D --> E

E --> F[AISecOps Interceptor Core]

V

Viplav Fauzdar

Building AISecOps as a discipline and open-source reference implementation. Java/Spring + Python practitioner. Focused on practical, shipped security for agentic AI — not slide decks.

Medium ↗ GitHub ↗ LinkedIn ↗


On This Page


Related Pages