Inspiration

ERP data errors often look small at the source but create large financial consequences downstream. A wrong conversion factor can affect inventory valuation, gross margin, and financial reporting. We wanted to build a system that does more than flag bad data: it should explain the impact, trace the underlying lineage, and help operators resolve the issue safely.

What it does

Arvanta LedgerGuard detects ERP integrity issues and traces their financial blast radius through live DataHub MCP context. It combines deterministic financial calculations with an OpenAI-powered investigation model.

LedgerGuard can:

  • identify the affected ERP data;
  • trace the path from the source field to downstream financial reports;
  • explain the likely root cause and impact;
  • generate an approval-gated remediation plan;
  • execute the correction transactionally;
  • verify the result before marking the incident resolved;
  • write the resolution status back to DataHub.

The system records provenance so reviewers can distinguish live MCP evidence, model source, fallback usage, verification status, and write-back status.

How we built it

We built LedgerGuard with Next.js, TypeScript, PostgreSQL, Drizzle ORM, DataHub, and the Model Context Protocol. The financial-integrity engine is deterministic and calculates the actual business impact. OpenAI is used for investigation narrative and structured explanations, while all remediation actions remain explicitly approval-gated.

The repository includes a demo ERP dataset, DataHub lineage context, runtime judge-mode controls, preflight checks, integration tests, and sanitized proof artifacts. The full proof flow covers:

  1. creating a conversion-factor incident;
  2. investigating it with live MCP context;
  3. creating and approving a remediation plan;
  4. executing the correction;
  5. verifying the restored state;
  6. synchronizing the resolution back to DataHub.

Challenges we ran into

The hardest part was connecting several systems while keeping the result trustworthy. We had to ensure that a missing DataHub or database connection could never appear as a successful investigation.

We added strict runtime policies for judge mode, disabled demo fallback during live evaluation, required live model configuration, rejected non-MCP write-back paths, and removed synthetic activity-log entries from failed runs. We also separated financial calculations from model-generated explanations so the model cannot invent the actual numbers.

Accomplishments that we're proud of

We are proud that LedgerGuard provides an end-to-end, auditable workflow rather than a static AI demo.

Our sanitized live proof demonstrates:

  • datahubSource = LIVE_MCP
  • fallbackUsed = false
  • modelSource = OPENAI
  • remediationState = RESOLVED
  • verificationStatus = PASS
  • datahubWritebackStatus = SYNCED

The activity log contains real MCP and orchestration tool calls, with no synthetic state transitions and no exposed credentials.

What we learned

We learned that trustworthy AI automation requires clear boundaries. Deterministic systems should own financial calculations, while the model should focus on investigation narrative and structured reasoning. Every external action needs provenance, approval, verification, and a safe failure state.

We also learned that operational readiness matters as much as implementation: database, DataHub, model configuration, preflight checks, and documentation all need to work together for a reliable evaluation.

What's next for Arvanta LedgerGuard — ERP Financial Integrity Agent

Next, we plan to expand the system with more ERP error scenarios, broader lineage coverage, stronger production observability, and additional connectors for real accounting and inventory systems.

Our long-term goal is to make LedgerGuard a trusted financial-integrity control layer for ERP operations: fast enough to investigate incidents, transparent enough for auditors, and safe enough for human-approved remediation.

Built With

Share this project:

Updates