Anti-Fraud Agent

The Anti-Fraud agent is a prebuilt, ready-to-use solution designed to enhance the security and efficiency of your e-commerce operations.

The Anti-Fraud Agent leverages its built-in functionalities to analyze customer return histories and assess the risk of fraud. Identifying a potential fraud allows for proactive intervention.

Purpose

The purpose of the Anti-Fraud Agent is to solve common business challenges immediately related to its security. As a prebuilt agent, it runs in the background, seamlessly integrating into your existing business workflows. It acts as a fraud returns analyst - it follows a strict evaluation process to provide fraud scores and determine next steps in the case it finds suspicious activities.

Key benefits

Enabling the Anti-Fraud Agent offers many benefits.

Benefit
Description

Proactive threat detection

It proactively detects and responds to suspicious activity, helping to prevent fraudulent transactions or behaviors before they become significant issues.

Enhanced security

By identifying and reacting to fraud attempts, the agent enhances the overall security of your transactions and platform.

Increased efficiency

The agent automates the process of monitoring and responding to suspicious activities, thereby reducing manual work for your team. This allows your business to operate more efficiently.

Improved customer experience

By mitigating fraud, you contribute to a more secure and trustworthy shopping environment for your customers.

Immediate solution

As a prebuilt agent, it offers a ready-to-use solution that can be accessed immediately to address common business challenges. It helps ensure a more secure operation without requiring extensive configuration.

How it works

The Anti-Fraud Agent is capable of undertaking automatic actions when a case is clear (safe or fraudulent). When there is some extent of uncertainty, it initiates a collaboration process involving human users through the Collaboration and Support Agents.

The Agent is programmed to act as follows:

  • Automatic actions:

    • Safe score - When no fraud is discovered, no collaboration and no more actions are taken, and the case is closed.

    • Clear fraud score - When the evident fraud is found, the Agent automatically rejects the customer return.

  • Semi-automatic actions requiring human involvement:

    • Human review - In the case the agent is uncertain about the fraudulent behavior, it initiates human collaboration by the Collaboration Agent.

This setup ensures that only ambiguous cases require manual review, while straightforward cases are resolved automatically.

You can view the exact steps and actions that are predefined for Anti-Fraud Agent type in the Template Prompt field.

Triggers

By default setup, the Anti-Fraud Agent is triggered by commerce events in the Emporix system. The Agent listens to the returns.return-created events in the platform, and whenever such an event is discovered, the Anti-Fraud Agent starts its job to check the return credibility.

Workflow

The Anti-Fraud Agent always follows these strict sequential rules:

1

Fetch return history

The Agent calls the get-returns-by-customer-id tool to retrieve the customer's return history.

2

Calculate and classify the fraud risk

The Agent applies the fraud rules to compute the fraud score using the following formula:

N_total = number of return reports
N_suspicious = number of reports where approvalStatus='CLOSED' and received=false
R = N_suspicious / N_total
FraudScore = min(100, 1 + (R * 100))

Then, it returns the fraud_score as an integer between 1 and 100. The Agent uses the following scale to classify the fraud score:

  • 1–40 → SAFE

  • 41–70 → HUMAN REVIEW

  • 71–100 → FRAUD

3

Take relevant action steps

The next step depend on the fraud classification.

  • SAFE (1–40): No further action, the case ends.

  • HUMAN REVIEW (41–70): The Agent starts collaboration with relevant people through the Collaboration Agent. The Collaboration Agent sets up a Slack channel, adds the case context and creates the Anti-Fraud Agent Context entity. Based on the return details, it fetches the company details and invite company contacts to a Slack channel.

  • FRAUD (71–100): The Agent automatically sets the status of the return to REJECTED.

4

Set context

After computing the fraud score, the Agent calls the set_anti_fraud_context to persist the evaluation.

Collaboration

The Anti-Fraud Agent has a predefined connection to the Collaboration Agent. The Collaboration Agent acts as a handoff agent that works in the background taking care of creating a space for human collaboration on resolving ambiguous fraud scores cases.

Custom Entities

Upon the installation, the Anti-Fraud Agent automatically creates two types of custom entities with corresponding mixin schemas defined:

  • Anti-Fraud Agent Context

  • Support Agent Context

Anti-Fraud Custom Entity

For more information about custom entities, see the Custom Entities.

For more information about mixin schemas, see the Mixin Schemas.

Whenever an agent of the ANTI_FRAUD type comes into action, the instances of these entities are created and stored in the system for the monitoring purposes.

Anti-Fraud Agent Context

Each time an Anti-Fraud Agent is triggered, the system records this event in a created instance of the Anti-Fraud Agent Context. The Context persists the following information:

  • Action summary - Description of what happened and what actions were taken.

  • Automatic - Indicator whether the agent action was automatic or not.

  • Customer ID - The ID of the customer submitting return case.

  • Explanation - The suspicion patterns detected and final assessment for proceeding steps.

  • Fraud score - The calculated score indicating fraud risk.

  • Report date - The date stamp of the anti-fraud report.

  • Return ID - The ID of the return that initiated the anti-fraud process.

Anti-Fraud Agent Context

Support Agent Context

If a Anti-Fraud Agent requires collaboration, an instance of the Support Agent Context is created and stored in the Custom Instances. The Support Agent Context keeps the following information:

  • Collaboration tool used

  • Slack Channel ID created for the suspected fraud case

  • Conversation history

  • Invited participants

Support Agent Context

Contact Info mixin

Additionally, installing the Complaint Agent adds the Contact Info mixin to the Company entity. This mixin stores information about the contacts within a company.

The Collaboration Agent uses the emails from the Company Info to match the company contacts with Slack users and invites them as participants to a collaboration channel.

Company Contact Info

Agent configuration

Fine-tune the Anti-Fraud Agent with the configuration options.

Scopes

You can select the scopes required to trigger the agent. For example, if you want the agent to be triggered by your existing ticketing system, use the Integration scope.

User Prompt

The default prompt for the Anti-Fraud Agent defines the following rules:

<rules>
    <rule>Given a list of return reports, count N_total=all reports and N_suspicious=reports where approvalStatus='CLOSED' and received=false, compute R=N_suspicious/N_total, then FraudScore=min(100,1+(R*100)), return fraud_score as an integer between 1 (no fraud, safe) and 100 (fraud).</rule>
    <rule>Fraud score: 1–40=SAFE</rule>
    <rule>41–70=HUMAN REVIEW</rule>
    <rule>71–100=FRAUD</rule>
    <rule>DO NOT start collaboration for 'SAFE' and 'FRAUD' fraud scores</rule>
    <rule>START collaboration only for 'HUMAN REVIEW' fraud score</rule>
    <rule>When 'FRAUD' is detected then set the status of the return to 'REJECTED'</rule>
</rules>

When creating an agent from the Anti-Fraud Agent template, you can adjust the agent's protocol using the <rules> in the Prompt field. Define the expected behavior of what actions the Agent is to take for each fraud score classification. You can define automatic actions that the agent is able to handle by itself. For more complex or ambiguous use cases that require involving human interactions through the communication tool (for example, Slack), you can define semi-automatic agent actions.

AI Tools

If you want to enable human collaboration options, the Anti-Fraud Agent requires the connection to the Slack AI Tool to work properly. First, create the Slack AI bot in the Agentic AI -> AI Tools.

For more information on how to create a bot, see the AI Tools Management.

Once the Slack AI Tool is ready, establish the connection with the bot by selecting the AI Tool in the Native Tools list.

Slack Tool

This way, the Anti-Fraud Agent can trigger the Support Agent directly within the Slack workspace.

If you don't need collaboration options and would like to define only automatic actions for your Agent, the Slack AI Tool is not necessary.

Last updated

Was this helpful?