forked from hoangsonww/Claude-Code-Agent-Monitor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefault.rules
More file actions
71 lines (66 loc) · 1.85 KB
/
default.rules
File metadata and controls
71 lines (66 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# Default execution policy rules for this repository.
# Safe, routine read-only git inspection can run with prompt.
prefix_rule(
pattern = ["git", ["status", "diff", "log", "show"]],
decision = "prompt",
justification = "Git inspection is allowed with approval.",
match = [
"git status",
"git diff",
"git log --oneline -20",
"git show HEAD~1",
],
not_match = [
"git checkout -b feature/new-branch",
],
)
# Destructive reset-style operations are blocked.
prefix_rule(
pattern = ["git", "reset", "--hard"],
decision = "forbidden",
justification = "Hard reset is blocked to prevent data loss. Use explicit file edits or safe restore strategies.",
match = [
"git reset --hard",
"git reset --hard HEAD~1",
],
not_match = [
"git reset --soft HEAD~1",
],
)
# Installing dependencies should always require approval.
prefix_rule(
pattern = ["npm", "install"],
decision = "prompt",
justification = "Dependency installation changes lockfiles and runtime behavior; require explicit approval.",
match = [
"npm install",
"npm install some-package",
],
not_match = [
"npm run build",
],
)
# Potentially destructive filesystem deletes are blocked.
prefix_rule(
pattern = ["rm", "-rf"],
decision = "forbidden",
justification = "Recursive force deletion is blocked. Use targeted edits or safer deletion commands.",
match = [
"rm -rf /tmp/test-folder",
],
not_match = [
"rm -r ./tmp",
],
)
# Network fetch commands should be reviewed each time.
prefix_rule(
pattern = ["curl"],
decision = "prompt",
justification = "Network access should be explicitly reviewed per command.",
match = [
"curl https://example.com",
],
not_match = [
"cat README.md",
],
)