Skip to content

Commit e1a009e

Browse files
Merge pull request #4 from Emasoft/fix/auto-trust-and-verification-fixes
feat: Auto-trust mechanism for AI Maestro agents (Issue #223)
2 parents a0305c1 + ae195b7 commit e1a009e

2 files changed

Lines changed: 78 additions & 0 deletions

File tree

plugins/ai-maestro/scripts/agent-helper.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,45 @@ create_project_template() {
326326
return 1
327327
}
328328

329+
# Write .claude/settings.local.json with pre-approved tool permissions
330+
# so agents created by AI Maestro don't require manual tool approval (Issue #223)
331+
local tmp_settings
332+
tmp_settings=$(mktemp) || {
333+
print_error "Failed to create temp file for settings.local.json"
334+
return 1
335+
}
336+
337+
cat > "$tmp_settings" << 'SETTINGS'
338+
{
339+
"permissions": {
340+
"allow": [
341+
"Bash(*)",
342+
"Read(*)",
343+
"Write(*)",
344+
"Edit(*)",
345+
"Glob(*)",
346+
"Grep(*)",
347+
"WebFetch(*)",
348+
"WebSearch(*)",
349+
"Task(*)",
350+
"mcp__*"
351+
]
352+
}
353+
}
354+
SETTINGS
355+
# shellcheck disable=SC2181
356+
if [[ $? -ne 0 ]]; then
357+
rm -f "$tmp_settings"
358+
print_error "Failed to write settings.local.json content"
359+
return 1
360+
fi
361+
362+
mv "$tmp_settings" "$canonical_dir/.claude/settings.local.json" || {
363+
rm -f "$tmp_settings"
364+
print_error "Failed to create .claude/settings.local.json"
365+
return 1
366+
}
367+
329368
# HIGH-1/HIGH-2: Use atomic write pattern - write to temp file first, then mv
330369
local tmp_claude tmp_gitignore
331370
tmp_claude=$(mktemp) || {

src/scripts/agent-helper.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,45 @@ create_project_template() {
326326
return 1
327327
}
328328

329+
# Write .claude/settings.local.json with pre-approved tool permissions
330+
# so agents created by AI Maestro don't require manual tool approval (Issue #223)
331+
local tmp_settings
332+
tmp_settings=$(mktemp) || {
333+
print_error "Failed to create temp file for settings.local.json"
334+
return 1
335+
}
336+
337+
cat > "$tmp_settings" << 'SETTINGS'
338+
{
339+
"permissions": {
340+
"allow": [
341+
"Bash(*)",
342+
"Read(*)",
343+
"Write(*)",
344+
"Edit(*)",
345+
"Glob(*)",
346+
"Grep(*)",
347+
"WebFetch(*)",
348+
"WebSearch(*)",
349+
"Task(*)",
350+
"mcp__*"
351+
]
352+
}
353+
}
354+
SETTINGS
355+
# shellcheck disable=SC2181
356+
if [[ $? -ne 0 ]]; then
357+
rm -f "$tmp_settings"
358+
print_error "Failed to write settings.local.json content"
359+
return 1
360+
fi
361+
362+
mv "$tmp_settings" "$canonical_dir/.claude/settings.local.json" || {
363+
rm -f "$tmp_settings"
364+
print_error "Failed to create .claude/settings.local.json"
365+
return 1
366+
}
367+
329368
# HIGH-1/HIGH-2: Use atomic write pattern - write to temp file first, then mv
330369
local tmp_claude tmp_gitignore
331370
tmp_claude=$(mktemp) || {

0 commit comments

Comments
 (0)