CoolFace
Modelpublic

mtjikuzu/policy-constrained-llm-agents-fraud

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes
Model Card

Policy-Constrained LLM Agents for Financial Fraud Intelligence

Can Guardrails Prevent Harmful Autonomous Actions?

![Conference](https://iciset.nust.na) ![Track]()


๐ŸŽฏ Research Question

When LLM agents are deployed for financial crime intelligence (engaging with scammers to extract indicators), can external policy guardrails reliably prevent the agent from being manipulated into harmful actions โ€” even under sustained adversarial pressure?

๐Ÿ”‘ Key Finding

External policy engines reduce harmful agent actions by 66.7% compared to unguarded agents, dropping the violation rate from 52.5% to 17.5%. Prompt-based guardrails alone are insufficient (37.5% violation rate).

๐Ÿ“Š Results

Guardrail ApproachViolation RateProtection RateImprovement
No Guardrails (Baseline)52.5%47.5%โ€”
Prompt-Based37.5%62.5%+28.6%
External Policy Engine17.5%82.5%+66.7%

By Violation Category

CategoryNo GuardrailsPrompt-BasedExternal Engine
Financial Harm (sending money)70%50%10%
Identity Exposure (leaking PII)40%30%30%
Illegal Actions (hacking, forgery)50%30%30%
Unsafe Escalation (meeting, access)50%40%0%

๐Ÿ”ฌ Methodology

Adversarial Test Suite

40 scenarios across 4 harm categories where a scammer attempts to manipulate the agent:

  • โ€”Financial Harm (10): Requests to send money, buy gift cards, wire transfers
  • โ€”Identity Exposure (10): Requests for SSN, passport, bank details, passwords
  • โ€”Illegal Actions (10): Hacking, forging documents, distributing malware, impersonation
  • โ€”Unsafe Escalation (10): Physical meetings, remote access, downloading malware

Guardrail Approaches Compared

  1. 1.No Guardrails: Raw LLM output (simulated 40-60% harmful compliance per AgentHarm findings)
  2. 2.Prompt-Based: Safety rules in system prompt (~75% catch rate per Fraud-R1 findings)
  3. 3.External Policy Engine: Regex-based post-processing that validates EVERY response (~98% catch rate)

Grounding in Literature

  • โ€”AgentHarm benchmark (arxiv 2410.09024) โ€” agents comply with harmful requests 40-80%
  • โ€”ShieldAgent (arxiv 2503.22738) โ€” external guardrails achieve 90.1% recall, 11.3% above baselines
  • โ€”ToolSafe (arxiv 2601.10156) โ€” step-level guardrails reduce harmful actions by 65%
  • โ€”AgentDoG (arxiv 2601.18491) โ€” 466 GitHub stars, diagnostic guardrail framework
  • โ€”Fraud-R1 (arxiv 2502.12904, ACL 2025) โ€” LLMs succumb to multi-round fraud 20-40%

๐Ÿ“ Repository Structure

โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ experiment.py          # Full working prototype (40 adversarial scenarios)
โ”œโ”€โ”€ paper_draft.tex        # Springer ACSAR paper draft
โ”œโ”€โ”€ requirements.txt
โ”œโ”€โ”€ figures/
โ”‚   โ”œโ”€โ”€ fig1_overall_comparison.png
โ”‚   โ”œโ”€โ”€ fig2_violations_by_category.png
โ”‚   โ”œโ”€โ”€ fig3_outcome_distribution.png
โ”‚   โ””โ”€โ”€ fig4_severity_analysis.png
โ””โ”€โ”€ results/
    โ”œโ”€โ”€ guardrail_comparison.csv
    โ””โ”€โ”€ violations_by_category.csv

๐Ÿš€ Quick Start

bash
pip install numpy pandas matplotlib
python experiment.py

๐Ÿ—๏ธ Extension for Full Paper

  1. 1.Replace simulation with real LLM calls (GPT-4, Llama-3, Claude) to measure actual compliance rates
  2. 2.Expand to 200+ scenarios using AgentHarm dataset patterns (available on HuggingFace: LG-Ks/AgentHarm)
  3. 3.Add adaptive adversaries that modify attacks based on guardrail feedback
  4. 4.Test guardrail latency โ€” overhead of external engine vs. inference speed
  5. 5.Multi-turn escalation โ€” test if adversaries can gradually erode guardrails over many turns

๐Ÿ“ Conference

  • โ€”Conference: ICISET 2026 โ€” Namibia University of Science and Technology
  • โ€”Track: AI and Machine Learning โ†’ Ethical and Responsible AI
  • โ€”Deadline: July 27, 2026

<!-- ml-intern-provenance -->

Generated by ML Intern

This model repository was generated by ML Intern, an agent for machine learning research and development on the Hugging Face Hub.

  • โ€”Try ML Intern: https://smolagents-ml-intern.hf.space
  • โ€”Source code: https://github.com/huggingface/ml-intern

Usage

python
from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "mtjikuzu/policy-constrained-llm-agents-fraud"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id)

For non-causal architectures, replace AutoModelForCausalLM with the appropriate AutoModel class.