aegis-mcp-server 0.1.10 → 0.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # aegis-mcp-server
2
-
2
+ <!-- mcp-name: io.github.cleburn/aegis-mcp -->
3
3
  **MCP enforcement layer for the [Aegis](https://github.com/cleburn/aegis-spec) agent governance specification.**
4
4
 
5
5
  The spec writes the law. The CLI generates the law. This enforces the law.
@@ -8,54 +8,65 @@ The spec writes the law. The CLI generates the law. This enforces the law.
8
8
 
9
9
  `aegis-mcp-server` is an MCP server that validates every agent action against your `.agentpolicy/` files **before** it happens. Path permissions, content scanning, role boundaries, quality gates — all enforced at runtime with zero token overhead to the agent.
10
10
 
11
- The agent never loads your governance files. The MCP server reads them into its own process memory and validates silently. The agent calls governed tools (`aegis_write_file`, `aegis_read_file`, etc.) and gets back either a success or a blocked response with the specific reason.
11
+ The agent never loads your governance files. The MCP server reads them into its own process memory and validates silently. The agent calls governed tools and gets back either a success or a blocked response with the specific reason.
12
12
 
13
13
  ## Quick Start
14
14
 
15
15
  ```bash
16
+ # Install globally
16
17
  npm install -g aegis-mcp-server
17
-
18
- # Or use npx
19
- npx aegis-mcp-server --project . --role default
20
18
  ```
21
19
 
22
- ### Claude Code Configuration
20
+ If you generated your policy with [aegis-cli](https://github.com/cleburn/aegis-cli), the `.mcp.json` connection config is already in your project root. Just install the MCP and open your agent — it connects automatically.
23
21
 
24
- ```json
25
- {
26
- "mcpServers": {
27
- "aegis": {
28
- "command": "npx",
29
- "args": ["aegis-mcp-server", "--project", ".", "--role", "default"]
30
- }
31
- }
32
- }
22
+ ### First Prompt
23
+
24
+ When starting a new agent session in a governed project, use this as your first prompt:
25
+
26
+ ```
27
+ Call aegis_policy_summary now. This is your governance contract — it defines your
28
+ role, your boundaries, and which tools to use. Do not read files, do not take any
29
+ action, and do not assume your role until you have called this tool.
33
30
  ```
34
31
 
35
- For role-specific enforcement:
32
+ ## How It Works
33
+
34
+ ### Universal Mode (Default)
35
+
36
+ The MCP starts without a pre-assigned role. When the agent calls `aegis_policy_summary`, it receives the list of available roles from `.agentpolicy/roles/`. The agent presents them to the user, the user picks, and the agent calls `aegis_select_role` to lock in. All enforcement uses the selected role for the rest of the session.
37
+
38
+ This is the default behavior — no configuration needed beyond the `.mcp.json` that `aegis init` creates automatically.
39
+
40
+ ### Fixed Mode
41
+
42
+ If you know which role to assign at startup:
36
43
 
37
44
  ```json
38
45
  {
39
46
  "mcpServers": {
40
47
  "aegis": {
41
- "command": "npx",
42
- "args": ["aegis-mcp-server", "--project", ".", "--role", "backend"]
48
+ "command": "aegis-mcp",
49
+ "args": ["--project", ".", "--role", "backend"]
43
50
  }
44
51
  }
45
52
  }
46
53
  ```
47
54
 
55
+ The MCP locks to that role immediately. `aegis_policy_summary` returns the role's boundaries directly, skipping role selection.
56
+
48
57
  ## Tools
49
58
 
50
59
  | Tool | What it does | Token cost |
51
60
  |------|-------------|------------|
52
- | `aegis_check_permissions` | Pre-check if an operation is allowed | Tiny just the verdict |
53
- | `aegis_write_file` | Write with path + content validation | Same as a normal write |
54
- | `aegis_read_file` | Read with path validation | Same as a normal read |
55
- | `aegis_delete_file` | Delete with path validation | Tiny just the verdict |
56
- | `aegis_execute` | Execute a command in project root | Command output only |
61
+ | `aegis_policy_summary` | Role boundaries and governance summary (or available roles in universal mode) | ~200 tokens |
62
+ | `aegis_select_role` | Select a role in universal mode | Tiny |
63
+ | `aegis_check_permissions` | Pre-check if an operation is allowed | Tiny |
64
+ | `aegis_write_file` | Governed write with path + content validation | Same as a normal write |
65
+ | `aegis_read_file` | Governed read with path validation | Same as a normal read |
66
+ | `aegis_delete_file` | Governed delete with path validation | Tiny |
67
+ | `aegis_execute` | Governed command execution | Command output only |
57
68
  | `aegis_complete_task` | Run quality gates before marking done | Gate results only |
58
- | `aegis_policy_summary` | Minimal role + permissions summary | ~200 tokens |
69
+ | `aegis_request_override` | Execute a blocked action after human confirmation | Tiny |
59
70
 
60
71
  ## Zero Token Overhead
61
72
 
@@ -65,13 +76,31 @@ Aegis MCP approach: the server loads policy into its own process memory. The age
65
76
 
66
77
  ## Enforcement
67
78
 
68
- - **Governance boundaries** — `writable`, `read_only`, `forbidden` path lists from governance.json
79
+ - **Governance boundaries** — `writable`, `read_only`, `forbidden` path lists
69
80
  - **Role scoping** — agents confined to their role's writable and readable paths
70
81
  - **Sensitive pattern detection** — content scanned against governance-defined patterns
71
- - **Cross-domain boundaries** — imports validated against shared interface rules (when configured)
82
+ - **Cross-domain boundaries** — imports validated against shared interface rules
72
83
  - **Quality gate validation** — `pre_commit` flags mapped to `build_commands` and executed
73
- - **Override logging** — violations logged to append-only `overrides.jsonl`
74
- - **Immutable policies** — designated rules that cannot be overridden, even with human confirmation
84
+ - **Override logging** — every blocked action logged to append-only `overrides.jsonl`
85
+ - **Immutable policies** — designated rules that cannot be overridden, ever
86
+
87
+ ## Override Protocol
88
+
89
+ When an action is blocked and the governance override behavior is `warn_confirm_and_log`:
90
+
91
+ 1. The blocked response includes an `override_token` and the specific policy violated
92
+ 2. The agent presents the violation to the user
93
+ 3. If the user confirms, the agent calls `aegis_request_override` with the token and the user's rationale
94
+ 4. The action proceeds — the override is logged with `human_confirmed: true`
95
+ 5. Normal governance resumes immediately — the override is a one-time exception
96
+
97
+ Immutable policies (e.g., HIPAA compliance, audit completeness) return `override_available: false` and cannot be overridden. The user must modify the governance through `aegis init`.
98
+
99
+ ## Consent-Based Governance
100
+
101
+ The Aegis MCP does not override the agent's native directives. It introduces itself through tool descriptions, explains why governance is active, and asks the agent to seek user permission to route write operations through Aegis tools. The user's authority is the enforcement mechanism.
102
+
103
+ Native tools for reading, searching, and exploring the codebase work fine without governance gating. Only write, delete, and execute operations benefit from routing through Aegis.
75
104
 
76
105
  ## Architecture
77
106
 
@@ -81,7 +110,8 @@ Agent ──→ aegis-mcp-server ──→ File System
81
110
  ├── Loads .agentpolicy/ into process memory (once)
82
111
  ├── Watches for policy changes (auto-reload)
83
112
  ├── Validates every tool call against policy
84
- └── Returns success or blocked with reason
113
+ ├── Returns success or blocked with override option
114
+ └── Logs all enforcement decisions to overrides.jsonl
85
115
  ```
86
116
 
87
117
  Three artifacts, one governance framework:
Binary file
Binary file
@@ -0,0 +1,54 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="512" height="512">
2
+ <defs>
3
+ <linearGradient id="shieldGrad" x1="0%" y1="0%" x2="0%" y2="100%">
4
+ <stop offset="0%" stop-color="#79c0ff"/>
5
+ <stop offset="35%" stop-color="#58a6ff"/>
6
+ <stop offset="100%" stop-color="#1f6feb"/>
7
+ </linearGradient>
8
+ <clipPath id="roundedBg">
9
+ <rect width="512" height="512" rx="80"/>
10
+ </clipPath>
11
+ </defs>
12
+
13
+ <!-- Rounded rectangle background -->
14
+ <rect width="512" height="512" rx="80" fill="#0d1117"/>
15
+
16
+ <!-- Outer shield (blue filled) -->
17
+ <path d="
18
+ M 256 56
19
+ L 120 116
20
+ L 120 248
21
+ C 120 348 178 432 256 472
22
+ C 334 432 392 348 392 248
23
+ L 392 116
24
+ Z
25
+ " fill="url(#shieldGrad)"/>
26
+
27
+ <!-- Inner shield cutout (dark) -->
28
+ <path d="
29
+ M 256 96
30
+ L 152 142
31
+ L 152 248
32
+ C 152 332 200 404 256 438
33
+ C 312 404 360 332 360 248
34
+ L 360 142
35
+ Z
36
+ " fill="#0d1117" opacity="0.87"/>
37
+
38
+ <!-- Policy line 1 (top, faintest) -->
39
+ <line x1="196" y1="212" x2="316" y2="212"
40
+ stroke="#58a6ff" stroke-width="9" stroke-linecap="round" opacity="0.45"/>
41
+
42
+ <!-- Policy line 2 (middle) -->
43
+ <line x1="196" y1="252" x2="316" y2="252"
44
+ stroke="#58a6ff" stroke-width="9" stroke-linecap="round" opacity="0.7"/>
45
+
46
+ <!-- Policy line 3 (shorter, full) -->
47
+ <line x1="196" y1="292" x2="288" y2="292"
48
+ stroke="#58a6ff" stroke-width="9" stroke-linecap="round" opacity="1.0"/>
49
+
50
+ <!-- Checkmark -->
51
+ <polyline points="270,332 290,352 330,304"
52
+ fill="none" stroke="#58a6ff" stroke-width="10"
53
+ stroke-linecap="round" stroke-linejoin="round"/>
54
+ </svg>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aegis-mcp-server",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "description": "MCP enforcement layer for the Aegis agent governance specification",
5
5
  "type": "module",
6
6
  "bin": {
package/server.json ADDED
@@ -0,0 +1,27 @@
1
+ {
2
+ "$schema": "https://static.modelcontextprotocol.io/schemas/2025-09-16/server.schema.json",
3
+ "name": "io.github.cleburn/aegis-mcp",
4
+ "description": "Runtime enforcement layer for Aegis agent governance. Validates every agent action against .agentpolicy/ files before execution. Zero token overhead.",
5
+ "version": "0.1.10",
6
+ "repository": {
7
+ "url": "https://github.com/cleburn/aegis-mcp",
8
+ "source": "github"
9
+ },
10
+ "icons": [
11
+ {
12
+ "src": "https://raw.githubusercontent.com/cleburn/aegis-mcp/main/assets/icon.png",
13
+ "type": "image/png",
14
+ "size": 128
15
+ }
16
+ ],
17
+ "packages": [
18
+ {
19
+ "registryType": "npm",
20
+ "identifier": "aegis-mcp-server",
21
+ "version": "0.1.10",
22
+ "transport": {
23
+ "type": "stdio"
24
+ }
25
+ }
26
+ ]
27
+ }