Skip to main content

mcp-bastion-langchain

Security middleware for LangChain powered by MCP-Bastion.

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

Install

pip install mcp-bastion-langchain

Usage

Callback (automatic protection)

from langchain_openai import ChatOpenAI
from mcp_bastion_langchain import BastionSecurityCallback

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

Tool decorator

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

Same terms as the MCP-Bastion project: see LICENSE. Non-commercial use is free with required citation/attribution; copyright terms apply. Commercial use as defined in the License may need a separate agreement (COMMERCIAL_LICENSE.md).

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_bastion_langchain-5.1.0.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_bastion_langchain-5.1.0-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file mcp_bastion_langchain-5.1.0.tar.gz.

File metadata

  • Download URL: mcp_bastion_langchain-5.1.0.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for mcp_bastion_langchain-5.1.0.tar.gz
Algorithm Hash digest
SHA256 cadd80fb113b3782de85e56fd7782bb27e6e03544c661285fed189023269a591
MD5 bfb7db18508c51515e8109f55100399c
BLAKE2b-256 f45fdf36b77eeb7d4e768db23217f906c09775c4e5405fc6b48c4f8347cfb25f

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_bastion_langchain-5.1.0.tar.gz:

Publisher: publish-integrations.yml on vaquarkhan/MCP-Bastion

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mcp_bastion_langchain-5.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_bastion_langchain-5.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7d08ca76a6de387ef92cd29c4f1db76cb72c19ac6cb3334ae704428a5acfb5d4
MD5 a4ff34f3c7a05e30e014bb97d317c3ff
BLAKE2b-256 9b7c2202c9d52b2328c88a20768fb4b7261fc06444a2865cae852d08a24dfa44

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_bastion_langchain-5.1.0-py3-none-any.whl:

Publisher: publish-integrations.yml on vaquarkhan/MCP-Bastion

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

5.1.0 This release

2 files

5.0.0

2 files

4.0.0

2 files

3.3.1

2 files

3.3.0

2 files

3.2.0

2 files

3.1.2

2 files

3.1.1

2 files

3.1.0

2 files

3.0.1

2 files

3.0.0

2 files

2.0.2

2 files

2.0.1

2 files

2.0.0

2 files

0.1.2

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page