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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

langchain_agentgate-0.1.0.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

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

langchain_agentgate-0.1.0-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file langchain_agentgate-0.1.0.tar.gz.

File metadata

  • Download URL: langchain_agentgate-0.1.0.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for langchain_agentgate-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7c0d1b4d59ee134904f9789c0bfb1f88749ac6db337afc94cec061263882577a
MD5 01cbcbf1a9b7b8a55dfdcbbc3c89990d
BLAKE2b-256 7895ece1c991ff5d338966b8ad69bbcc4d1a70699df62488e4c6f36e1e82d672

See more details on using hashes here.

File details

Details for the file langchain_agentgate-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for langchain_agentgate-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1fff60035d2f9b0e5ce91a9697077317fc2c55c37cb2491c710db35d03c26c69
MD5 2da45c1c79e7ccc09b20fdb78e51607d
BLAKE2b-256 9f136f035507f952d9a387bbf4b17fe39c0289ded9a012891d8fe6f946b27b3c

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