# mbhatt1/agentic_lpci_framework architecture

> Architecture diagram of the GitHub repository mbhatt1/agentic_lpci_framework, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mbhatt1/agentic_lpci_framework
- Repository: https://github.com/mbhatt1/agentic_lpci_framework

## Overview

LPCI is a security benchmark for testing language models against persistent, infrastructure-level prompt-control attacks. The main workflow configures a test run, has agents execute attack scenarios against selected model interfaces, then analyzes results and produces visualizations. A distinct infrastructure-attack path demonstrates poisoned retrieval, cross-session persistence, and tool-registry compromise. The excerpts directly show orchestration, RAG retrieval and session-store use, and analysis/visualization responsibilities; links for unsampled attack and service implementations are limited to documented capabilities and their listed paths.

Main entry points: [`agentic_lpci_framework/main.py`](https://github.com/mbhatt1/agentic_lpci_framework/blob/master/agentic_lpci_framework/main.py) (Test framework), [`agentic_lpci_framework/attacks/base.py`](https://github.com/mbhatt1/agentic_lpci_framework/blob/master/agentic_lpci_framework/attacks/base.py) (Attack interface), [`agentic_lpci_framework/core/agent.py`](https://github.com/mbhatt1/agentic_lpci_framework/blob/master/agentic_lpci_framework/core/agent.py) (Test agent), [`agentic_lpci_framework/models/base.py`](https://github.com/mbhatt1/agentic_lpci_framework/blob/master/agentic_lpci_framework/models/base.py) (Model interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Test orchestration"]
  node_framework["Test framework<br/>[main.py]"]
  node_config["Configuration<br/>[settings.py]"]
  node_agent["Test agent<br/>[agent.py]"]
  node_memory[("Agent memory<br/>[memory.py]")]
end

subgraph group_attacks["Attack scenarios"]
  node_attack_base["Attack interface<br/>[base.py]"]
  node_role_attack["Role override<br/>[role_override.py]"]
  node_tool_attack["Tool poisoning<br/>[tool_poisoning.py]"]
  node_vector_attack["Vector payload"]
  node_lpci_attacks["LPCI attack suite<br/>[lpci_core.py]"]
  node_real_attacks["Real attack cases"]
end

subgraph group_models["Model interfaces"]
  node_model_base["Model interface<br/>[base.py]"]
  node_openai["OpenAI adapter<br/>[openai_model.py]"]
  node_anthropic["Anthropic adapter<br/>[anthropic_model.py]"]
  node_google["Google adapter<br/>[google_model.py]"]
end

subgraph group_infrastructure["Attack infrastructure"]
  node_rag["RAG pipeline<br/>[rag_pipeline.py]"]
  node_vector_store[("Vector store<br/>[vector_store.py]")]
  node_session_store[("Session store<br/>[session_store.py]")]
  node_mcp["MCP server<br/>[mcp_server.py]"]
end

subgraph group_reporting["Analysis and reporting"]
  node_analyzer["Result analyzer<br/>[result_analyzer.py]"]
  node_charts["Visualizations<br/>[charts.py]"]
end

node_user(("Benchmark user"))
node_model_services{{"Model APIs"}}
node_redis[("Redis")]

node_user -->|"starts tests"| node_framework
node_framework -->|"loads settings"| node_config
node_framework -->|"runs scenarios"| node_agent
node_framework -->|"creates session"| node_memory
node_agent -->|"reads and updates"| node_memory
node_agent -->|"executes attacks"| node_attack_base
node_attack_base -->|"specialized by"| node_role_attack
node_attack_base -->|"specialized by"| node_tool_attack
node_attack_base -->|"specialized by"| node_vector_attack
node_attack_base -->|"specialized by"| node_lpci_attacks
node_attack_base -->|"specialized by"| node_real_attacks
node_agent -->|"sends test input"| node_model_base
node_model_base -->|"implemented by"| node_openai
node_model_base -->|"implemented by"| node_anthropic
node_model_base -->|"implemented by"| node_google
node_openai -->|"calls API"| node_model_services
node_anthropic -->|"calls API"| node_model_services
node_google -->|"calls API"| node_model_services
node_rag -->|"queries documents"| node_vector_store
node_rag -->|"checks triggers"| node_session_store
node_session_store -->|"reads and writes"| node_redis
node_rag -->|"generates response"| node_openai
node_tool_attack -.->|"poisons registry"| node_mcp
node_framework -->|"analyzes results"| node_analyzer
node_framework -->|"generates charts"| node_charts

click node_framework "https://github.com/mbhatt1/agentic_lpci_framework/blob/master/agentic_lpci_framework/main.py"
click node_config "https://github.com/mbhatt1/agentic_lpci_framework/blob/master/agentic_lpci_framework/config/settings.py"
click node_agent "https://github.com/mbhatt1/agentic_lpci_framework/blob/master/agentic_lpci_framework/core/agent.py"
click node_memory "https://github.com/mbhatt1/agentic_lpci_framework/blob/master/agentic_lpci_framework/core/memory.py"
click node_attack_base "https://github.com/mbhatt1/agentic_lpci_framework/blob/master/agentic_lpci_framework/attacks/base.py"
click node_role_attack "https://github.com/mbhatt1/agentic_lpci_framework/blob/master/agentic_lpci_framework/attacks/role_override.py"
click node_tool_attack "https://github.com/mbhatt1/agentic_lpci_framework/blob/master/agentic_lpci_framework/attacks/tool_poisoning.py"
click node_vector_attack "https://github.com/mbhatt1/agentic_lpci_framework/blob/master/agentic_lpci_framework/attacks/vector_store_payload.py"
click node_lpci_attacks "https://github.com/mbhatt1/agentic_lpci_framework/blob/master/agentic_lpci_framework/attacks/lpci_core.py"
click node_model_base "https://github.com/mbhatt1/agentic_lpci_framework/blob/master/agentic_lpci_framework/models/base.py"
click node_openai "https://github.com/mbhatt1/agentic_lpci_framework/blob/master/agentic_lpci_framework/models/openai_model.py"
click node_anthropic "https://github.com/mbhatt1/agentic_lpci_framework/blob/master/agentic_lpci_framework/models/anthropic_model.py"
click node_google "https://github.com/mbhatt1/agentic_lpci_framework/blob/master/agentic_lpci_framework/models/google_model.py"
click node_rag "https://github.com/mbhatt1/agentic_lpci_framework/blob/master/agentic_lpci_framework/infrastructure/rag_pipeline.py"
click node_vector_store "https://github.com/mbhatt1/agentic_lpci_framework/blob/master/agentic_lpci_framework/infrastructure/vector_store.py"
click node_session_store "https://github.com/mbhatt1/agentic_lpci_framework/blob/master/agentic_lpci_framework/infrastructure/session_store.py"
click node_mcp "https://github.com/mbhatt1/agentic_lpci_framework/blob/master/agentic_lpci_framework/infrastructure/mcp_server.py"
click node_analyzer "https://github.com/mbhatt1/agentic_lpci_framework/blob/master/agentic_lpci_framework/analysis/result_analyzer.py"
click node_charts "https://github.com/mbhatt1/agentic_lpci_framework/blob/master/agentic_lpci_framework/visualization/charts.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_framework,node_config,node_agent,node_memory,node_user toneBlue
class node_attack_base,node_role_attack,node_tool_attack,node_vector_attack,node_lpci_attacks,node_real_attacks,node_redis toneAmber
class node_model_base,node_openai,node_anthropic,node_google,node_model_services toneMint
class node_rag,node_vector_store,node_session_store,node_mcp toneRose
class node_analyzer,node_charts toneIndigo
```

## Components

### Test orchestration

- [Test framework](https://github.com/mbhatt1/agentic_lpci_framework/blob/master/agentic_lpci_framework/main.py): `agentic_lpci_framework/main.py`
- [Configuration](https://github.com/mbhatt1/agentic_lpci_framework/blob/master/agentic_lpci_framework/config/settings.py): `agentic_lpci_framework/config/settings.py`
- [Test agent](https://github.com/mbhatt1/agentic_lpci_framework/blob/master/agentic_lpci_framework/core/agent.py): `agentic_lpci_framework/core/agent.py`
- [Agent memory](https://github.com/mbhatt1/agentic_lpci_framework/blob/master/agentic_lpci_framework/core/memory.py): `agentic_lpci_framework/core/memory.py`

### Attack scenarios

- [Attack interface](https://github.com/mbhatt1/agentic_lpci_framework/blob/master/agentic_lpci_framework/attacks/base.py): `agentic_lpci_framework/attacks/base.py`
- [Role override](https://github.com/mbhatt1/agentic_lpci_framework/blob/master/agentic_lpci_framework/attacks/role_override.py): `agentic_lpci_framework/attacks/role_override.py`
- [Tool poisoning](https://github.com/mbhatt1/agentic_lpci_framework/blob/master/agentic_lpci_framework/attacks/tool_poisoning.py): `agentic_lpci_framework/attacks/tool_poisoning.py`
- [Vector payload](https://github.com/mbhatt1/agentic_lpci_framework/blob/master/agentic_lpci_framework/attacks/vector_store_payload.py): `agentic_lpci_framework/attacks/vector_store_payload.py`
- [LPCI attack suite](https://github.com/mbhatt1/agentic_lpci_framework/blob/master/agentic_lpci_framework/attacks/lpci_core.py): `agentic_lpci_framework/attacks/lpci_core.py`
- **Real attack cases**

### Model interfaces

- [Model interface](https://github.com/mbhatt1/agentic_lpci_framework/blob/master/agentic_lpci_framework/models/base.py): `agentic_lpci_framework/models/base.py`
- [OpenAI adapter](https://github.com/mbhatt1/agentic_lpci_framework/blob/master/agentic_lpci_framework/models/openai_model.py): `agentic_lpci_framework/models/openai_model.py`
- [Anthropic adapter](https://github.com/mbhatt1/agentic_lpci_framework/blob/master/agentic_lpci_framework/models/anthropic_model.py): `agentic_lpci_framework/models/anthropic_model.py`
- [Google adapter](https://github.com/mbhatt1/agentic_lpci_framework/blob/master/agentic_lpci_framework/models/google_model.py): `agentic_lpci_framework/models/google_model.py`

### Attack infrastructure

- [RAG pipeline](https://github.com/mbhatt1/agentic_lpci_framework/blob/master/agentic_lpci_framework/infrastructure/rag_pipeline.py): `agentic_lpci_framework/infrastructure/rag_pipeline.py`
- [Vector store](https://github.com/mbhatt1/agentic_lpci_framework/blob/master/agentic_lpci_framework/infrastructure/vector_store.py): `agentic_lpci_framework/infrastructure/vector_store.py`
- [Session store](https://github.com/mbhatt1/agentic_lpci_framework/blob/master/agentic_lpci_framework/infrastructure/session_store.py): `agentic_lpci_framework/infrastructure/session_store.py`
- [MCP server](https://github.com/mbhatt1/agentic_lpci_framework/blob/master/agentic_lpci_framework/infrastructure/mcp_server.py): `agentic_lpci_framework/infrastructure/mcp_server.py`

### Analysis and reporting

- [Result analyzer](https://github.com/mbhatt1/agentic_lpci_framework/blob/master/agentic_lpci_framework/analysis/result_analyzer.py): `agentic_lpci_framework/analysis/result_analyzer.py`
- [Visualizations](https://github.com/mbhatt1/agentic_lpci_framework/blob/master/agentic_lpci_framework/visualization/charts.py): `agentic_lpci_framework/visualization/charts.py`

### Other components

- **Benchmark user**
- **Model APIs**
- **Redis**

## Connections

- Benchmark user → Test framework: starts tests
- Test framework → Configuration: loads settings
- Test framework → Test agent: runs scenarios
- Test framework → Agent memory: creates session
- Test agent → Agent memory: reads and updates
- Test agent → Attack interface: executes attacks
- Attack interface → Role override: specialized by
- Attack interface → Tool poisoning: specialized by
- Attack interface → Vector payload: specialized by
- Attack interface → LPCI attack suite: specialized by
- Attack interface → Real attack cases: specialized by
- Test agent → Model interface: sends test input
- Model interface → OpenAI adapter: implemented by
- Model interface → Anthropic adapter: implemented by
- Model interface → Google adapter: implemented by
- OpenAI adapter → Model APIs: calls API
- Anthropic adapter → Model APIs: calls API
- Google adapter → Model APIs: calls API
- RAG pipeline → Vector store: queries documents
- RAG pipeline → Session store: checks triggers
- Session store → Redis: reads and writes
- RAG pipeline → OpenAI adapter: generates response
- Tool poisoning → MCP server: poisons registry
- Test framework → Result analyzer: analyzes results
- Test framework → Visualizations: generates charts
