Answer security round 5: 0 🔴, 1 🟡; load no settings source at all, and answer stability round 5's nit with a test that no config or hook program runs

This commit is contained in:
2026-10-16 22:54:18 +02:00
parent 57cd5f76a4
commit 53e87d1051
2 changed files with 23 additions and 3 deletions
+4 -3
View File
@@ -50,9 +50,10 @@ def permission_flags(clone, version_dir, report):
*(f"{tool}({tree})" for tool in ("Read", "Grep", "Glob") for tree in trees),
]
denied = ["Bash(git *)", f"Edit(/{clone}/.git/**)", f"Edit(/{clone}/.claude/**)"]
# No "user" or "project" source: ~/.claude/settings.json would add ~/code to the trees and run its hooks,
# and a case's committed .claude/settings.json could run its own; --strict-mcp-config ignores a committed .mcp.json.
return ["--setting-sources", "local", "--strict-mcp-config", "--permission-mode", "dontAsk", "--permission-prompts", "none",
# No settings source: ~/.claude/settings.json would add ~/code to the trees and run its hooks, and a case's
# committed .claude/settings.json or settings.local.json could run its own. --strict-mcp-config ignores a
# committed .mcp.json.
return ["--setting-sources", "", "--strict-mcp-config", "--permission-mode", "dontAsk", "--permission-prompts", "none",
"--allowedTools", *allowed, "--disallowedTools", *denied]