Skip to main content

botsrated-openai-agents

One-click attach

Free. No key for local attach. Pairs with the host runtime. Not a second runtime. Published on PyPI. Paid checks are not required to attach.

pip install botsrated-openai-agents
from botsrated_openai_agents import attach_payment_guard
guard = attach_payment_guard(x402_client)  # omit preset = advice; omit fail_mode = open

Preflight and the guard surface signed receipt links (receipt_url). When org ledger is enabled, paid checks write there by default. No custody. Facts, not grades.

Attach is pair-with. Free. No key for local attach. Not a second runtime.

Live docs: botsrated.com/docs/guard#openai-agents.

Default install

Free. No key for local attach. Pairs with the OpenAI Agents SDK. Payment-client hook only: it does not replace Agent or Runner. The guard is not a runtime. Published: pip install botsrated-openai-agents (PyPI 0.1.1; dependency botsrated>=0.3.1,<0.4). Installing does not attach a guard. Paid checks are not required to attach. Optional BOTSRATED_TOKEN for Desk remote policy (omit token and the guard reads the env).

# Free. No key for local attach. Not a runtime.
# Optional BOTSRATED_TOKEN for Desk remote policy.
from botsrated_openai_agents import attach_payment_guard
# Omit preset = advice. Omit fail_mode = open.
guard = attach_payment_guard(x402_client)

Install in 3 steps

  1. Free. No key for local attach. Install: pip install botsrated-openai-agents (PyPI 0.1.1, includes attach_payment_guard). Depends on botsrated>=0.3.1,<0.4. Paid checks are not required to attach.
  2. Attach to your x402 client. Installing does not attach a guard:
from botsrated_openai_agents import attach_payment_guard
guard = attach_payment_guard(x402_client)
  1. Omit preset for advice only (carefulBuyer / strict stop an unobserved payTo when you pass them). Omit fail_mode to 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.

OpenAI Agents SDK hook for BotsRated. Use it as a pre-payment check before an agent pays an x402 seller. You keep the SDK's Agent and Runner.

Status: published on PyPI: botsrated-openai-agents 0.1.1 (this release; includes attach_payment_guard). Depends on botsrated >=0.3.1,<0.4 (source: integrations/python-core). PyPI 0.1.1 matches that pin. Omit token and attach_payment_guard reads BOTSRATED_TOKEN.

pip install botsrated-openai-agents

Contributors in a checkout of this repository can install this tree with pip install -e integrations/openai-agents. The published install is pip install botsrated-openai-agents.

Opt-in payment guard

pip install botsrated-openai-agents does not attach a guard. Call attach_payment_guard yourself (depends on botsrated>=0.3.1,<0.4). Preflight and the guard are free, no key, rate limits, at https://botsrated.com. botsrated_preflight_tools() is unchanged: free preflight only.

from botsrated_openai_agents import attach_payment_guard, botsrated_preflight_tools

free = botsrated_preflight_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.

Behavior

This is the OpenAI Agents SDK mirror of LangChain attach_payment_guard (PR #14). You keep the SDK's Agent and Runner. The hook is the x402 client those paid calls already use:

from agents import Agent, Runner
from botsrated_openai_agents import attach_payment_guard

guard = attach_payment_guard(x402_client)
# Omit token and the guard reads BOTSRATED_TOKEN. Agent and Runner stay the SDK's.
Argument Omit Set
preset Advice only (warn). An unobserved payTo is reported and the payment is not stopped. warn (same advice), carefulBuyer, or strict. carefulBuyer and strict are the same stops: an unobserved payTo, an invalid payTo, a host mismatch, or an unknown paid URL blocks. strict is passed as that policy table because PaymentGuard preset names are warn, carefulBuyer, and dry-run-only.
fail_mode 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. "open" or "closed". Nothing defaults you to closed.
token Reads BOTSRATED_TOKEN when it is set. Unset sends nothing extra. An explicit token wins over BOTSRATED_TOKEN. On botsrated 0.3.0 and later it is sent only as remote_policy={"token", "fail_mode"}. A configured token without parse_remote_policy raises and is not dropped. The policy decision is not signed. Get a token in Desk.

The guard's lookup is the free preflight at https://botsrated.com (host name only). It does not sign a payment, does not custody funds, and does not add a payment-creation-failure hook. The client enforces a block by honoring the x402 AbortResult from on_before_payment_creation. Tell the guard which URL is being paid with guard.request(url) or guard.wrap_get on that client, the same way PaymentGuard documents it.

Optional free preflight tools

botsrated_preflight_tools() returns a free HTTP preflight callable and https://botsrated.com/mcp. It does not attach a guard. Same rule as botsrated_tools() in the LangChain package.

from agents import Agent, function_tool
from botsrated_openai_agents import botsrated_preflight_tools

free = botsrated_preflight_tools()
agent = Agent(
    name="buyer",
    instructions="Look up the seller with the free preflight tool before paying.",
    tools=[function_tool(fn) for fn in free.http],
)
# free.mcp_url is the hosted MCP server. Add it with the SDK's MCP client if you want it.
# The guard is still a separate attach_payment_guard(x402_client) on the payment client.

Tests: pytest -m "not live" in this directory.

Metadata

Release files for botsrated-openai-agents 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 botsrated-openai-agents 0.1.1
File Size Uploaded Provenance Actions
botsrated_openai_agents-0.1.1.tar.gz 9.9 kB With provenance Details for botsrated_openai_agents-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for botsrated-openai-agents 0.1.1
File Interpreter ABI Platform Actions
botsrated_openai_agents-0.1.1-py3-none-any.whl Python 3 none any Details for botsrated_openai_agents-0.1.1-py3-none-any.whl

Total release size: 18.2 kB

Release files / botsrated_openai_agents-0.1.1.tar.gz

Download URL botsrated_openai_agents-0.1.1.tar.gz
Size 9.9 kB
Tags Source
SHA-256 checksum
How to use checksums
e421131c95d8c3f489a2761dd8cde04de0d4ec083816209d3c59b80a743c4fe2
BLAKE2b-256 checksum
How to use checksums
3d18e0488f44a9e441e95b823a43cefc9c778b96490d59e9bb16cebbb0467637
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 30, 2026.

Transparency log

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

Download URL botsrated_openai_agents-0.1.1-py3-none-any.whl
Size 8.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4f0b03c117f387d0bfde5c14484aae59e4d007082119c6d07c83be69720f78bd
BLAKE2b-256 checksum
How to use checksums
ecf5c0a5112f55972a812f27651facd1c83bce7d7699f688546a9644746afed8
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 30, 2026.

Transparency log

Security for botsrated-openai-agents 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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for botsrated_openai_agents-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 30, 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