Skip to main content

langchain-fidem

Check which company operates an online shop before your agent pays. A LangChain tool for Fidem, free and without an API key.

For any shop domain, Fidem returns which company the website says it is and whether that company is in an official register (EU VIES, UK Companies House), the domain age, the first archived copy, the TLS certificate, the stated return window, whether the domain is on open phishing lists and whether its robots.txt lets AI agents in. Each fact comes with its source and date. When the shop has proved it controls the domain and represents its company, Fidem signs it and decision is verified.

Install

pip install langchain-fidem

Use

from langchain_fidem import FidemCheckShop

tools = [FidemCheckShop()]          # give it to any LangChain or LangGraph agent
print(tools[0].invoke({"domain": "tienda-demo.fidemcheck.com"}))

Without an agent, as a plain function:

from langchain_fidem import fidem_check, is_verified

answer = fidem_check("tienda-demo.fidemcheck.com")
print(answer["decision"], answer["identity_verified"])   # fictitious_demo False
print(is_verified(answer))                              # False

tienda-demo.fidemcheck.com is a fictitious shop that Fidem runs on its own subdomain. It always answers fictitious_demo, never verified.

How to read the answer

Branch on decision. Only verified, with identity_verified: True, means the shop proved its identity and Fidem signed it. is_verified(answer) checks exactly that.

decision Meaning
verified The shop proved the domain and its company, and Fidem signed it.
domain_proven The shop proved the domain on the free plan, with no signed file and no proof of representation.
in_review The shop proved the domain and Fidem is reviewing the company.
not_verified No verification. This is not a sign of fraud: most shops have simply not done it.
revoked, expired, invalid_file There was a verification and it no longer holds.
fictitious_demo Fidem's fictitious example. Never pay it.

For a company, mvf_file.representation_proven: False means Fidem signed it during the transition period, which is allowed until 1 January 2027.

The first lookup of a domain Fidem has never seen can come back with lookup_status: "in_progress". The tool waits retry_after_seconds and asks again, for up to 45 seconds (FidemCheckShop(max_wait_seconds=...)), so the agent does not act on a partial answer.

If you prefer MCP, Fidem also runs a remote MCP server at https://fidemcheck.com/mcp, usable from LangChain with langchain-mcp-adapters: https://fidemcheck.com/langchain-check-online-shop.html

More

MIT licence. Fidem, hola@fidemcheck.com.

Verify the signed merchant identity (new in 0.2.0)

When Fidem holds a signed record for a domain, it issues a short-lived signed claim (UCP signal com.fidemcheck.merchant_identity, compact JWS, Ed25519 over RFC 8785 JSON). verify_merchant_identity fetches it, checks the signature against Fidem's published key, the canonical bytes, the validity window and that the claim is about the domain you asked for, and returns a route: identity_ok, escalate (ask the person) or block. No claim on record means escalate, never fraud. The claim says who operates the domain, not who may receive the money: check the payee, the amount and your limits yourself. Spec and reference verifier: https://github.com/fidemcheck/mvf-spec/tree/main/ucp

from langchain_fidem import verify_merchant_identity

r = verify_merchant_identity('tienda-demo.fidemcheck.com')
print(r['route'])   # block: Fidem's fictitious shop, never pay it

Signed receipts with an API key (new in 0.2.1)

Get a key at https://fidemcheck.com/agents-pricing.html (500 signed checks a month free, then 100 EUR per block of 5,000). Set FIDEM_API_KEY or pass api_key=. Every complete answer then carries a receipt: proof of what Fidem answered, to which account and when, signed with Fidem's receipt key (separate from the keys that sign shop verifications). Keep it for disputes and audits. Without a key the lookup stays free, without a receipt.

import os
from langchain_fidem import fidem_check, verify_receipt

os.environ["FIDEM_API_KEY"] = "fk_..."          # or fidem_check(domain, api_key="fk_...")
answer = fidem_check("tienda-demo.fidemcheck.com")
claims = verify_receipt(answer)                # raises MerchantIdentityError if it does not cover this answer
print(claims["decision"], claims["checked_at"])

Metadata

Release files for langchain-fidem 0.2.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-fidem 0.2.1
File Size Uploaded Provenance Actions
langchain_fidem-0.2.1.tar.gz 12.0 kB Without provenance Details for langchain_fidem-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for langchain-fidem 0.2.1
File Interpreter ABI Platform Actions
langchain_fidem-0.2.1-py3-none-any.whl Python 3 none any Details for langchain_fidem-0.2.1-py3-none-any.whl

Total release size: 22.7 kB

Release files / langchain_fidem-0.2.1.tar.gz

Download URL langchain_fidem-0.2.1.tar.gz
Size 12.0 kB
Tags Source
SHA-256 checksum
How to use checksums
d0bc44b8d8d324b2306eaa4403fa7a06bdb0fd65680c40a17c46ae67ca707551
BLAKE2b-256 checksum
How to use checksums
66cc8551dbdca1d3e407c34dab3ae3dafd39b4ca298e07df7855334685511680
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / langchain_fidem-0.2.1-py3-none-any.whl

Download URL langchain_fidem-0.2.1-py3-none-any.whl
Size 10.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
69b7eaee288bc802c75f3c277081e82a34e23733d5c8d0d89acc5a1894ac2982
BLAKE2b-256 checksum
How to use checksums
be2e4256e66851edff16383ca7b9c970cd409c7415cbf07f160155da435e75c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for langchain-fidem 0.2.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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