Metadata-Version: 2.4
Name: mcp-bastion-langchain
Version: 0.1.0
Summary: MCP-Bastion security middleware integration for LangChain — prompt injection, PII, and rate-limit protection for LLM agents
Project-URL: Homepage, https://github.com/vaquarkhan/MCP-Bastion
Project-URL: Repository, https://github.com/vaquarkhan/MCP-Bastion
Project-URL: Documentation, https://github.com/vaquarkhan/MCP-Bastion/tree/main/integrations/mcp-bastion-langchain
Author: Viquar Khan
License-Expression: MIT
Keywords: bastion,langchain,llm,mcp,pii,prompt-injection,security
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Security
Requires-Python: >=3.10
Requires-Dist: langchain-core>=0.2.0
Requires-Dist: mcp-bastion-python>=1.0.11
Provides-Extra: dev
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Description-Content-Type: text/markdown

# mcp-bastion-langchain

Security middleware for LangChain powered by [MCP-Bastion](https://pypi.org/project/mcp-bastion-python/).

Protects your LangChain agents from prompt injection, PII leakage, and resource exhaustion.

## Install

```bash
pip install mcp-bastion-langchain
```

## Usage

### Callback (automatic protection)

```python
from langchain_openai import ChatOpenAI
from mcp_bastion_langchain import BastionSecurityCallback

llm = ChatOpenAI(callbacks=[BastionSecurityCallback()])
llm.invoke("Hello, what is MCP?")
```

### Tool decorator

```python
from mcp_bastion_langchain import secure_tool

@secure_tool
def my_tool(query: str) -> str:
    return f"Result for {query}"
```

## Features

- Content filtering on all LLM prompts and tool inputs
- Rate limiting per caller
- Prompt injection detection
- PII redaction

## License

MIT
