Skip to content

Commit 76ff2db

Browse files
patel-lyzrclaude
andcommitted
feat: add SOD examples, DUTIES.md files, and README documentation
- examples/full/agent.yaml: segregation_of_duties config with analyst, reviewer, and auditor roles - examples/full/DUTIES.md: root-level SOD policy (roles, conflicts, handoffs, isolation, enforcement) - examples/full/agents/fact-checker/DUTIES.md: per-agent role declaration - examples/full/compliance/regulatory-map.yaml: duty_segregation mapping - README.md: SOD pattern section, updated directory tree, compliance docs Part 4 of 4 — depends on feat/sod-3-adapters Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent ec8dbcd commit 76ff2db

File tree

5 files changed

+187
-3
lines changed

5 files changed

+187
-3
lines changed

README.md

Lines changed: 52 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Every AI framework has its own structure. There's no universal, portable way to
1818

1919
- **Git-native** — Version control, branching, diffing, and collaboration built in
2020
- **Framework-agnostic** — Export to any framework with adapters
21-
- **Compliance-ready** — First-class support for FINRA, Federal Reserve, and SEC regulatory requirements
21+
- **Compliance-ready** — First-class support for FINRA, Federal Reserve, SEC, and segregation of duties
2222
- **Composable** — Agents can extend, depend on, and delegate to other agents
2323

2424
## The Standard
@@ -34,6 +34,7 @@ my-agent/
3434
3535
│ # ── Behavior & Rules ──────────────────────────────────
3636
├── RULES.md # Hard constraints, must-always/must-never, safety boundaries
37+
├── DUTIES.md # Segregation of duties policy and role boundaries
3738
├── AGENTS.md # Framework-agnostic fallback instructions
3839
3940
│ # ── Capabilities ──────────────────────────────────────
@@ -58,7 +59,8 @@ my-agent/
5859
├── agents/ # Sub-agent definitions (recursive structure)
5960
│ └── fact-checker/
6061
│ ├── agent.yaml
61-
│ └── SOUL.md
62+
│ ├── SOUL.md
63+
│ └── DUTIES.md # This agent's role, permissions, boundaries
6264
├── examples/ # Calibration interactions (few-shot)
6365
6466
│ # ── Runtime ───────────────────────────────────────────
@@ -76,6 +78,31 @@ When an agent learns a new skill or writes to memory, it opens a branch + PR for
7678

7779
<img src="patterns/human-in-the-loop.png" alt="Human-in-the-Loop" width="600" />
7880

81+
### Segregation of Duties (SOD)
82+
No single agent should control a critical process end-to-end. Define roles (`maker`, `checker`, `executor`, `auditor`), a conflict matrix (which roles can't be the same agent), and handoff workflows — all in `agent.yaml` + `DUTIES.md`. The validator catches violations before deployment.
83+
84+
```yaml
85+
compliance:
86+
segregation_of_duties:
87+
roles:
88+
- id: maker
89+
description: Creates proposals
90+
permissions: [create, submit]
91+
- id: checker
92+
description: Reviews and approves
93+
permissions: [review, approve, reject]
94+
conflicts:
95+
- [maker, checker] # maker cannot approve own work
96+
assignments:
97+
loan-originator: [maker]
98+
credit-reviewer: [checker]
99+
handoffs:
100+
- action: credit_decision
101+
required_roles: [maker, checker]
102+
approval_required: true
103+
enforcement: strict
104+
```
105+
79106
### Live Agent Memory
80107
The `memory/` folder holds a `runtime/` subfolder where agents write live knowledge — `dailylog.md`, `key-decisions.md`, and `context.md` — persisting state across sessions.
81108

@@ -183,6 +210,18 @@ compliance:
183210
model_risk:
184211
validation_cadence: quarterly
185212
ongoing_monitoring: true
213+
segregation_of_duties:
214+
roles:
215+
- id: analyst
216+
permissions: [create, submit]
217+
- id: reviewer
218+
permissions: [review, approve, reject]
219+
conflicts:
220+
- [analyst, reviewer]
221+
assignments:
222+
compliance-analyst: [analyst]
223+
fact-checker: [reviewer]
224+
enforcement: strict
186225
```
187226

188227
## CLI Commands
@@ -218,6 +257,16 @@ gitagent has first-class support for financial regulatory compliance:
218257
- **Reg S-P** — Customer privacy, PII handling
219258
- **CFPB Circular 2022-03** — Explainable adverse action, Less Discriminatory Alternative search
220259

260+
### Segregation of Duties
261+
- **Roles & Permissions** — Define maker, checker, executor, auditor roles with controlled permissions
262+
- **Conflict Matrix** — Declare which role pairs cannot be held by the same agent
263+
- **Handoff Workflows** — Require multi-agent participation for critical actions (credit decisions, regulatory filings)
264+
- **Isolation** — Full state and credential segregation between roles
265+
- **DUTIES.md** — Root-level policy + per-agent role declarations
266+
- **Enforcement** — Strict (blocks deployment) or advisory (warnings only)
267+
268+
Inspired by [Salient AI](https://www.trysalient.com/)'s purpose-built agent architecture and the [FINOS AI Governance Framework](https://air-governance-framework.finos.org/mitigations/mi-22_multi-agent-isolation-and-segmentation.html).
269+
221270
Run `gitagent audit` for a full compliance checklist against your agent configuration.
222271

223272
## Adapters
@@ -264,7 +313,7 @@ See the `examples/` directory:
264313

265314
- **`examples/minimal/`** — 2-file hello world (agent.yaml + SOUL.md)
266315
- **`examples/standard/`** — Code review agent with skills, tools, and rules
267-
- **`examples/full/`** — Production compliance agent with all directories, hooks, workflows, sub-agents, and regulatory artifacts
316+
- **`examples/full/`** — Production compliance agent with all directories, hooks, workflows, sub-agents, SOD with DUTIES.md, and regulatory artifacts
268317
- **`examples/gitagent-helper/`** — Helper agent that assists with creating gitagent definitions
269318
- **`examples/lyzr-agent/`** — Example Lyzr Studio integration
270319

examples/full/DUTIES.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Duties
2+
3+
System-wide segregation of duties policy for the compliance-analyst agent system.
4+
5+
## Roles
6+
7+
| Role | Agent | Permissions | Description |
8+
|------|-------|-------------|-------------|
9+
| Analyst | compliance-analyst | create, submit | Performs regulatory analysis, generates findings and reports |
10+
| Reviewer | fact-checker | review, approve, reject | Reviews analysis for accuracy, verifies claims against authoritative sources |
11+
| Auditor | (unassigned) | audit, report | Audits completed reviews and maintains the compliance trail |
12+
13+
## Conflict Matrix
14+
15+
No single agent may hold both roles in any pair:
16+
17+
- **Analyst <-> Reviewer** — The agent that produces findings cannot approve them
18+
- **Analyst <-> Auditor** — The agent that produces findings cannot audit them
19+
- **Reviewer <-> Auditor** — The agent that approves findings cannot audit the approval
20+
21+
## Handoff Workflows
22+
23+
### Regulatory Filing
24+
1. **Analyst** creates the filing draft and submits for review
25+
2. **Reviewer** verifies accuracy against authoritative sources, approves or rejects
26+
3. Approval required at each step before proceeding
27+
28+
### Customer Communication
29+
1. **Analyst** drafts the communication
30+
2. **Reviewer** checks for FINRA 2210 compliance (fair, balanced, no misleading statements)
31+
3. Approval required before any communication is sent
32+
33+
## Isolation Policy
34+
35+
- **State isolation: full** — Each agent operates with its own memory and state. No agent may read or modify another agent's working memory.
36+
- **Credential segregation: separate** — Each role has its own credential scope. The analyst's data access credentials are distinct from the reviewer's.
37+
38+
## Enforcement
39+
40+
Enforcement mode is **strict**. Any SOD violation (e.g., assigning conflicting roles to the same agent) will fail validation and block deployment.

examples/full/agent.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,42 @@ compliance:
9696
soc_report_required: true
9797
vendor_ai_notification: true
9898
subcontractor_assessment: true
99+
segregation_of_duties:
100+
roles:
101+
- id: analyst
102+
description: Performs regulatory analysis and generates findings
103+
permissions:
104+
- create
105+
- submit
106+
- id: reviewer
107+
description: Reviews analysis for accuracy and completeness
108+
permissions:
109+
- review
110+
- approve
111+
- reject
112+
- id: auditor
113+
description: Audits completed reviews and maintains compliance trail
114+
permissions:
115+
- audit
116+
- report
117+
conflicts:
118+
- [analyst, reviewer]
119+
- [analyst, auditor]
120+
- [reviewer, auditor]
121+
assignments:
122+
compliance-analyst: [analyst]
123+
fact-checker: [reviewer]
124+
isolation:
125+
state: full
126+
credentials: separate
127+
handoffs:
128+
- action: regulatory_filing
129+
required_roles: [analyst, reviewer]
130+
approval_required: true
131+
- action: customer_communication
132+
required_roles: [analyst, reviewer]
133+
approval_required: true
134+
enforcement: strict
99135
tags:
100136
- compliance
101137
- financial-services
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Duties
2+
3+
## Role
4+
5+
**Reviewer** — Reviews analysis for accuracy and completeness.
6+
7+
## Permissions
8+
9+
- **review** — Examine outputs produced by the analyst
10+
- **approve** — Approve findings that meet accuracy and compliance standards
11+
- **reject** — Reject findings that are inaccurate, incomplete, or non-compliant
12+
13+
## Boundaries
14+
15+
### Must
16+
- Verify all factual claims against authoritative regulatory sources before approving
17+
- Reject any finding that cannot be independently verified
18+
- Document the basis for every approval or rejection decision
19+
20+
### Must Not
21+
- Create original analysis or findings (analyst role only)
22+
- Modify the analyst's work — only approve or reject
23+
- Access the analyst's working state or memory
24+
- Use credentials assigned to other roles
25+
- Audit own review decisions (auditor role only)
26+
27+
## Handoff Participation
28+
29+
| Action | Position in Chain | Receives From | Hands Off To |
30+
|--------|------------------|---------------|--------------|
31+
| regulatory_filing | Step 2 | analyst | (terminal — approved or rejected) |
32+
| customer_communication | Step 2 | analyst | (terminal — approved or rejected) |
33+
34+
## Isolation
35+
36+
This agent operates under **full state isolation** with **separate credentials**. It cannot access the compliance-analyst's memory, state, or data access tokens.

examples/full/compliance/regulatory-map.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,26 @@ mappings:
7777
controls:
7878
- vendor_supervisory_procedures
7979
- vendor_ai_change_notification
80+
81+
- capability: duty_segregation
82+
rules:
83+
- id: finos-ai-governance
84+
name: "FINOS AI Governance — Multi-Agent Isolation"
85+
controls:
86+
- role_definition
87+
- conflict_matrix_enforcement
88+
- assignment_validation
89+
- state_isolation
90+
- credential_segregation
91+
- id: finra-3110-sod
92+
name: "FINRA Rule 3110 — Supervisory Separation"
93+
controls:
94+
- maker_checker_separation
95+
- approval_workflow_enforcement
96+
- independent_review_requirement
97+
- id: soc2-logical-access
98+
name: "SOC 2 — Logical Access Controls"
99+
controls:
100+
- role_based_access_control
101+
- credential_isolation
102+
- cross_boundary_approval

0 commit comments

Comments
 (0)