pay-safely
Check that a seller is safe to pay before your AI agent pays.
pay-safely asks Screwtape.ai one question at the moment your agent is about to pay: is this seller safe to pay? You get back allow, review or block, with reasons and a signed receipt you can verify later.
It has no required dependencies and drops into LangChain, LangGraph, CrewAI, the OpenAI Agents SDK and AgentKit.
What the check looks at
- The price and payee the seller asks for, compared with what the seller has published.
- The payee against a denylist and a sanctions list.
- Whether the amount is far above what your agent intended to pay.
- Whether the same payment was already made.
- Whether the seller URL answers with a valid payment request.
If the check cannot confirm something, it says review, not allow. If it cannot run at all (network error, timeout), this package stops the payment by default.
Install
pip install screwtape-pay-safely
# plus the extra for your framework:
pip install "screwtape-pay-safely[langchain]" # LangChain and LangGraph
pip install "screwtape-pay-safely[crewai]"
pip install "screwtape-pay-safely[openai-agents]"
pip install "screwtape-pay-safely[agentkit]"
Use it in plain Python
from pay_safely import PaySafely, PaymentBlocked, NeedsReview
guard = PaySafely(agent_id="my-agent") # 3 free checks a day, no key
try:
verdict = guard.require_safe("https://seller.example/pay", amount=0.05)
except PaymentBlocked as err:
print("Do not pay:", err)
except NeedsReview as err:
print("Ask a person first:", err)
else:
print("OK to pay. Receipt:", verdict.receipt_id)
# ... make your payment here ...
Or wrap your payment function:
@guard.protect(seller_url=lambda url, usd: url, amount=lambda url, usd: usd)
def pay(url, usd):
...
LangChain and LangGraph
from pay_safely import PaySafely
from pay_safely.langchain import seller_check_tool, guard_tool
guard = PaySafely(agent_id="my-agent")
tools = [
seller_check_tool(guard), # the agent can ask "is this seller safe?"
guard_tool(my_payment_tool, guard, seller_url_arg="url", amount_arg="usd"), # runs only on allow
]
CrewAI
from pay_safely import PaySafely
from pay_safely.crewai import SellerCheckTool
buyer = Agent(role="Buyer", goal="Buy safely", backstory="...", tools=[SellerCheckTool(guard=PaySafely(agent_id="buyer"))])
OpenAI Agents SDK
from agents import Agent, function_tool
from pay_safely import PaySafely
from pay_safely.openai_agents import seller_check_tool, payment_guardrail
guard = PaySafely(agent_id="buyer")
pay = function_tool(pay_seller, tool_input_guardrails=[payment_guardrail(guard, "url", "usd")])
agent = Agent(name="Buyer", tools=[seller_check_tool(guard), pay])
AgentKit
from pay_safely import PaySafely
from pay_safely.agentkit import pay_safely_action_provider
# add to the action_providers list in your AgentKit config
provider = pay_safely_action_provider(PaySafely(agent_id="buyer"))
Free checks, keys and paid use
| Checks | |
|---|---|
| No key | 3 free a day |
| Free API key | 10 free a day. Get one at https://screwtape.ai/v1/signup and pass PaySafely(api_key="...") |
| After that | $0.005 per check. See https://screwtape.ai/llms.txt for how an agent pays per call. Pass your own payment-capable HTTP client with transport= |
When the free checks run out, check() raises DailyLimitReached with the link to get a free key.
Options
| Option | Default | Meaning |
|---|---|---|
fail_open |
False |
If True, a check that cannot run lets the payment go ahead. |
allow_review |
False |
If True, a review verdict does not stop the payment. |
timeout |
10.0 |
Seconds to wait for the check. |
transport |
built in | Your own function to send the request. |
Limits
This is a second opinion, not a guarantee. The check advises and records. Your code decides whether to pay, and the check cannot stop a payment your code makes anyway. It does not hold funds.
Verify a receipt
Every answer includes a receipt_id and verify_url. Verify it for free at https://screwtape.ai/verify/.
Develop
pip install -e ".[test]"
pytest
Support
support@screwtape.ai · https://screwtape.ai
MIT license.
Metadata
Release files for screwtape-pay-safely 0.1.0
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 |
|---|---|---|---|---|
| screwtape_pay_safely-0.1.0.tar.gz | 10.2 kB | With provenance | Details for screwtape_pay_safely-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| screwtape_pay_safely-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for screwtape_pay_safely-0.1.0-py3-none-any.whl |
Total release size: 22.4 kB
Release files / screwtape_pay_safely-0.1.0.tar.gz
| Download URL | screwtape_pay_safely-0.1.0.tar.gz |
|---|---|
| Size | 10.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3475ff9422dd7224cfd35dc658bf4726319e144b905bf38b5ed6f1ef0da402e4
|
|
BLAKE2b-256 checksum How to use checksums |
f7da216137b68e8047114d59d66fead570d6982a71878ae3d7b9d0f5ed0df32e
|
| 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 Nov 15, 2026.
Transparency logRelease files / screwtape_pay_safely-0.1.0-py3-none-any.whl
| Download URL | screwtape_pay_safely-0.1.0-py3-none-any.whl |
|---|---|
| Size | 12.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d01ab84472fd6967c140f07f22153381c11177eafa92fc2fc3a5e3da601fca12
|
|
BLAKE2b-256 checksum How to use checksums |
94b13ef4f8697b743870c5d55e8f3bfcb5bbc9c44eb879919516d8e64c50c31a
|
| 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 Nov 15, 2026.
Transparency logSecurity for screwtape-pay-safely 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
Both files in this release have been uploaded with provenance metadata.
Attestation for screwtape_pay_safely-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 15, 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.