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:
@@ -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]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user