Skip to main content

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

  1. Gate 1 (local): Regex denylist screens commands in <5ms. Free, no API key needed.
  2. Gate 2 (cloud): Set A2A_API_KEY env 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


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)

Uploaded Source

Built Distribution

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

tyga_langchain-0.1.2-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

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

Hashes for tyga_langchain-0.1.2.tar.gz
Algorithm Hash digest
SHA256 ebdccbd4d19f68fbfe704c41453660d572c94093fddf161b4ab1427b62fe13ca
MD5 77f579ae8627e45116093517ab657230
BLAKE2b-256 b2c6967ed40115bd570feb6819f6e0d75dc32da77aea509ddaad819d7fa6c00d

See more details on using hashes here.

File details

Details for the file tyga_langchain-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for tyga_langchain-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1898aca232d9e10a3d8d0d50103e2dae3f725bbc026994eb31fc37aaaa705e7c
MD5 a87f3844e3208fd9f16cbcce56929cd1
BLAKE2b-256 d8945732d12b3f37e1443113ff4e4c90cf989b40d8edb1371e660cf7d1ec0e6c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page