|
1 | 1 | # The Anatomy of a Governed AI Coding Agent |
2 | 2 |
|
3 | | -**CORE – Constitutional Runtime Enforcement** |
| 3 | +**CORE** – Constitutional Runtime Enforcement |
4 | 4 |
|
5 | | -**Goal: [HUMAN INTENT]** |
6 | | -**CORE enforces unbreakable constitutional governance** over the entire agent workflow |
7 | | -*(no prompt, no model output, no clever instruction can override the rules)* |
| 5 | +> **Goal: [HUMAN INTENT]** |
| 6 | +> CORE enforces **unbreakable constitutional governance** over the entire agent workflow. |
| 7 | +> No prompt • no model output • no clever trick can override the rules. |
8 | 8 |
|
9 | | -## Text Overview |
| 9 | +## Core Phases |
10 | 10 |
|
11 | | -**GOAL** |
12 | | -Human objective or request provided to the agent. |
| 11 | +**🟢 GOAL** |
| 12 | +Human objective or request given to the agent. |
13 | 13 |
|
14 | | -**CONTEXT** |
15 | | -Current repository state, knowledge sources, system inputs, and conversation history. |
| 14 | +**📂 CONTEXT** |
| 15 | +Repository state, knowledge sources, system inputs, conversation history. |
16 | 16 |
|
17 | | -**CONSTRAINTS** |
18 | | -Immutable constitutional rules & governance policies |
19 | | -(always enforced, never overridden, never bypassed) |
| 17 | +**🔒 CONSTRAINTS** |
| 18 | +Immutable constitutional rules & policies |
| 19 | +(92 rules across 7 engines — always enforced, never bypassed) |
20 | 20 |
|
21 | | -**PLAN** |
22 | | -Agent reasons step-by-step and produces a structured, rule-aware execution plan. |
| 21 | +**🗺️ PLAN** |
| 22 | +Agent reasons step-by-step → creates structured, rule-aware execution plan. |
23 | 23 |
|
24 | | -**GENERATE** |
25 | | -AI creates code, file changes, tool calls, or other actions. |
| 24 | +**✨ GENERATE** |
| 25 | +AI produces code • changes • tool calls • actions. |
26 | 26 |
|
27 | | -**VALIDATE** |
28 | | -Deterministic enforcement engines (AST, semantic, intent, style, etc.) verify full compliance. |
| 27 | +**✅ VALIDATE** |
| 28 | +Deterministic engines (AST, semantic, intent, style, etc.) check full compliance. |
29 | 29 |
|
30 | | -**REMEDIATE** |
31 | | -If validation fails → agent repairs the violation |
| 30 | +**🔄 REMEDIATE** |
| 31 | +Validation fails? → Agent repairs violation |
32 | 32 | (loops back to GENERATE/PLAN via Autonomy Ladder) |
33 | 33 |
|
34 | | -**EXECUTE** |
35 | | -Only fully approved, rule-compliant actions are performed |
36 | | -(file writes, commits, tool invocations, system changes) |
| 34 | +**▶️ EXECUTE** |
| 35 | +Only approved, compliant actions run |
| 36 | +(file writes • commits • tools • system changes) |
37 | 37 |
|
38 | | -## Non-negotiable Safety Guarantee |
39 | | -If **any** constitutional rule is violated at any stage: |
40 | | -→ Execution halts immediately |
41 | | -→ Full audit record created (reasoning trace + violation details) |
42 | | -→ No changes are committed without passing all checks |
| 38 | +## Safety Guarantee |
43 | 39 |
|
44 | | -**Result** |
45 | | -Safe, auditable, jailbreak-resistant AI coding agents — production-ready in 2026. |
| 40 | +**If any constitutional rule is violated at any point:** |
46 | 41 |
|
47 | | -github.com/DariuszNewecki/CORE · Star · Fork · Build governed agents today |
| 42 | +- Execution **halts immediately** |
| 43 | +- Full audit log created (trace + violation details) |
| 44 | +- **No changes** are ever committed without passing all checks |
48 | 45 |
|
49 | | -## Visual Workflow (Mermaid Flowchart) |
| 46 | +**Result:** Safe • auditable • jailbreak-resistant AI coding agents — production-ready in 2026. |
| 47 | + |
| 48 | +## Visual Flow |
50 | 49 |
|
51 | 50 | ```mermaid |
52 | 51 | flowchart TD |
53 | | - A["Goal: HUMAN INTENT"] --> B["CONTEXT\nRepo state, knowledge, history"] |
54 | | - B --> C["CONSTRAINTS\nImmutable Rules\n(92 rules, 7 engines)"] |
55 | | - C --> D["PLAN\nStep-by-step reasoning\nRule-aware plan"] |
56 | | - D --> E["GENERATE\nCode, changes, actions"] |
57 | | - E --> F["VALIDATE\nDeterministic checks\n(AST, semantic, intent, style)"] |
58 | | - F -->|Pass| G["EXECUTE\nCommit changes\nFiles, tools, repo"] |
59 | | - F -->|Fail| H["REMEDIATE\nRepair violation\nAutonomy Ladder loop"] |
| 52 | + A["🟢 GOAL: HUMAN INTENT"] --> B["📂 CONTEXT\nRepo + knowledge + history"] |
| 53 | + B --> C["🔒 CONSTRAINTS\nImmutable Rules (92/7 engines)"] |
| 54 | + C --> D["🗺️ PLAN\nStep-by-step reasoning"] |
| 55 | + D --> E["✨ GENERATE\nCode, actions, changes"] |
| 56 | + E --> F["✅ VALIDATE\nDeterministic checks"] |
| 57 | + F -->|Pass| G["▶️ EXECUTE\nApply changes"] |
| 58 | + F -->|Fail| H["🔄 REMEDIATE\nRepair → loop back"] |
60 | 59 | H --> E |
61 | | - G --> I["Success\nChanges applied"] |
| 60 | + G --> I["Success"] |
62 | 61 |
|
63 | 62 | subgraph "SAFETY HALT" |
64 | | - J["CONSTITUTIONAL VIOLATION\n→ HARD HALT\n+ AUDIT LOG"] |
| 63 | + J["🚨 CONSTITUTIONAL VIOLATION\n→ HARD HALT + AUDIT LOG"] |
65 | 64 | end |
66 | 65 |
|
67 | 66 | E -.->|Violation| J |
|
0 commit comments