Metadata-Version: 2.4
Name: tyga-langchain
Version: 0.1.2
Summary: Safety shield for LangChain — screen agent tool calls before execution
Author-email: Joe Wee <joe@tyga.cloud>
License: SEE LICENSE IN LICENSE
Project-URL: Homepage, https://a2ainfrastructure.com/quickstart/langchain
Project-URL: Documentation, https://a2ainfrastructure.com/docs
Keywords: langchain,safety,firewall,ai-agents,a2a
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: langchain-core>=0.3
Dynamic: license-file

# tyga-langchain

Safety shield for LangChain. Wrap any tool with `safety_guard()` to screen commands before execution.

## Install

```bash
pip install tyga-langchain
```

## Quick Start

```python
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](https://a2ainfrastructure.com/auth/signup). 500 evaluations/month on the free tier.

## Links

- [Quick Start Guide](https://a2ainfrastructure.com/quickstart/langchain)
- [API Docs](https://a2ainfrastructure.com/docs)

## License

Proprietary — Tyga.Cloud Ltd. See LICENSE file.
