For the complete documentation index, see llms.txt. This page is also available as Markdown.

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 template creates three collaborating generic agent instances:

Instance
Role

Anti-Fraud Scoring

Calculates and classifies the fraud score.

Anti-Fraud Agent

Applies score-based actions, starts collaboration when human review is required, and assigns the Support Agent to the channel.

Anti-Fraud Audit

Persists records of each fraud case in the ANTI_FRAUD_AGENT_CONTEXT with all the relevant details. If collaboration is required, it also creates a record in the SUPPORT_AGENT_CONTEXT.

These instances collaborate with each other as a team. The flow can undertake 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 Support Agent.

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 - If the agent is uncertain about fraudulent behavior, it starts collaboration and assigns the Support Agent to the channel.

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

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 Anti-Fraud Scoring is responsible for applying the fraud rules to compute the fraud score using the following formula:

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 depends on the fraud classification.

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

  • HUMAN REVIEW (41–70): The Agent fetches the required data and starts collaboration. It creates a dedicated Slack or MS Teams channel (or group chat), invites company contacts, and posts a case message. After the channel is created, it assigns the Support Agent to the channel. Participants can then communicate with the Support Agent in that channel. These actions run through the attached communication tool and its Allowed operations.

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

4

Set context

After the action steps, Anti-Fraud Audit persists the evaluation in the Anti-Fraud Agent Context. If collaboration was started, it also creates the Support Agent Context.

Collaboration

The Anti-Fraud Agent template instances (Anti-Fraud Audit, Anti-Fraud Scoring, and Anti-Fraud Agent) are predefined to collaborate with each other. When human involvement is required for ambiguous fraud scores, the Anti-Fraud Agent fetches the required data, starts collaboration (creates the channel, invites participants, and posts a message), and assigns the Support Agent to the channel. Anti-Fraud Audit then persists the Anti-Fraud Agent Context and, if collaboration was started, the Support Agent Context. Participants use the channel to communicate with the Support Agent.

Custom entities

Upon the installation, the Anti-Fraud Agent template 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 the Anti-Fraud Agent flow comes into action, the instances of these entities are created and stored in the system for monitoring purposes.

Anti-Fraud Agent Context

Each time an Anti-Fraud Agent flow is triggered, the Anti-Fraud Audit 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 an Anti-Fraud Agent flow requires collaboration, Anti-Fraud Audit creates a Support Agent Context instance and stores it in the Custom Instances. The Support Agent Context keeps the following information:

  • Collaboration tool used

  • Slack or MS Teams Channel ID created for the suspected fraud case

  • Conversation history

  • Invited participants

Support Agent Context

Contact Info mixin

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

The Anti-Fraud Agent uses the details from the Contact Info mixin to invite company contacts as participants to a collaboration channel. Invitation depends on the attached communication tool and its Allowed operations.

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 User Prompt is editable. The default prompt for the Anti-Fraud Agent defines the following rules:

Default User Prompt for Anti-Fraud Agent

When creating an agent from the Anti-Fraud Agent template, you can adjust the agent's protocol using the <rules> in the User 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 (Slack or MS Teams), you can define semi-automatic agent actions.

AI Tools

If you want to enable human collaboration options, the Anti-Fraud Agent flow requires the connection to the Slack AI Tool or MS Teams AI Tool on the Support Agent. First, create the communication tool bot in the Agentic AI -> AI Tools.

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

Once the communication tool is ready, establish the connection with the bot by selecting the right AI communication tool in the Native Tools. Channel creation depends on the tool's Allowed operations.

Slack Tool

This way, the Anti-Fraud Agent can hand off to the Support Agent, which acts directly within the Slack workspace or MS Teams team.

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

The capabilities of the Anti-Fraud Agent require MCP server tools. Upon creation, the agent is equipped with the tools for Customer and Order entities management.

Default toolset for Anti-Fraud Agent:

Tool
Capabilities

Customer MCP Tools

get-customer

Retrieves customer details.

get-legal-entity

Fetches details of a specific legal entity.

Order MCP Tools

get-order

Retrieves a specific order.

get-return

Retrieves details of a specific return.

change-return-status

Changes the status of the return.

Default toolset for Anti-Fraud Scoring:

Tool
Capabilities

Order MCP Tools

get-return

Retrieves details of a specific return.

get-returns-by-customer-id

Retrieves the customer's return history.

Default toolset for Anti-Fraud Audit:

Tool
Capabilities

Extensibility MCP

upsert-custom-type-instance

Required for handling custom entities and collaboration contexts.

Extend or limit the tools according to your needs in the Tools tab by adding or removing the tools from the list.

All Agents operations are tracked in the AI Logs view. You can check the details of the requests, jobs, and sessions for monitoring and evaluation purposes. For more information, see the AI Logs.

Last updated

Was this helpful?