Inspiration

I'm a corporate-finance advisor building CFO tooling (MeshCFO, CFO Sentinel). The scariest bugs in finance code don't crash; they round wrong. A float in a forecast or a hard-coded FX rate passes every generic review. I wanted the post-code lifecycle to understand money.

What it does

On every merge request, GitLab CI runs tests, SAST and secret detection, then LedgerGate's deterministic gate scores the diff (float-in-money-path, sensitive-path change, hard-coded secrets, failing tests, SAST findings) and returns BLOCK / NEEDS_APPROVAL / PROMOTE_STAGING. A GitLab Duo custom flow reads the MR, pipeline and gate report, posts one plain-English note for the finance owner with concrete fixes, and opens a remediation issue when blocked. Clean changes deploy to staging automatically; production is a manual, human-approved promotion.

Path: B — Bring Your Own. AI autonomy level: Supervised (agents propose and explain; the deterministic gate decides; humans approve money-path changes and production). Configurable: assisted / supervised / hands-off via LEDGERGATE_AUTONOMY.

How we built it

Python 3.12; Decimal-based 13-week cash-forecast app as the protected product; .gitlab-ci.yml with SAST + Secret-Detection templates, a gate job and staging/production environments; a Duo Agent Platform custom flow (flow registry v1, AgentComponent with MR/pipeline/issue tools); AGENTS.md repo rules.

Challenges we ran into

Keeping the LLM useful but not authoritative: the agent explains and remediates, the deterministic gate decides, humans approve production.

Accomplishments that we're proud of

A complete review→scan→gate→explain→staging→approval loop; the risky sample (float math + FX constant + fake key) is blocked at risk 100/100; clean docs changes go straight to staging.

What we learned

Domain rules beat generic review for regulated code; flows are best when their authority is narrow.

What's next for LedgerGate

Ledger-reconciliation regression tests generated by Duo, Cloud Run deploys (Google Cloud bonus), and policy packs for payments/FX teams.

Links

Built With

  • gitlab
  • gitlab-ci
  • gitlab-duo-agent-platform
  • pytest
  • python
  • sast
  • secret-detection
Share this project:

Updates

Submission history