Skip to main content

langchain-pidgeon

Pidgeon is the email inbox API for AI agents. It gives agents their own inboxes so they can work with emails just like a human. This package is its tools for LangChain and LangGraph agents.

pip install langchain-pidgeon

Give an agent a mailbox

from langchain.agents import create_agent

from langchain_pidgeon import PidgeonToolkit

# Reads PIDGEON_API_KEY.
tools = PidgeonToolkit().get_tools()

agent = create_agent("anthropic:claude-sonnet-5-5", tools=tools)
result = agent.invoke(
    {
        "messages": [
            {
                "role": "user",
                "content": "Make an address on pidgeon.email, then wait for the code "
                "I am about to send it and tell me what it is.",
            }
        ]
    }
)
print(result["messages"][-1].content)

PIDGEON_API_KEY is a pgn_live_… key. Make one at pidgeon.ai/app/developers/keys, or let your agent sign itself up: pidgeon.ai/skill.md is two calls, and the only thing it needs from a person is a six-digit code.

The tools

The same tools as Pidgeon's hosted MCP server, by name, each one call of the pidgeon SDK.

Tool What it does Kind
list_addresses The addresses the key can reach, with the ids the other tools take Read-only
create_address A new address for the agent; anybody can then write to it Open world
list_messages One conversation, oldest first Read-only
search_messages Full-text search across every address the key reaches Read-only
get_message One message, cleaned by Pidgeon Firewall unless you ask for the original Read-only
await_message Waits up to 280 seconds for the next message and returns its codes, links Read-only
send_message A new message to anybody Destructive
reply_to_message An answer in the same conversation; recipients come off the original Destructive
update_thread Hands a conversation to a person, or takes it back Reversible

Each tool's metadata carries the server's four hints: readOnlyHint, destructiveHint, idempotentHint and openWorldHint. Use them to choose which calls wait for a person:

from langchain.agents import create_agent
from langchain.agents.middleware import HumanInTheLoopMiddleware
from langgraph.checkpoint.memory import InMemorySaver

from langchain_pidgeon import PidgeonToolkit

tools = PidgeonToolkit().get_tools()
asks_first = {tool.name: True for tool in tools if not tool.metadata["readOnlyHint"]}

agent = create_agent(
    "anthropic:claude-sonnet-5-5",
    tools=tools,
    middleware=[HumanInTheLoopMiddleware(interrupt_on=asks_first)],
    checkpointer=InMemorySaver(),
)

Bodies arrive cleaned: hidden text removed and fake chat turns marked. Every message carries firewall, and suspicious means it tries to steer the model. A refusal reaches the model as the API's own sentence, so it can tell a person why instead of retrying.

The key is the whole of the access control

Nothing in this package decides what the agent may reach. The key does, on the server, whatever the prompt says. Give it the narrowest one the job needs:

  • One address. A key lists the addresses it reaches, so an agent holding a key for support@yourdomain.com cannot read payroll@. A key that creates an address can reach the address it created.
  • The lowest level that does the job. An agent that triages needs read, and a read key cannot send. One that answers needs send.

PidgeonToolkit(api_key=...) takes a key directly, and client= takes a pidgeon.AuthenticatedClient you have built yourself.

Documentation: pidgeon.ai/docs/langchain · a runnable example.

MIT licensed.

Metadata

Release files for langchain-pidgeon 0.1.1

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-pidgeon 0.1.1
File Size Uploaded Provenance
langchain_pidgeon-0.1.1.tar.gz 10.2 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for langchain-pidgeon 0.1.1
File Interpreter ABI Platform
langchain_pidgeon-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 21.8 kB

Release files / langchain_pidgeon-0.1.1.tar.gz

Download URL langchain_pidgeon-0.1.1.tar.gz
Size 10.2 kB
Tags Source
SHA-256 checksum
How to use checksums
0f67d6f8813043da6a7f5cd9dd6c547b2d43ba198947def85634a2aa42aad637
BLAKE2b-256 checksum
How to use checksums
7b24868aa50fa679174f520054e992e40e838ac165d6b2c42a8254bfb3f9e9cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

Release files / langchain_pidgeon-0.1.1-py3-none-any.whl

Download URL langchain_pidgeon-0.1.1-py3-none-any.whl
Size 11.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
47ede405564e31731ad9928d3b77e973560a46482a9c3ab47e029a6fc8a1241a
BLAKE2b-256 checksum
How to use checksums
d181fe7a83872a70f1d3945aea05c00b432d8cf74644ad85b3c78b837049c888
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

Security for langchain-pidgeon 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for langchain_pidgeon-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

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