Skip to main content

langchain-agentgate

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

pip install langchain-agentgate

Usage

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.

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.

License

MIT

Release files for langchain-agentgate 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langchain-agentgate 0.1.0
File Size Uploaded
langchain_agentgate-0.1.0.tar.gz 7.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for langchain-agentgate 0.1.0
File Interpreter ABI Platform
langchain_agentgate-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.1 kB

Release files / langchain_agentgate-0.1.0.tar.gz

Download URL langchain_agentgate-0.1.0.tar.gz
Size 7.3 kB
Tags Source
SHA-256 checksum
How to use checksums
7c0d1b4d59ee134904f9789c0bfb1f88749ac6db337afc94cec061263882577a
BLAKE2b-256 checksum
How to use checksums
7895ece1c991ff5d338966b8ad69bbcc4d1a70699df62488e4c6f36e1e82d672
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / langchain_agentgate-0.1.0-py3-none-any.whl

Download URL langchain_agentgate-0.1.0-py3-none-any.whl
Size 3.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1fff60035d2f9b0e5ce91a9697077317fc2c55c37cb2491c710db35d03c26c69
BLAKE2b-256 checksum
How to use checksums
9f136f035507f952d9a387bbf4b17fe39c0289ded9a012891d8fe6f946b27b3c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release 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