Metadata-Version: 2.4
Name: keptvow
Version: 0.3.0
Summary: Check who your AI agent is about to pay before an x402 payment goes out: ok, careful or stop.
Author-email: Keptvow <support@keptvow.com>
License-Expression: MIT
Project-URL: Homepage, https://keptvow.com
Project-URL: Documentation, https://keptvow.com/docs
Keywords: x402,ai-agents,payments,trust,erc-8004,base,usdc
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# keptvow

Check who your AI agent is about to pay **before** an x402 payment goes out.

Every answer is one word — **ok**, **careful** or **stop** — with the reason, built from real
USDC payments on Base (how many different buyers paid the seller, how many came back), reports
from buyers who did or didn't get what they paid for, and daily checks that the seller's
services answer. Free, no sign-up, no key, no dependencies.

```sh
pip install keptvow
```

## Ask about one wallet

```python
import keptvow

result = keptvow.check("0xSELLER", amount_usd=5)
result["verdict"]   # "ok", "careful" or "stop"
result["advice"]    # one plain sentence saying why
```

## Guard every payment (one line)

On the official x402 client (`x402Client` or `x402ClientSync` from the `x402` package):

```python
import keptvow
from x402 import x402Client

client = keptvow.hooks(x402Client())   # then register your schemes as usual
```

The wallet each payment goes to is checked just before the payment is signed. A wallet with a
bad record cancels the payment before any money moves (x402 raises `PaymentAbortedError`, with
Keptvow's reason). The async client's check runs off the event loop. Afterwards that same line
reports in the background whether the paid request came back, so nothing else is needed. Takes
the same options as `guard` below.

## Or wrap your session (one line)

With `requests` or `httpx`, and no x402 client in the picture:

```python
import keptvow, requests

session = keptvow.wrap(requests.Session())   # or httpx.Client(), or httpx.AsyncClient()
```

Every `402 Payment Required` the session gets is checked before anything is paid, and every paid
answer is reported to Keptvow in the background with the status it really got.

## Check one 402 answer yourself

```python
r = session.get(url)
if r.status_code == 402:
    keptvow.guard(r)   # raises keptvow.KeptvowStop for a wallet with a bad record
    # ...go on and pay with your x402 client
```

`guard(r, allow_careful=False)` also blocks wallets with no track record;
`fail_open=False` blocks payment when Keptvow can't be reached. `report_outcomes=False` turns
off the delivery reports in `hooks` and `wrap`.

## Report whether you got what you paid for

`hooks` and `wrap` already do this for you. Doing your own paying:

```python
keptvow.report_outcome(paid_response)          # reads the PAYMENT-RESPONSE receipt
keptvow.report_outcome("0xTX", delivered=False) # or name the payment yourself
```

Each payment is reported once, so mixing these is fine.

Sent in the background and never raises. Keptvow checks the payment on-chain, so only real
buyers count. Every verdict your agent gets back is built from reports like these: it is how a
seller that takes the money and delivers nothing turns to stop, before it costs your next task.

Set `KEPTVOW_URL` to use another Keptvow address.

## Other ways in

No package needed: `GET https://keptvow.com/v1/check?pay_to=0x…&amount_usd=5`, an MCP server at
`https://keptvow.com/mcp`, and a guide for AI agents at <https://keptvow.com/llms.txt>. Everything
else: <https://keptvow.com/docs>.
