Skip to content

Commit e9fa607

Browse files
committed
fix(evolution): add policy evolution instructions to init templates and shorten denial message
- Add mandatory "Policy Evolution" section to all three governance templates (Cursor, OpenClaw, Claude Code) so agents present suggestion IDs to the user and call policy_evolution_approve with the user's decision; explicitly require agents not to ignore suggestion IDs. - Shorten McpEvolutionHandler denial message to a single actionable line to reduce verbosity in tool responses. - Bump version to 0.4.2 and document in RELEASE_NOTES.md.
1 parent 70def39 commit e9fa607

5 files changed

Lines changed: 50 additions & 11 deletions

File tree

RELEASE_NOTES.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
55
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.4.2] - 2026-02-12
9+
10+
### Fixed
11+
12+
- **Policy evolution agent instructions** — Init governance templates (Cursor, OpenClaw, Claude Code) now include mandatory "Policy Evolution" instructions so agents present suggestion IDs to the user and call `policy_evolution_approve` with the user's decision; the MCP denial message was shortened to a single actionable line to avoid verbosity in tool responses.
13+
14+
---
15+
816
## [0.4.1] - 2026-02-12
917

1018
### Fixed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@det-acp/core",
3-
"version": "0.4.1",
3+
"version": "0.4.2",
44
"description": "Agent Governance Gateway — bounded, auditable, session-aware control for AI agents with MCP proxy, shell proxy, and HTTP API",
55
"type": "module",
66
"main": "dist/index.js",

src/cli/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const program = new Command();
3333
program
3434
.name('det-acp')
3535
.description('Deterministic Agent Control Protocol — Agent Governance Gateway')
36-
.version('0.4.0');
36+
.version('0.4.2');
3737

3838
// ---------------------------------------------------------------------------
3939
// validate

src/cli/templates.ts

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,21 @@ Instead of your built-in tools, you MUST use these governed equivalents:
114114
4. **ALWAYS** route file edits through \`governed-filesystem\` → \`edit_file\`.
115115
5. **ALWAYS** route directory listings through \`governed-filesystem\` → \`list_directory\`.
116116
6. **ALWAYS** route file searches through \`governed-filesystem\` → \`search_files\`.
117-
7. If a governed tool call is **denied by policy**, you MUST respect the denial. Do NOT attempt to use a built-in tool as a fallback. Report the denial to the user instead.
117+
7. If a governed tool call is **denied by policy**, you MUST respect the denial. Do NOT attempt to use a built-in tool as a fallback.
118118
8. If you need a tool that is not available through the governed MCP server, ask the user for permission before proceeding.
119119
120+
## Policy Evolution — MANDATORY
121+
122+
When a governed tool call is **denied** and the response contains a \`Suggestion ID\`, you **MUST** follow this workflow:
123+
124+
1. **STOP** what you are doing. Do NOT skip the suggestion or continue with other tasks.
125+
2. **PRESENT** the suggested policy change to the user clearly, e.g.: *"The tool \`directory_tree\` was denied because it has no policy. Would you like to add it? Options: add to policy permanently, allow once for this session, or deny."*
126+
3. **WAIT** for the user to respond with their choice.
127+
4. **CALL** \`governed-filesystem\` → \`policy_evolution_approve\` with the \`suggestion_id\` from the denial and the user's \`decision\` (\`"add-to-policy"\`, \`"allow-once"\`, or \`"deny"\`).
128+
5. If the user chose "add-to-policy" or "allow-once", **RETRY** the original tool call that was denied.
129+
130+
**You MUST NOT ignore a Suggestion ID. You MUST NOT continue without asking the user.**
131+
120132
## Why
121133
122134
All file and system operations must go through the Deterministic Agent Control Protocol governance layer for policy enforcement and audit logging. Using built-in tools would bypass security policies, forbidden path protections, and the tamper-evident evidence ledger.
@@ -153,9 +165,21 @@ Instead of your built-in file tools, you MUST use these governed equivalents:
153165
4. **ALWAYS** route file edits through \`governed-filesystem\` → \`edit_file\`.
154166
5. **ALWAYS** route directory listings through \`governed-filesystem\` → \`list_directory\`.
155167
6. **ALWAYS** route file searches through \`governed-filesystem\` → \`search_files\`.
156-
7. If a governed tool call is **denied by policy**, you MUST respect the denial. Do NOT attempt to use a built-in tool as a fallback. Report the denial to the user instead.
168+
7. If a governed tool call is **denied by policy**, you MUST respect the denial. Do NOT attempt to use a built-in tool as a fallback.
157169
8. If you need a tool that is not available through the governed MCP server, ask the user for permission before proceeding.
158170
171+
## Policy Evolution — MANDATORY
172+
173+
When a governed tool call is **denied** and the response contains a \`Suggestion ID\`, you **MUST** follow this workflow:
174+
175+
1. **STOP** what you are doing. Do NOT skip the suggestion or continue with other tasks.
176+
2. **PRESENT** the suggested policy change to the user clearly, e.g.: *"The tool \`directory_tree\` was denied because it has no policy. Would you like to add it? Options: add to policy permanently, allow once for this session, or deny."*
177+
3. **WAIT** for the user to respond with their choice.
178+
4. **CALL** \`governed-filesystem\` → \`policy_evolution_approve\` with the \`suggestion_id\` from the denial and the user's \`decision\` (\`"add-to-policy"\`, \`"allow-once"\`, or \`"deny"\`).
179+
5. If the user chose "add-to-policy" or "allow-once", **RETRY** the original tool call that was denied.
180+
181+
**You MUST NOT ignore a Suggestion ID. You MUST NOT continue without asking the user.**
182+
159183
## Why
160184
161185
All file and system operations must go through the Deterministic Agent Control Protocol governance layer for policy enforcement and audit logging. Using built-in tools would bypass security policies, forbidden path protections, and the tamper-evident evidence ledger.
@@ -188,9 +212,21 @@ Instead of your built-in file tools, you MUST use these governed equivalents:
188212
189213
1. **NEVER** use built-in file read/write/edit tools for any file operation when the governed MCP tools are available.
190214
2. **ALWAYS** route file operations through the \`governed-filesystem\` MCP server.
191-
3. If a governed tool call is **denied by policy**, you MUST respect the denial. Do NOT attempt to use a built-in tool as a fallback. Report the denial to the user instead.
215+
3. If a governed tool call is **denied by policy**, you MUST respect the denial. Do NOT attempt to use a built-in tool as a fallback.
192216
4. If you need a tool that is not available through the governed MCP server, ask the user for permission before proceeding.
193217
218+
## Policy Evolution — MANDATORY
219+
220+
When a governed tool call is **denied** and the response contains a \`Suggestion ID\`, you **MUST** follow this workflow:
221+
222+
1. **STOP** what you are doing. Do NOT skip the suggestion or continue with other tasks.
223+
2. **PRESENT** the suggested policy change to the user clearly, e.g.: *"The tool \`directory_tree\` was denied because it has no policy. Would you like to add it? Options: add to policy permanently, allow once for this session, or deny."*
224+
3. **WAIT** for the user to respond with their choice.
225+
4. **CALL** \`governed-filesystem\` → \`policy_evolution_approve\` with the \`suggestion_id\` from the denial and the user's \`decision\` (\`"add-to-policy"\`, \`"allow-once"\`, or \`"deny"\`).
226+
5. If the user chose "add-to-policy" or "allow-once", **RETRY** the original tool call that was denied.
227+
228+
**You MUST NOT ignore a Suggestion ID. You MUST NOT continue without asking the user.**
229+
194230
## Why
195231
196232
All file and system operations must go through the Deterministic Agent Control Protocol governance layer for policy enforcement and audit logging. Using built-in tools would bypass security policies, forbidden path protections, and the tamper-evident evidence ledger.

src/evolution/mcp-handler.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,7 @@ export class McpEvolutionHandler {
124124
`[Policy Evolution] Suggested change: ${suggestion.description}`,
125125
`Suggestion ID: ${suggestionId}`,
126126
'',
127-
'Present this suggestion to the user and ask for their decision:',
128-
' - "add-to-policy" — permanently add to the policy file',
129-
' - "allow-once" — allow for this session only',
130-
' - "deny" — keep the restriction',
131-
'',
132-
`Then call the "${TOOL_NAME}" tool with the suggestion_id and their decision.`,
127+
'ACTION REQUIRED: Ask the user whether to "add-to-policy", "allow-once", or "deny", then call policy_evolution_approve with the suggestion_id and their decision. If approved, retry the original tool call.',
133128
].join('\n');
134129

135130
return {

0 commit comments

Comments
 (0)