Author

Majid Mumtaz FCCA, principal – internal audit and risk advisory, Veritux Consulting Network

Fraud detection is no longer a manual, huntsman’s game. With datasets swelling into the hundreds of thousands of transactions, internal auditors need automated allies that can spot control bypasses and systemic mismanagement. But not all automation frameworks are created equal.

I recently put four approaches to the test – a basic Python script, LangGraph, CrewAI and AutoGen – against the same challenge: screening more than a quarter of a million payment transactions using unsupervised anomaly detection (Isolation Forest), all powered by the same underlying large language model (LLM), DeepSeek.

CrewAI’s output adopted an authoritative, almost prosecutorial tone

Each approach received identical input: a dataset of 284,000 payment records and instructions to apply Isolation Forest to flag anomalous transactions. The goal was to simulate a real-world fraud investigation, identifying indicators of systemic mismanagement, control bypasses and potential collusion.

Tone and persona

The first differentiator was how each framework ‘spoke’ to the audit team:

Python produced the most vanilla output – generic responses that mirrored the prompt’s phrasing. There was no personality, no narrative arc; it simply summarised numbers. Perfect for a data dump, but useless for persuasion.

LangGraph’s output read like a standard Big Four audit report: clinical, procedural and objective. Every finding was couched in neutral, evidence-based language. The system prompts directed the LLM toward disciplined, checklist-style reasoning. The result was a trustworthy but somewhat dry account of anomalies.

CrewAI brought drama. By allowing rich ‘agent backstories’ (a forensic accountant with 20 years of US Securities and Exchange Commission experience, for example), CrewAI’s output adopted an authoritative, almost prosecutorial tone. It aggressively called out ‘willful blindness’ and management override of controls.

Python required meticulous formatting instructions; it felt like a constant battle against chaos

AutoGen stood out for its collaborative, conversational tone, with agents interacting like peers troubleshooting a code bug. AutoGen excels at iterative, technical discussions.

My conclusion? If you need an executive-ready summary that sparks action, CrewAI delivers. For technical debriefs with IT, AutoGen is unrivalled. For formal audit reports, LangGraph is the safe bet.

Formatting and structure

How each framework organised its findings dramatically affected readability:

Python required meticulous formatting instructions. Even then, it would forget indentation, misalign columns or skip bullet points. It felt like a constant battle against chaos.

LangGraph relied on sequential narrative and bulleted lists. Its outputs followed a logical flow: anomaly description → evidence → root cause → recommendation. No frills, but easy to follow.

CrewAI leaned heavily on Markdown tables. Its reports were built around scannable grids for control weaknesses, transaction patterns and risk levels. An audit committee member could skim a CrewAI report in 30 seconds and grasp the top findings.

AutoGen defaulted to less rigid formatting. It favoured continuous conversational blocks, code snippets and technical diagrams expressed in text. It is designed for engineers, not executives.

Overall, CrewAI wins for visual clarity, LangGraph suits report generation and AutoGen is best for deep dives that require code-level detail.

Asking the right questions

Fraud investigations often require targeted interviews – but each framework produced markedly different questions:

Python offered generic questions such as ‘Can you explain this transaction?’ This is useless for precision.

LangGraph provided standard, procedural interrogation questions: ‘What was the authorisation workflow for transaction ID 4873?’ and ‘Who had access to the system at this time?’ It’s thorough, but predictable.

CrewAI changed the game, providing rationale for each target: ‘The finance director is highlighted because they approved 47% of anomalous transactions.’ Then it phrased questions confrontationally: ‘Explain why controls were bypassed for these 47 transactions, provide specific evidence.’ This pressure-test approach forces honesty.

The depth of domain insight varied wildly

AutoGen framed questions as collaborative troubleshooting: ‘Let’s look at the approval sequence for transaction 4873. Does the logic in step 2 account for the missing sign-off?’ It’s less about accusation and more about problem-solving.

My view is that CrewAI is ideal for high-stakes interviews where subjects may be defensive, while AutoGen works better for internal technical reviews.

Insight

The depth of domain insight varied wildly:

Python produced a shallow summary and flagged outliers with no narrative context. It couldn’t explain why an anomaly mattered.

LangGraph focused on the mechanics. It highlighted data points like device fingerprints, IP addresses from known fraud regions and time-of-day clustering to suggest organised external rings. Its analysis read like a police report.

CrewAI focused almost exclusively on governance failure and management override. It tied anomalies to specific policies and named roles, such as ‘VP of Procurement’. The narrative was about systemic failure, not just numbers.

AutoGen concentrated on actionable technical fixes. It generated code snippets to verify data sources, proposed logic corrections for approval workflows and pointed out where the data model broke down. Its focus was iterative debugging of the fraud mechanism.

Overall, I would say that CrewAI exposes cultural and governance issues, LangGraph reveals operational fraud mechanics and AutoGen offers technical remediation paths.

Development effort

Development complexity maps directly to framework capabilities:

Python is perfect for simple, linear pipelines. You can produce a one-pass analysis of 284,000 records with 50 lines of code. But when context windows are exceeded or fact-checking loops are needed, the script breaks down. You cannot retry a specific step or verify an assertion without rewriting the entire code.

LangGraph excels where basic scripts fail. Its explicit state machine control allows for complex, cyclical workflows with retries and verification steps. You can define a node that checks an anomaly, another that cross-references external databases and a third that re-runs Isolation Forest with different parameters, all managed by directed cycles.

Your choice depends on the investigation’s nature and audience

CrewAI is built for multi-agent collaboration with distinct roles. A ‘researcher’ agent hands off flagged transactions to an ‘editor’ agent who formats the report, then a ‘reviewer’ agent who checks for tone consistency. Setting up these roles requires more upfront configuration but the payoff is structured, multi-perspective output.

AutoGen shines when the investigation requires dynamic code execution. Its agents can self-debug Python scripts, execute them and refine based on errors or new data.

The test highlights the tipping point for basic scripts, but LangGraph handles state complexity, CrewAI handles role complexity and AutoGen handles code intelligence.

The right tool

There is no one-size-fits-all automation framework; your choice depends on the investigation’s nature and audience.

Broadly, basic script works for simple, linear, one-off data summarisation tasks. Otherwise, LangGraph is your framework for mapping complex fraud chains, and AutoGen is good for technical deep-dives and remediation programming. Use CrewAI when you need a forceful, executive-level summary produced by a simulated team of collaborating experts. It shines in boardroom presentations where governance failure must be called out.

The future of fraud investigation is not about replacing auditors; it’s about amplifying their capabilities with the right autonomous agents. Choose wisely, and your anomaly detection will never be the same.

Advertisement