langchain-botsrated
Install in 3 steps
- Install the guard from a checkout. Not on PyPI yet (
pip install langchain-botsratedis 0.1.2, free tools only). In a clean virtualenv:pip install -e integrations/langchain(pullsbotsrated>=0.3.0,<0.4). - Attach to your x402 client. Installing does not attach a guard:
from langchain_botsrated import attach_payment_guard
guard = attach_payment_guard(x402_client)
- Omit
presetfor advice only (carefulBuyer/strictstop an unobserved payTo when you pass them). Omitfail_modeto stay open."closed"stops the payment when BotsRated or your policy cannot answer. A missing decision is never a pass. A remote pass never clears a local block.
BOTSRATED_TOKEN is optional. Omit token and the guard reads BOTSRATED_TOKEN. On botsrated 0.3.0 and later it is sent only as remote_policy={"token", "fail_mode"}, never as a bare string. A configured token on a core without parse_remote_policy raises and is not dropped. The policy decision is not signed. Get a token in Desk.
Omit fail_mode and the guard stays open. "closed" stops the payment when BotsRated or your policy cannot answer. A missing decision is never a pass. A remote pass never clears a local block. Nothing defaults you to closed.
LangChain tools for BotsRated. Use them as a pre-payment check before an agent pays an x402 seller.
Status: published on PyPI: langchain-botsrated 0.1.2.
It depends on the botsrated package (source:
integrations/python-core).
pip install langchain-botsrated
| Tool | Cost | Notes |
|---|---|---|
botsrated_preflight |
free | Latest unpaid probe of the seller. With pay_to (+ network, amount) it returns decision.action allow or block and the reasons. A payTo that BotsRated never saw for the host is blocked, with any supported botsrated version (reason payto_not_observed; payto_mismatch with botsrated 0.1.x). |
botsrated_paid_check |
$0.001 USDC on Base (first 25 per client IP per UTC day free) | Only added when the client has a budget. Free-quota answers report charged: false and do not touch the budget. |
from botsrated import BotsRatedClient
from langchain_botsrated import botsrated_tools
tools = botsrated_tools() # free preflight only
# Opt-in paid check, max $0.02 total. x402_client is an x402.x402ClientSync with your signer registered;
# it only ever signs a copy of BotsRated's quote rebuilt from allowlisted fields (no Permit2, no extensions).
tools = botsrated_tools(BotsRatedClient(budget_usd="0.02", x402_client=x402_client))
Opt-in payment guard
pip install langchain-botsrated does not attach a guard. Call attach_payment_guard yourself (needs botsrated>=0.3.0,<0.4). Preflight and the guard are free, no key, rate limits, at https://botsrated.com. A paid check
is $0.001 and stays opt-in on the tool. botsrated_tools() is unchanged: free preflight only.
from langchain_botsrated import attach_payment_guard, botsrated_tools
tools = botsrated_tools() # free preflight only; no guard attached
guard = attach_payment_guard(x402_client, preset="carefulBuyer", fail_mode="open")
# token=... is remote_policy on botsrated 0.3.0+ (see the token paragraph above)
preset is yours: warn (advice only; the default when you omit it), carefulBuyer, or strict (same stops
as carefulBuyer). fail_mode is "open" or "closed"; omit it and the guard stays open. The guard
reports measurements and receipt links. It does not sign a payment and does not hold funds.
x402_client is your x402 client. token is sent as remote_policy on botsrated 0.3.0 and later. A configured token without parse_remote_policy raises and is not dropped.
Tests: pytest tests/unit_tests runs the tool tests and LangChain's ToolsUnitTests.
Metadata
Release files for langchain-botsrated 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| langchain_botsrated-0.1.3.tar.gz | 9.2 kB | With provenance | Details for langchain_botsrated-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| langchain_botsrated-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for langchain_botsrated-0.1.3-py3-none-any.whl |
Total release size: 17.0 kB
Release files / langchain_botsrated-0.1.3.tar.gz
| Download URL | langchain_botsrated-0.1.3.tar.gz |
|---|---|
| Size | 9.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d0632a3454da7aeae8760f283f52c25a824bb976488caa99edadb821930e4ad8
|
|
BLAKE2b-256 checksum How to use checksums |
2bd9642e32ebaf749987cc6147fcfc14400e2d8615814a4d6e406e38fdc2b029
|
| 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 28, 2026.
Transparency logRelease files / langchain_botsrated-0.1.3-py3-none-any.whl
| Download URL | langchain_botsrated-0.1.3-py3-none-any.whl |
|---|---|
| Size | 7.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f2b521adce3ed3590c16577d67b387602617c4d76464d1e93de8a367a8a6490e
|
|
BLAKE2b-256 checksum How to use checksums |
24f600f3bb4f2896bd0b26d0c2675a11092297b59012710cd2a179bc6599e889
|
| 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 28, 2026.
Transparency logSecurity for langchain-botsrated 0.1.3
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
Both files in this release have been uploaded with provenance metadata.
Attestation for langchain_botsrated-0.1.3.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 28, 2026.
Transparency logA 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.