Skip to main content

fraud-review-bedrock

A fraud-review agent for card alerts. It reads each alert, clears only what a written policy allows, and sends everything else to a person with its reasons beside the evidence. It has no tool that can block a card or contact a customer, and every step is written to a hash-chained audit log. It runs on Claude through the Claude API or Amazon Bedrock, and all the data is simulated.

Two Claude models do the reading: a small one screens each alert and a larger one reviews what the first will not clear. A rule written in code, not the model, decides whether a clear is allowed.

The result (simulated data)

The safety bar is that the agent auto-clears no fraud.

  • The first frozen run failed. It leaked 2 of 79 frauds (simulated data). That run stays in the record.
  • One policy change followed: never auto-clear a purchase made at night. It was chosen on a separate 100-alert development set, not on the run that failed.
  • On a fresh set of 500 alerts the bar held. The agent auto-cleared 0 of 55 frauds. The exact 95% upper bound is 5.3% (simulated data), so 55 frauds is a small sample.
  • It auto-cleared 8.8% of alerts (44 of 500, simulated data), and all 44 were legitimate. The night rule cost automation: the rate was 36.8% before it (simulated data).
  • Model spend was about $6.24 per 1,000 alerts (simulated data).
  • The reasons are checkable in part. All 1,098 checkable numbers in them were true (simulated data). The faithfulness check is a single-judge partial result, with 48.0% of judged claims supported, and it is not calibrated (simulated data).

This is a demonstration. It is not validated for real use. Read the case study and the PR/FAQ for the limits.

Walkthrough of the key screens (simulated data): the architecture, the analyst review screen, the audit log and five dashboard panels

The results dashboard

The analyst review screen, one case

The analyst review screen, the audit log

The architecture: what ran, what is supported but did not run, and a proposed pilot

Quickstart

You need Python 3.12 and uv. Steps 1 to 4 need no key and make no model call.

1. Install

git clone https://github.com/biplob819/fraud-review-bedrock
cd fraud-review-bedrock
uv sync --locked

2. See it work with no keys

Render the results dashboard from the committed example run. This reads no key and reaches no network. It writes report.html, which you open in a browser.

uv run fraud report --example

Then run the replay demo of the analyst screen. It replays recorded cases and calls no model.

uv sync --locked --extra demo
uv run streamlit run demo/app.py

3. Check your setup

uv run fraud doctor --offline

This checks Python, the run config, the prices and the credentials you have, without the network. It never prints a secret. Run uv run fraud doctor without --offline once you have set a key or a profile, to check the provider and the models.

4. Estimate before you spend

uv run fraud triage --split dev --alerts 100 --dry-run

A dry run makes no call. It prints the calls and the estimated cost, then stops. The spend cap is the max_cost_usd value in config.yaml (there is no flag for it). A run whose estimate is over the cap will not start, and a run that reaches the cap stops and can be resumed. See Control cost.

5. Run with your own Claude API key

cp .env.example .env     # then put your key in ANTHROPIC_API_KEY; never commit .env
uv run fraud doctor
uv run fraud load        # downloads the simulated source data; needs a Kaggle token
uv run fraud baseline    # builds the alert samples
uv run fraud triage --split dev --alerts 20

Start with a small number of alerts. To use your own alerts instead of fraud load and fraud baseline, see Bring your own alert data. To use your own rules, see Write your own policy.

6. Run on Amazon Bedrock

Bedrock is supported through the in-Region Mantle endpoint. It was not run for the published results, which used the Claude API, so treat this path as untested here.

  1. In config.yaml, set provider: bedrock, set region to a Region where you have model access, and use the Bedrock model ids (for example anthropic.claude-haiku-5-5 and anthropic.claude-sonnet-5-5).
  2. Sign in with your AWS profile, for example export AWS_PROFILE=<your profile>. No key goes in the project.
  3. Run uv run fraud doctor, then uv run fraud triage --split dev --alerts 20 --dry-run, then the same command without --dry-run.

prices.yaml has a table for each provider. Check the Bedrock prices before you rely on the estimate.

Guides

What is planned, and what is not

  • A hosted demo is planned for v0.2. In this release the demo runs only on your machine.
  • There is no video.
  • The package is not on PyPI. Releases attach a wheel and a source archive on GitHub. Run the project from a clone: the wheel and the source archive do not carry config.yaml, policy.md, prices.yaml or the demo, so they are not a standalone install.

Data and credits

All data is simulated. See NOTICE for the Sparkov simulator and Amazon's Fraud Dataset Benchmark, and DATA_CARD.md for how the data is loaded. No data file is committed; you download it yourself with fraud load.

Contributing and security

See CONTRIBUTING.md, SECURITY.md and the Code of Conduct. To work on the build itself, uv run python scripts/status.py shows where each part stands.

Licence

MIT. See LICENSE.

Metadata

Release files for fraud-review-bedrock 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fraud-review-bedrock 0.2.0
File Size Uploaded Provenance Actions
fraud_review_bedrock-0.2.0.tar.gz 144.6 kB With provenance Details for fraud_review_bedrock-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fraud-review-bedrock 0.2.0
File Interpreter ABI Platform Actions
fraud_review_bedrock-0.2.0-py3-none-any.whl Python 3 none any Details for fraud_review_bedrock-0.2.0-py3-none-any.whl

Total release size: 300.9 kB

Release files / fraud_review_bedrock-0.2.0.tar.gz

Download URL fraud_review_bedrock-0.2.0.tar.gz
Size 144.6 kB
Tags Source
SHA-256 checksum
How to use checksums
e39d825b6f498c76f1b5a2dfb13d39f075d6c2ddcbcddc61459e3a955dfdec95
BLAKE2b-256 checksum
How to use checksums
bcc8e7abe8c28a808ab1d8105f78059e65274c6019d3bad940a16d80ecac48da
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 19, 2026.

Transparency log

Release files / fraud_review_bedrock-0.2.0-py3-none-any.whl

Download URL fraud_review_bedrock-0.2.0-py3-none-any.whl
Size 156.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3d475157ab778427888119750c3bf0a5c71be6cfaaa034d6f0f50b3bfe53a5a7
BLAKE2b-256 checksum
How to use checksums
012bb5482f88e5a3b2f8665bf8e999767d12b77160f0a6e607230aefceea43b0
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 19, 2026.

Transparency log

Security for fraud-review-bedrock 0.2.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.

Select from 2 files

Attestation for fraud_review_bedrock-0.2.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 19, 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.2.0 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