agentleFS
sadrmaneshsadrmanesh/commerce-agent-skills/skills/fraud-and-risk-basics/SKILL.md

fraud-and-risk-basics

Skill1 starsChanged 18 days agoMITView on GitHub

Hold or review risky payments using provider signals, velocity, and 3-D Secure without storing card numbers. Use when adding payment risk checks, a manual review queue, or decline handling for card abuse.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill to decide whether a confirmed payment attempt should capture, wait for review, or be declined.

    line 12
  2. Distinctive:

    Start from the provider's risk recommendation.

    line 17
  3. Distinctive:

    Add only signals you can explain: velocity, address mismatch, and a mismatch between the paid amount and the order.

    line 18
  4. Distinctive:

    Do not put the full card number into the velocity key.

    line 41

≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Fraud and risk basics

Use this skill to decide whether a confirmed payment attempt should capture, wait for review, or be declined. The payment skill still verifies the provider. This skill does not collect card numbers and it does not describe how to test stolen cards.

Procedure

  1. Let the payment provider collect the card. You store the provider payment id, AVS result, CVV result, and 3-D Secure result. You do not store PAN or CVV.
  2. Start from the provider's risk recommendation. Do not replace it with a score you computed from a single field.
  3. Add only signals you can explain: velocity, address mismatch, and a mismatch between the paid amount and the order.
  4. Map the outcome to one action: capture, authorize and review, or do not capture.
  5. A review queue shows the order id, amount, currency, and the signals. A person captures or voids. The queue does not auto-capture because it sat overnight.

Worked examples and checks are in evals/tasks.json.

Actions

SituationAction
Provider says the payment is acceptable and no local rule firedCapture, or accept the provider's capture, through the payment skill.
Provider asks for step-up authenticationSend the shopper through 3-D Secure. Do not capture before it finishes.
AVS or CVV is a mismatch and the amount is above the store's review thresholdAuthorize if the provider allows it, and queue for review. Do not capture yet.
Velocity rule firesSame review path. Do not silently decline every later order from that customer without a reason you store.
Amount, currency, or order id does not matchDo not capture. Follow the payment skill's mismatch rule.
Provider declinesLeave the order unpaid. Keep the cart. Do not retry the charge in a loop.

AVS and CVV are signals. A match is not proof the shopper is the cardholder. A mismatch is not proof of fraud. International addresses often fail AVS. Do not decline every AVS mismatch unless the store has chosen that policy.

Velocity

Count paid and attempted orders by the identifiers you are allowed to store: account id, shipping address hash, and provider customer id. A default worth configuring is more than three payment attempts from one account in ten minutes, or more than two shipping addresses used by one account in one hour. Tune the numbers. Do not present them as measured fraud rates.

Do not put the full card number into the velocity key.

Review queue

  • Store order id, amount, currency, provider payment id, the signals that fired, and the decision.
  • Capture and void go through the payment provider, idempotently.
  • The reviewer's user id is stored with the decision.
  • A shopper-facing page says the payment is being reviewed. It does not say the order shipped.

Gotchas

  • Capturing before 3-D Secure returns loses the liability shift the provider offered. Wait for the result.
  • A client-supplied risk: low field is not a signal. Ignore it.
  • Logging the full webhook body can store a PAN the provider included by mistake. Log ids and result codes.
  • Declining the renewal of every international card will cancel good subscriptions. Use the review path for subscriptions instead of an immediate cancel, unless the store has a written policy.

Verification

  • A mismatched amount is not captured.
  • A 3-D Secure challenge does not capture before the provider reports success.
  • The database and logs for a test payment contain no PAN and no CVV.
  • Two clicks in the review queue do not capture twice.

Evaluation

Worked examples and the checks they must satisfy are in evals/tasks.json.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.