ShadowCFO:面向出海OPC的本地优先合规与财务守护Agent。 ShadowCFO的使命很简单:让合规与财务这件事,在 OPC 的世界里变成"零感知"。 你只管 coding 和 build 产品。ShadowCFO 就蹲在你的机器上,在三个最脆弱的时间点自动替你做决定——不是为了替代律师,而是为了让你在收到律师函之前,就已经把问题解决了。最好的合规就是你根本感觉不到它的存在。
| Files | Last commit | Last update |
|---|---|---|
| 5 months ago | ||
| 5 months ago | ||
| 5 months ago | ||
| 5 months ago | ||
| 5 months ago | ||
| 5 months ago | ||
| 5 months ago | ||
| 5 months ago | ||
| 5 months ago | ||
| 5 months ago | ||
| 5 months ago | ||
| 5 months ago | ||
| 5 months ago | ||
| 5 months ago | ||
| 5 months ago | ||
| 5 months ago | ||
| 5 months ago | ||
| 5 months ago |
ShadowCFO
Local-first compliance & finance agent for global indie builders (OPC).
"Agent" means you don't open it. It lives in your git workflow, your payment gateway, your regulation library — and surfaces itself only when you need to know. All business data stays local; AI inference is the sole outbound traffic, never persisted.
Why We Built This
In 2026, over 2 million indie builders ship products globally as OPCs (One Person Companies). Yet compliance remains a luxury they can't afford:
- A single
log.info(user.email)line can violate GDPR Art.5 and trigger a €20M fine - Cross €10,000 in EU B2C digital sales? You're now liable for OSS VAT registration — but nobody told you
- The EU AI Act 2026 amendment just took effect, and your PRIVACY.md still references 2024
Enterprises have legal teams, Stripe Tax subscriptions ($9,500/yr), and compliance consultants ($400/hr). Solo founders have neither the budget nor the bandwidth — and they shouldn't need to.
ShadowCFO exists for one reason: to make compliance invisible for the OPC.
You focus on building and shipping. ShadowCFO sits quietly on your machine, waking up at three critical moments to act on your behalf — not to replace lawyers, but to catch problems before the lawyer's letter arrives. The best compliance is the one you never had to think about.
How We Compare
| Scenario | Stripe Tax | Snyk / GitGuardian | Lawyer / Accountant | ShadowCFO |
|---|---|---|---|---|
| Git compliance audit | ❌ | ✅ $1,800/yr | ✅ $400/hr | ✅ Free |
| Tax threshold tracking | ✅ $9,500/yr | ❌ | ✅ $300/hr | ✅ Free |
| Regulation doc auto-update | ❌ | ❌ | ✅ $500/session | ✅ Free |
| Code/data persistently stored on cloud | Yes | Yes | Yes | No (transmitted for LLM call only, never persisted) |
| Auto-intervention, no manual steps | No | No | No | Yes (3 auto-triggers) |
| All-in-one multi-scenario | Tax only | Code only | Siloed & expensive | Code + Tax + Regulation |
A Day with ShadowCFO
| ☀️ Morning | 🌤 Afternoon | 🌙 Anytime |
|---|---|---|
09:00 Launch, 3-step onboarding wizard (30 s) |
14:00 4th German customer payment |
File watcher auto-detects changes |
09:05 git commit → desktop notification, 2 s later: "Line 3 violates GDPR Art.5 — patch ready" |
Red modal: "EU OSS €10,000 Threshold Crossed!" | notify crate monitors project dir |
| Open violation detail: severity badge / legal ref / reasoning / copy-paste patch | OSS filing draft XML auto-generated | debounce 5 s, batch re-scan changed files |
11:00 3 more commits → all auto-pass (L1 Flash gate) |
Click Chrono → scan EU AI Act → 4-line diff, Apply done | All-day LLM cost: $0.87 |
Screenshots
| Dashboard | Sentinel |
|---|---|
![]() |
![]() |
| Audit Detail | Debug Panel |
|---|---|
![]() |
![]() |
Three Engines
Code Sentinel — your code is audited before the commit lands
The moment you write log.info(user.email), ShadowCFO has already seen it. Not regex — dual-layer LLM legal reasoning.
Mode A · On-Commit Audit (automatic):
git commit
→ pre-commit hook silently captures diff
→ curl POST to local daemon (:8527)
→ L1 Flash gate ($0.0003/call, 1500 tokens) — 99% of commits pass here
→ Suspicious only → wakes L2 Pro ($0.008/call, 16000 tokens) — deep reasoning + legal refs + fix patch
→ Desktop notification with result; commit returns instantly, never blocked
Mode B · Project Watch (automatic):
Add a project and toggle Watch — the notify crate monitors your directory in real time, debounce 5 seconds, auto re-scan changed files, results streamed live to the UI.
Violation detail panel shows:
- Severity badge: 🔴 critical / 🟠 high / 🟡 medium / ⚪ low
- Category: PII_LOGGING / HARDCODED_CREDENTIAL / CONSENT_MISSING / etc.
- Legal refs: Article-level citations (e.g., "GDPR Art.32", "CCPA §1798.100")
- Reasoning: 1-3 sentences explaining the violation
- Patch:
git apply-ready unified diff — copy, paste, fixed
Tax Nexus — you didn't know you owed tax? It tells you
Every time your Stripe or Paddle gateway receives a payment, log it manually — ShadowCFO handles the rest:
- Auto-routing: 30 EU nations B2C digital service → OSS (€10K), US California → EconomicNexus ($500K)
- 365-day sliding window: progress bar climbs in real time, red alert on threshold crossing
- Auto-generates draft: triggers DeepSeek-V4-Flash ($0.0007/call) to produce compliant OSS XML/JSON
Stripe Tax costs $9,500/yr. ShadowCFO replaces it with a $0.0007 API call.
Compliance Chrono — regulation quietly changed? Your docs follow
The EU AI Act 2026 amendment ballooned to 71KB — you shouldn't have to read it:
- Scans local regulation fixtures, auto-detects version deltas
- Gemini-3.1-Pro ingests old text + new text + your PRIVACY.md in a single 2M-token context window
- 4-line surgical diff, unrelated sections byte-for-byte identical — your voice untouched
Architecture
Your Machine
┌────────────────────────────────────────────────────────────────┐
│ Tauri v2 Desktop App │
│ ┌───────────────┐ invoke()/events ┌─────────────────┐ │
│ │ React UI │ ◄────────────────────► │ Rust Backend │ │
│ │ 6 pages 3 ctx │ │ 24 IPC commands │ │
│ └───────────────┘ │ 5 Tauri events │ │
│ └───────┬─────────┘ │
│ ┌───────┴──────────┐ │
│ ┌────────────────────────┐ curl POST │ Axum :8527 │ │
│ │ .git/hooks/pre-commit │ ────────────► │ /sentinel/commit │ │
│ │ (37-line Shell, async) │ fire-&-forget │ /tax/event │ │
│ └────────────────────────┘ │ /chrono/poll │ │
│ └───────┬──────────┘ │
│ ┌──────────────────────┐ │ │
│ │ ~/.shadowcfo/ │ SQLite WAL │ │
│ │ shadowcfo.db (12 tbl)│◄────────────────────────┘ │
│ └──────────────────────┘ │
└──────────────────────────────────┬─────────────────────────────┘
│ HTTPS (sole outbound, never persisted)
▼
┌────────────────────┐
│ GMI Cloud IE API │
│ L1 Flash / L2 Pro │
│ L3 Gemini │
└────────────────────┘
Three-Tier LLM Routing
| Tier | Model | Use Case | Cost/Call | Daily Share |
|---|---|---|---|---|
| L1 Flash | DeepSeek-V4-Flash | 99% traffic (gate + tax form) | $0.0003 | < 1% |
| L2 Pro | DeepSeek-V4-Pro | Suspicious commits only | $0.008 | ~8% |
| L3 Gemini | Gemini-3.1-Pro | Regulation changes only | $0.395 | ~92% |
Average daily cost < $1. Traditional solutions: $8,000+/yr.
Debug Panel
Enable Settings → Debug Mode to unlock the 🐛 tab — real-time color-coded log stream revealing the agent's internal reasoning:
| Color | Label | Content | Purpose |
|---|---|---|---|
| 🟡 | REQ | Incoming hook/scan/tax events | Verify external triggers |
| 🔵 | LLM→ | Prompt sent to LLM (model, length) | Audit prompt quality |
| 🟣 | ←LLM | LLM response (tokens, elapsed, preview) | Verify reasoning output |
| ⚪ | SYS | System state (file collection, DB persist, daemon health) | Trace internal flow |
| 🟢 | FIX | Violation details + suggested patches | Review patch quality |
| 🔴 | ERR | All errors (timeout, rate limit, parse failure) | Troubleshooting |
Open this panel to observe the full agent reasoning pipeline in real time — from external trigger through LLM call, result parsing, to persistence.
Tech Stack
| Layer | Technology |
|---|---|
| Shell | Tauri v2 (Rust) — macOS / Linux / Windows |
| Frontend | React 18 + React Router 6 + Vite 6 + TypeScript 5.6 |
| Backend | Rust — axum 0.7, tokio, rusqlite (bundled SQLite), reqwest (rustls-tls) |
| LLM | GMI Cloud Inference Engine (OpenAI-compatible API, 3-tier model routing) |
| Data | SQLite 12 tables WAL mode + FK constraints |
| i18n | i18next + react-i18next — 47 Keys × EN/ZH-CN |
Quick Start
Prerequisites
- Rust 1.80+ (
rustup) - Bun 1.1+ (
bun) - Git 2.30+
bun install
export GMI_API_KEY="sk-your-key" # or configure in-app via Settings
bun run tauri dev
First Run (OnboardingWizard — 3 steps)
- Enter GMI API Key → validated
- Select your Git project folder → auto-detected as a Git repo
- One-click install pre-commit Hook → done (existing hooks auto-backed up)
Every subsequent git commit appears in Sentinel > Activity > Git Commits, with OS-native notification.
Configuration
| Variable | Default | Description |
|---|---|---|
GMI_API_KEY |
— | GMI API key |
GMI_BASE_URL |
https://api.gmi-serving.com/v1 |
API endpoint |
SHADOWCFO_MODEL_L1 |
deepseek-ai/DeepSeek-V4-Flash |
L1 Flash |
SHADOWCFO_MODEL_L2 |
deepseek-ai/DeepSeek-V4-Pro |
L2 Pro |
SHADOWCFO_MODEL_L3 |
google/gemini-3.1-pro-preview |
L3 Gemini |
SHADOWCFO_PORT |
8527 |
Daemon port |
SHADOWCFO_COST_CAP |
5.0 |
Daily cost cap ($) |
Env vars override
~/.shadowcfo/config.json
Docs · License
| Document | Description |
|---|---|
docs/01-architecture-overview.md |
Full architecture design |
docs/06-gmi-routing-matrix.md |
LLM routing matrix |
MIT License
Introduction
ShadowCFO:面向出海OPC的本地优先合规与财务守护Agent。 ShadowCFO的使命很简单:让合规与财务这件事,在 OPC 的世界里变成"零感知"。 你只管 coding 和 build 产品。ShadowCFO 就蹲在你的机器上,在三个最脆弱的时间点自动替你做决定——不是为了替代律师,而是为了让你在收到律师函之前,就已经把问题解决了。最好的合规就是你根本感觉不到它的存在。
Customize your domain


