Repository navigation
Add Fraud Triage environment: transaction risk-decisioning RL task - #926
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 2ccb2a3. Configure here.
|
Hi everyone, I've addressed the main items and the PR is ready. Could a maintainer please trigger the automated tests? (Note: I already checked the Bugbot output and everything looks good on that end). Thanks for your time! |
|
Thanks! Could you also deploy this space on hugging face for review of the runtime? |
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
|
Runtime review on 0062719: the environment's Dockerfile built successfully, and the packaged server passed health, typed-client reset, a 200-step episode, exact termination, state-counter checks, post-terminal rejection without mutation, and deterministic seeded replay. The temporary container was removed and its absence verified. Image ID: sha256:468241ba1670e4efdeb9e7d682768ac4a6f43256781dcbc86175bed98e640873. This is local container evidence; no Hugging Face Space was published. The 20 focused tests also pass. The docs now state the simplified reward semantics explicitly: FLAG and BLOCK have equal payoff, while ESCALATE adds a cost and provides no extra evidence. |
burtenshaw
left a comment
There was a problem hiding this comment.
Reviewed 0062719. The post-terminal reward bug and current reset/step API incompatibilities are fixed, action values are validated, and seeded resets replay the full observation stream. All 20 focused tests and the packaged Docker server's 200-step typed-client smoke pass, including terminal rejection, state immutability, replay, and container removal. Required dependency lock and docs/catalog entries are present. The simplified FLAG/BLOCK/ESCALATE economics are now documented accurately. No remaining blocker found; no public Hugging Face deployment was performed.
|
Refreshed onto main 07f26b0 after #1198 and wired Rebuilt the actual Dockerfile from this head and verified the packaged app's source hash. The live local container passed health, |
burtenshaw
left a comment
There was a problem hiding this comment.
Reviewed the #1198 integration: FraudTriageState is imported in both package and standalone paths and passed to create_app. Independent validation passed 50 tests; HTTP /schema and /state returned 200 and retained all eight State fields. Touched-file lint passed.
|
Reviewed and validated current head |

Summary
Adds a Fraud Triage environment: a sequential transaction risk-decisioning
RL task where an agent must approve/flag/escalate/block synthetic
transactions. Fills a gap in the existing finance environments (finrl_env
covers stock trading, finqa_env covers document QA) — neither covers
transaction-level risk decisioning.
Type of Change
Alignment Checklist
Before submitting, verify:
.claude/docs/PRINCIPLES.mdand this PR aligns with our principles.claude/docs/INVARIANTS.mdand no invariants are violated/pre-submit-pr(orbash .claude/hooks/lint.shand tests) and addressed all issuesRFC Status
Test Plan
Ran the existing test suite locally:
All 4 tests pass:
Also manually verified end-to-end with a heuristic policy (amount z-score
200-transaction episode, confirming the reward signal and episode
termination behave as intended.
Environment follows existing Gym-style conventions (see connect4_env) —
Pydantic wire types, WebSocket-based client, no MCP tool exposure, rewards
computed entirely server-side inside step().
Claude Code Review
N/A
Note
Low Risk
Self-contained new environment and documentation with synthetic data only; no changes to core OpenEnv runtime, auth, or existing environments.
Overview
Adds a new
fraud_triage_envOpenEnv package for sequential payment fraud triage: agents see one synthetic transaction at a time (risk features only; labels hidden) and choose APPROVE / FLAG / ESCALATE / BLOCK.Server logic streams transactions from a lightweight
TransactionGenerator, scores decisions with asymmetric rewards (heavy penalty for missed fraud, smaller cost for false positives, extra cost for escalate), and tracks episode confusion-matrix stats in state. Wiring follows the usual pattern: Pydantic models,FraudTriageEnvWebSocket client, FastAPI app viacreate_app,openenv.yaml, Docker image, andpyproject.toml.Docs add
fraud_triageto the environments index and toctree, plus a dedicated guide and env README. Tests cover seeded replay, reward/counter behavior, config validation, episode termination, and WebSocket reset/step/state parity with the client parsers.Reviewed by Cursor Bugbot for commit d9e54c5. Bugbot is set up for automated code reviews on this repo. Configure here.