Safety shield for LangChain — screen agent tool calls before execution
Project description
tyga-langchain
Safety shield for LangChain. Wrap any tool with safety_guard() to screen commands before execution.
Install
pip install tyga-langchain
Quick Start
from langchain_community.tools import ShellTool
from tyga_langchain import safety_guard
# One line — wrap any tool
safe_shell = safety_guard(ShellTool())
# Safe commands run normally
safe_shell.run("echo hello") # hello
# Dangerous commands are blocked
safe_shell.run("rm -rf /") # BlockedError: Safety Gate 1: matched [rm\s+-rf\s+/]
How it works
- Gate 1 (local): Regex denylist screens commands in <5ms. Free, no API key needed.
- Gate 2 (cloud): Set
A2A_API_KEYenv var to enable LLM judge evaluation via a2ainfrastructure.com.
Get an API key
Sign up free at a2ainfrastructure.com. 500 evaluations/month on the free tier.
Links
License
Proprietary — Tyga.Cloud Ltd. See LICENSE file.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tyga_langchain-0.1.2.tar.gz
(4.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tyga_langchain-0.1.2.tar.gz.
File metadata
- Download URL: tyga_langchain-0.1.2.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ebdccbd4d19f68fbfe704c41453660d572c94093fddf161b4ab1427b62fe13ca
|
|
| MD5 |
77f579ae8627e45116093517ab657230
|
|
| BLAKE2b-256 |
b2c6967ed40115bd570feb6819f6e0d75dc32da77aea509ddaad819d7fa6c00d
|
File details
Details for the file tyga_langchain-0.1.2-py3-none-any.whl.
File metadata
- Download URL: tyga_langchain-0.1.2-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1898aca232d9e10a3d8d0d50103e2dae3f725bbc026994eb31fc37aaaa705e7c
|
|
| MD5 |
a87f3844e3208fd9f16cbcce56929cd1
|
|
| BLAKE2b-256 |
d8945732d12b3f37e1443113ff4e4c90cf989b40d8edb1371e660cf7d1ec0e6c
|