Skip to content

Commit 618b46d

Browse files
committed
docs: add regulated-industries guide (#44)
2 parents 333e1db + 5cc0464 commit 618b46d

File tree

1 file changed

+76
-0
lines changed

1 file changed

+76
-0
lines changed

docs/regulated-industries.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Regulated Industries
2+
3+
## The Structural Fit
4+
5+
Most regulated industries share three properties:
6+
7+
1. **Maker-checker controls** — no person can both create and approve the same work product
8+
2. **Audit requirements** — every action must be attributable, timestamped, and retrievable
9+
3. **Exception workflows** — deviations from expected outputs must be flagged, investigated, and resolved with a documented rationale
10+
11+
Git workflows have the same three properties, structurally:
12+
13+
| Financial / Regulated Control | Git Equivalent | How It Works |
14+
|---|---|---|
15+
| Maker-checker approval | Pull request merge | Agent (maker) opens PR; human reviewer (checker) approves before merge |
16+
| Audit trail | `git log` | Every action is a commit — immutable, timestamped, attributable to the agent |
17+
| Segregation of duties | Branch protection | Agent cannot merge its own branch; reviewer role is enforced by branch rules |
18+
| Control documentation | `RULES.md` | Agent's constraints are in version control, reviewed, and auditable |
19+
| Point-in-time snapshot | `git tag` | Signed-off state of work is a tag on main — `v2025-01-close`, `v2025-Q1-audit` |
20+
| Exception log | Exception commits + PR comments | Unresolved items are committed as exceptions; resolution is recorded on the PR |
21+
| Institutional knowledge | `memory/MEMORY.md` | Prior resolutions, patterns, and context survive personnel changes |
22+
23+
This isn't an analogy. These are isomorphisms. Which means a gitagent-standard agent operating inside a git repo doesn't just *comply with* regulated-industry controls — it *is* the control framework, by construction.
24+
25+
The consequence: compliance overhead drops to zero marginal cost. It's a property of the architecture, not a separate documentation layer.
26+
27+
---
28+
29+
## When This Fit Is Strongest
30+
31+
The structural fit is strongest when all three of the following are true in your domain:
32+
33+
- Work products are **recurring** (monthly, quarterly, annually) — not one-off
34+
- The same **exception patterns** appear repeatedly across periods and can be learned from
35+
- There is a **clear separation** between the person who does the work and the person who approves it
36+
37+
Domains where this applies:
38+
39+
| Domain | Recurring Workflow | Exception Pattern | Maker-Checker Gate |
40+
|---|---|---|---|
41+
| Financial close | Monthly reconciliation, variance analysis | Bank exceptions, cutoff errors, GL mismatches | Controller review of workpapers |
42+
| Legal / contracts | Contract review, clause extraction, obligation tracking | Non-standard terms, missing clauses | Partner or GC sign-off |
43+
| Healthcare compliance | Coding audits, claims review, prior authorizations | Upcoding flags, missing documentation, denial patterns | Medical director review |
44+
| Insurance underwriting | Risk assessment, policy review, exposure analysis | Out-of-appetite risks, concentration flags | Senior underwriter approval |
45+
| Regulatory reporting | Form preparation, data validation, submission review | Calculation errors, missing fields, threshold breaches | Compliance officer sign-off |
46+
47+
---
48+
49+
## Reference Implementation: GitClose
50+
51+
[GitClose](https://github.com/Priyanshu-Priyam/gitclose) is a working implementation of this pattern for the CFO office — specifically the monthly financial close.
52+
53+
Three gitagent-standard agents perform the mechanical work of a January 2025 close for Meridian Engineering Pty Ltd:
54+
55+
- **Atlas** (`agents/atlas-cash-recon/`) — reconciles 23 bank transactions against the GL, finds a $14,924 exception, retrieves the resolution from memory (PR #641, October 2024), and opens a PR with the reconciliation workpaper
56+
- **Nova** (`agents/nova-ap-recon/`) — traces 47 AP invoices to GL postings by reference, catches a $5,200 ARUP-7795 cutoff error in 27 seconds, flags it with a proposed reversing JE
57+
- **Echo** (`agents/echo-variance/`) — computes budget vs actuals for all P&L lines, generates management commentary with every explanation attributed to data or memory
58+
59+
Every agent action is a git commit. Every approval is a merged PR. The git history is the complete audit trail. No separate documentation. No evidence filed after the fact.
60+
61+
The architecture for other regulated domains is identical — only the tools and skill files change. The agent standard, git workflow, and compliance properties stay the same.
62+
63+
---
64+
65+
## Extending to a New Domain
66+
67+
To apply this pattern to a domain other than financial close:
68+
69+
1. **Define the recurring workflow** — what work is done on each cycle? What are the inputs and expected outputs?
70+
2. **Enumerate exception types** — what deviations need to be flagged, investigated, and resolved? These become `create_exception` tool calls.
71+
3. **Identify the maker-checker boundary** — who does the work, and who approves it? The agent is the maker; the human reviewer approves the PR.
72+
4. **Write the skill file**`skills/<domain>/SKILL.md` contains the step-by-step procedure, matching rules, and escalation criteria
73+
5. **Set `RULES.md` guardrails** — what can the agent never do? (e.g. `cannot: approve_own_work`, `cannot: modify_source_data`)
74+
6. **Seed MEMORY.md** — known patterns from prior cycles can be loaded at the start; the agent appends new patterns after each run
75+
76+
The git layer, agent runtime, hook system, and PR workflow require no modification. The domain-specific knowledge lives entirely in `skills/`, `SOUL.md`, `RULES.md`, and `memory/MEMORY.md`.

0 commit comments

Comments
 (0)