Metadata-Version: 2.5
Name: langchain-agentgate
Version: 0.1.0
Summary: Gate any LangChain tool behind human approval in Slack or Microsoft Teams, via AgentGate.
Project-URL: Homepage, https://useagentgate.com
Project-URL: Repository, https://github.com/shakirriyaz/agentgate
Project-URL: Documentation, https://useagentgate.com/docs
Author-email: AgentGate <hello@useagentgate.com>
License: MIT
Keywords: agents,approval,human-in-the-loop,langchain,slack,teams
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Requires-Dist: langchain-core>=0.3.0
Requires-Dist: useagentgate>=1.0.0
Provides-Extra: dev
Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
Requires-Dist: pytest>=8.0.0; extra == 'dev'
Description-Content-Type: text/markdown

# langchain-agentgate

Gate any LangChain tool behind human approval in Slack or Microsoft Teams — one wrapper, no rewrite.

```bash
pip install langchain-agentgate
```

## Usage

```python
from agentgate import AgentGate
from langchain_agentgate import ApprovalRequiredTool

gate = AgentGate(api_key="ag_your_key", base_url="https://your-agentgate-instance")

gated_send_email = ApprovalRequiredTool(
    wrapped_tool=send_email_tool,   # any existing BaseTool
    gate=gate,
    risk_tier="high",
    timeout_minutes=15,
)
```

Use `gated_send_email` anywhere `send_email_tool` would have gone — same name, same
input schema, same output type. The only difference: before it actually runs, it posts
a request to Slack/Teams and blocks until a human clicks Approve or Reject.

```python
result = await agent_executor.ainvoke({"input": "email the Q4 proposal to john@acme.com"})
```

If rejected, the tool call returns the rejection reason as its output instead of
raising — so the agent sees "the email was rejected because X" and can react to it,
rather than crashing.

## Why wrap instead of rewrite

Most human-in-the-loop patterns require restructuring how you build the tool. This
doesn't — it wraps a `BaseTool` you already have. Your tool's logic, its args schema,
and its name are all unchanged; approval is a layer around it, not a rewrite of it.

## Requires

An AgentGate server — self-hosted or hosted — connected to Slack and/or Teams. See
[the AgentGate onboarding guide](https://github.com/shakirriyaz/agentgate/blob/main/docs/onboarding.md).

## License

MIT
