Skip to main content

langchain-sealkeeper

Check an AI agent or MCP server on SealKeeper from LangChain, before your agent calls it.

A SEAL is SealKeeper's signed credential for an agent or a service. This package wires the sealkeeper library into LangChain. Every SEAL is verified on your machine and every decision is the library's Gate.

Install

pip install langchain-sealkeeper

Python 3.10 or later. It depends on sealkeeper, langchain-core and langchain.

Look up

SealKeeperLookupTool lets the model look a target up.

from langchain.agents import create_agent
from langchain_sealkeeper import SealKeeperLookupTool

agent = create_agent(model, tools=[SealKeeperLookupTool()])

The tool is sealkeeper_lookup, with one argument, target. A target is a handle such as alice/helper, a SealKeeper page URL, an agent id, a did:key, an A2A card URL or an MCP server URL.

The model reads one line, such as alice/helper: verified agent SEAL, level bronze, Trust Score 412. or alice/helper: no verified SEAL (broken, bad_signature).

The ToolMessage artifact is the lookup as a dict of JSON values, so a checkpointer keeps it as it is. verified says whether the SEAL verified, and seal holds it when it did. Without one, code says why, as in the sealkeeper library's Lookup. A broken SEAL reads verified false and no level, kind or Trust Score.

A lookup that fails, such as SealKeeper not answering in time, answers an error ToolMessage with the reason.

Gate an MCP server

SealGateInterceptor checks an MCP server's SEAL before each call to one of its tools. It needs langchain-mcp-adapters.

from langchain_mcp_adapters.client import MultiServerMCPClient
from langchain_sealkeeper import SealGateInterceptor

connections = {
    "weather": {"transport": "streamable_http", "url": "https://mcp.example.com/mcp"},
    "notes": {"transport": "stdio", "command": "notes-server", "args": []},
}
gate = SealGateInterceptor(connections, ["weather"])
client = MultiServerMCPClient(connections, tool_interceptors=[gate])
tools = await client.get_tools()

Pass it the same connections as the client. It reads each server's url from them at every call, as a service. Load the tools with client.get_tools(), or with load_mcp_tools(session, server_name=...) and the connection's name, since a tool loaded without its server's name is not gated.

  • A pass calls the tool.
  • A block answers an error ToolMessage with the code and the reason, such as SealKeeper blocked this call: not_found. SealKeeper knows no agent or service by that target. The tool is not called and the agent's run goes on. The message has no name, and outside a LangGraph ToolNode its tool_call_id is empty.
  • A server you do not name passes untouched.
  • A stdio server has no URL to check, so naming one raises ValueError.

Gate a remote agent

SealGateMiddleware checks a target's SEAL before each call to a tool that calls it, such as a tool that sends a task to a remote A2A agent.

from langchain.agents import create_agent
from langchain_sealkeeper import SealGateMiddleware, SealTarget

gate = SealGateMiddleware({
    "ask_helper": SealTarget("agent", "alice/helper"),
    "fetch_report": SealTarget("service", "https://mcp.example.com/mcp"),
})
agent = create_agent(model, tools=[ask_helper, fetch_report, search], middleware=[gate])

Each pinned tool name maps to a SealTarget(kind, ref). kind is "agent" or "service", and ref is any target the lookup takes. A block answers an error ToolMessage with the code and the reason, the tool is not called and the run goes on. A tool you do not pin passes untouched. It works with invoke and ainvoke.

The rules

Both gates decide with a sealkeeper.Gate and its default rules. A pass needs a current, valid SEAL of the kind at bronze or above, and for a card or MCP server URL the SEAL must name that URL.

allow_unsealed=True on either gate also lets through a target SealKeeper does not know, one it is still checking and one with no SEAL while it is dormant. A withheld or broken SEAL, a delisted target and SealKeeper unavailable still block.

gate = SealGateInterceptor(connections, ["weather"], allow_unsealed=True)

The block codes are in the sealkeeper README. Each decision writes one INFO line to the sealkeeper logger, never the SEAL, a full URL or the tool's arguments.

License

MIT

Metadata

Release files for langchain-sealkeeper 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-sealkeeper 0.1.0
File Size Uploaded Provenance Actions
langchain_sealkeeper-0.1.0.tar.gz 13.1 kB With provenance Details for langchain_sealkeeper-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 22.3 kB

Release files / langchain_sealkeeper-0.1.0.tar.gz

Download URL langchain_sealkeeper-0.1.0.tar.gz
Size 13.1 kB
Tags Source
SHA-256 checksum
How to use checksums
34ff0063f66e8216986a8746d98ddd3ba38f9cb4c83f7467154f987bd6cd88c0
BLAKE2b-256 checksum
How to use checksums
3138d50048a030fdd13de60c76dc0075da5b3cf452a67d4d4319d44edb2ae3e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.3 {"installer":{"name":"uv","version":"0.13.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

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 Nov 2, 2026.

Transparency log

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

Download URL langchain_sealkeeper-0.1.0-py3-none-any.whl
Size 9.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7848ba3bf4f4ec6a44b9cd629f4c8eb17225c6f116fddfc627e56e2852888305
BLAKE2b-256 checksum
How to use checksums
f1b0a10b8dcdff80a7a8ea6a7ce017b3f5ea2209fc8cea5cfbdf8ec6cb365a49
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.3 {"installer":{"name":"uv","version":"0.13.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

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 Nov 2, 2026.

Transparency log

Security for langchain-sealkeeper 0.1.0

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_sealkeeper-0.1.0.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 Nov 2, 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.0 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