longline 0.10.2

System-installed safety hook for Claude Code
Documentation
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
# Package managers: safe invocations and installation rules

allowlists:
  commands:
    # ── pip/pip3: safe invocations ────────────────────────────────
    # pip install - covered by rules (ask for confirmation)
    - { command: "pip list", trust: minimal }
    - { command: "pip show", trust: minimal }
    - { command: "pip freeze", trust: minimal }
    - { command: "pip check", trust: minimal }
    - { command: "pip3 list", trust: minimal }
    - { command: "pip3 show", trust: minimal }
    - { command: "pip3 freeze", trust: minimal }
    - { command: "pip3 check", trust: minimal }
    # ── gem: safe invocations ─────────────────────────────────────
    # gem install - covered by rules (ask for confirmation)
    - { command: "gem list", trust: minimal }
    - { command: "gem info", trust: minimal }
    - { command: "gem search", trust: minimal }
    - { command: "gem --version", trust: minimal }
    - { command: "gem -v", trust: minimal }
    # ── bundler: safe invocations ─────────────────────────────────
    # bundle install/add - covered by rules (ask for confirmation)
    - { command: "bundle list", trust: minimal }
    - { command: "bundle show", trust: minimal }
    - { command: "bundle info", trust: minimal }
    - { command: "bundle check", trust: minimal }
    - { command: "bundle --version", trust: minimal }
    - { command: "bundle -v", trust: minimal }
    - { command: "bundler --version", trust: minimal }
    # ── go: safe invocations ──────────────────────────────────────
    # go get/install - covered by rules (ask for confirmation)
    - { command: "go build", trust: standard, reason: "Compiles Go packages" }
    - { command: "go test", trust: standard, reason: "Runs Go tests" }
    - { command: "go run", trust: standard, reason: "Compiles and runs a Go program" }
    - { command: "go vet", trust: standard, reason: "Reports likely mistakes in Go code" }
    - { command: "go fmt", trust: standard, reason: "Formats Go source code" }
    - { command: "go mod", trust: standard, reason: "Manages Go module dependencies" }
    - { command: "go generate", trust: standard, reason: "Runs code generation directives" }
    - { command: "go doc", trust: minimal }
    - { command: "go clean", trust: standard, reason: "Removes build cache and output files" }
    - { command: "go env", trust: minimal }
    - { command: "go version", trust: minimal }
    - { command: "go work", trust: standard, reason: "Manages Go workspace configuration" }
    # ── yarn: safe invocations ────────────────────────────────────
    # yarn add/install - covered by rules (ask for confirmation)
    - { command: "yarn --version", trust: minimal }
    - { command: "yarn -v", trust: minimal }
    - { command: "yarn list", trust: minimal }
    - { command: "yarn info", trust: minimal }
    - { command: "yarn why", trust: minimal }
    - { command: "yarn run", trust: standard, reason: "Runs a script defined in package.json" }
    - { command: "yarn test", trust: standard, reason: "Runs the project's test suite" }
    - { command: "yarn build", trust: standard, reason: "Runs the project's build script" }
    - { command: "yarn start", trust: standard, reason: "Starts the application" }
    - { command: "yarn lint", trust: standard, reason: "Runs the project's linter" }
    # ── pnpm: safe invocations ────────────────────────────────────
    # pnpm add/install - covered by rules (ask for confirmation)
    - { command: "pnpm --version", trust: minimal }
    - { command: "pnpm -v", trust: minimal }
    - { command: "pnpm list", trust: minimal }
    - { command: "pnpm ls", trust: minimal }
    - { command: "pnpm why", trust: minimal }
    - { command: "pnpm audit", trust: minimal }
    - { command: "pnpm run", trust: standard, reason: "Runs a script defined in package.json" }
    - { command: "pnpm test", trust: standard, reason: "Runs the project's test suite" }
    - { command: "pnpm build", trust: standard, reason: "Runs the project's build script" }
    - { command: "pnpm start", trust: standard, reason: "Starts the application" }
    - { command: "pnpm lint", trust: standard, reason: "Runs the project's linter" }
    - { command: "pnpm dev", trust: standard, reason: "Starts the development server" }
    - { command: "pnpm check", trust: standard, reason: "Runs project checks" }
    - { command: "pnpm format", trust: standard, reason: "Formats project source files" }
    - { command: "pnpm typecheck", trust: standard, reason: "Runs TypeScript type checking" }
    # ── bun: safe invocations ─────────────────────────────────────
    # bun add/install - covered by rules (ask for confirmation)
    - { command: "bun --version", trust: minimal }
    - { command: "bun -v", trust: minimal }
    - { command: "bun run", trust: standard, reason: "Runs a script or file with Bun" }
    - { command: "bun test", trust: standard, reason: "Runs tests with Bun's test runner" }
    - { command: "bun build", trust: standard, reason: "Bundles files with Bun's bundler" }
    # ── poetry: safe invocations ──────────────────────────────────
    # poetry add/install - covered by rules (ask for confirmation)
    - { command: "poetry --version", trust: minimal }
    - { command: "poetry -V", trust: minimal }
    - { command: "poetry show", trust: minimal }
    - { command: "poetry list", trust: minimal }
    - { command: "poetry check", trust: minimal }
    - { command: "poetry lock", trust: standard, reason: "Resolves and locks Python dependencies" }
    - { command: "poetry shell", trust: standard, reason: "Activates the Poetry virtual environment" }
    - { command: "poetry env", trust: standard, reason: "Manages Poetry virtual environments" }
    # ── pipx: safe invocations ────────────────────────────────────
    # pipx install - covered by rules (ask for confirmation)
    - { command: "pipx --version", trust: minimal }
    - { command: "pipx list", trust: minimal }
    - { command: "pipx run", trust: standard, reason: "Runs a Python application in isolation" }
    # ── pdm: safe invocations ─────────────────────────────────────
    # pdm add/install - covered by rules (ask for confirmation)
    - { command: "pdm --version", trust: minimal }
    - { command: "pdm -V", trust: minimal }
    - { command: "pdm list", trust: minimal }
    - { command: "pdm show", trust: minimal }
    - { command: "pdm lock", trust: standard, reason: "Resolves and locks Python dependencies" }
    # ── rye: safe invocations ─────────────────────────────────────
    # rye add - covered by rules (ask for confirmation)
    - { command: "rye --version", trust: minimal }
    - { command: "rye -V", trust: minimal }
    - { command: "rye list", trust: minimal }
    - { command: "rye show", trust: minimal }
    - { command: "rye lock", trust: standard, reason: "Resolves and locks Python dependencies" }
    - { command: "rye sync", trust: standard, reason: "Syncs project dependencies with the lockfile" }
    # ── conda/mamba: safe invocations ─────────────────────────────
    # conda/mamba install - covered by rules (ask for confirmation)
    - { command: "conda --version", trust: minimal }
    - { command: "conda -V", trust: minimal }
    - { command: "conda list", trust: minimal }
    - { command: "conda info", trust: minimal }
    - { command: "conda env", trust: minimal }
    - { command: "mamba --version", trust: minimal }
    - { command: "mamba list", trust: minimal }
    - { command: "mamba info", trust: minimal }
    # ── composer: safe invocations ────────────────────────────────
    # composer require/install - covered by rules (ask for confirmation)
    - { command: "composer --version", trust: minimal }
    - { command: "composer -V", trust: minimal }
    - { command: "composer show", trust: minimal }
    - { command: "composer list", trust: minimal }
    - { command: "composer info", trust: minimal }
    - { command: "composer check-platform-reqs", trust: minimal }
    # ── brew: safe invocations ────────────────────────────────────
    # brew install - covered by rules (ask for confirmation)
    - { command: "brew --version", trust: minimal }
    - { command: "brew list", trust: minimal }
    - { command: "brew info", trust: minimal }
    - { command: "brew search", trust: minimal }
    - { command: "brew doctor", trust: minimal }
    - { command: "brew outdated", trust: minimal }
    - { command: "brew services list", trust: minimal }
    - { command: "brew deps", trust: minimal }
    - { command: "brew config", trust: minimal }
    - { command: "brew leaves", trust: minimal }
    - { command: "brew desc", trust: minimal }
    - { command: "brew cat", trust: minimal }
    - { command: "brew home", trust: minimal }
    # ── deno: safe invocations ────────────────────────────────────
    # deno install/add - covered by rules (ask for confirmation)
    - { command: "deno --version", trust: minimal }
    - { command: "deno -V", trust: minimal }
    - { command: "deno run", trust: standard, reason: "Runs a Deno script" }
    - { command: "deno test", trust: standard, reason: "Runs Deno tests" }
    - { command: "deno lint", trust: standard, reason: "Lints Deno source files" }
    - { command: "deno fmt", trust: standard, reason: "Formats Deno source files" }
    - { command: "deno check", trust: standard, reason: "Type-checks Deno source files" }
    - { command: "deno info", trust: standard, reason: "Shows dependency information" }
    - { command: "deno doc", trust: standard, reason: "Generates documentation from source" }
    # ── dotnet: safe invocations ──────────────────────────────────
    # dotnet add - covered by rules (ask for confirmation)
    - { command: "dotnet --version", trust: minimal }
    - { command: "dotnet --info", trust: minimal }
    - { command: "dotnet list", trust: minimal }
    - { command: "dotnet build", trust: standard, reason: "Builds a .NET project" }
    - { command: "dotnet run", trust: standard, reason: "Runs a .NET project" }
    - { command: "dotnet test", trust: standard, reason: "Runs .NET tests" }
    - { command: "dotnet clean", trust: standard, reason: "Cleans build output" }
    - { command: "dotnet restore", trust: standard, reason: "Restores .NET project dependencies" }
    # ── nuget: safe invocations ───────────────────────────────────
    # nuget install - covered by rules (ask for confirmation)
    - { command: "nuget --version", trust: minimal }
    - { command: "nuget list", trust: minimal }
    - { command: "nuget sources", trust: minimal }
    # ── mix (Elixir): safe invocations ────────────────────────────
    # mix deps.get - covered by rules (ask for confirmation)
    - { command: "mix --version", trust: minimal }
    - { command: "mix help", trust: minimal }
    - { command: "mix compile", trust: standard, reason: "Compiles an Elixir project" }
    - { command: "mix test", trust: standard, reason: "Runs Elixir tests" }
    - { command: "mix format", trust: standard, reason: "Formats Elixir source files" }
    # ── pub (Dart): safe invocations ──────────────────────────────
    # pub get/add - covered by rules (ask for confirmation)
    - { command: "dart pub --version", trust: minimal }
    - { command: "dart pub deps", trust: minimal }
    - { command: "dart pub outdated", trust: minimal }
    - { command: "flutter pub deps", trust: minimal }
    - { command: "flutter pub outdated", trust: minimal }
    # ── cabal (Haskell): safe invocations ─────────────────────────
    # cabal install - covered by rules (ask for confirmation)
    - { command: "cabal --version", trust: minimal }
    - { command: "cabal -V", trust: minimal }
    - { command: "cabal list", trust: minimal }
    - { command: "cabal info", trust: minimal }
    - { command: "cabal build", trust: standard, reason: "Builds a Haskell project with Cabal" }
    - { command: "cabal test", trust: standard, reason: "Runs Haskell tests with Cabal" }
    - { command: "cabal run", trust: standard, reason: "Runs a Haskell executable with Cabal" }
    # ── stack (Haskell): safe invocations ─────────────────────────
    # stack install - covered by rules (ask for confirmation)
    - { command: "stack --version", trust: minimal }
    - { command: "stack list-dependencies", trust: minimal }
    - { command: "stack build", trust: standard, reason: "Builds a Haskell project with Stack" }
    - { command: "stack test", trust: standard, reason: "Runs Haskell tests with Stack" }
    - { command: "stack run", trust: standard, reason: "Runs a Haskell executable with Stack" }

rules:
  # ============================================================
  # HIGH: Package installation (supply chain risk)
  # ============================================================
  # All package installation commands require confirmation.
  # Packages can contain arbitrary code that runs at install time.
  # Risk: typosquatting, malicious packages, supply chain attacks.
  #
  # Future: --allow-package-install flag could bypass this section.

  # ── Python package managers ──────────────────────────────────
  - id: pip-install
    level: high
    match:
      command:
        any_of: [pip, pip3]
      args:
        any_of: ["install"]
    decision: ask
    reason: "Installing Python packages"

  - id: pip-download
    level: high
    match:
      command:
        any_of: [pip, pip3]
      args:
        any_of: ["download"]
    decision: ask
    reason: "Downloading Python packages"

  - id: python-m-pip-install
    level: high
    match:
      command:
        any_of: [python, python3]
      args:
        any_of: ["-m"]
      flags:
        any_of: ["pip"]
    decision: ask
    reason: "Installing Python packages via python -m pip"

  - id: uv-pip-install
    level: high
    match:
      command: uv
      args:
        any_of: ["pip"]
      flags:
        any_of: ["install"]
    decision: ask
    reason: "Installing Python packages via uv"

  - id: uv-add
    level: high
    match:
      command: uv
      args:
        any_of: ["add"]
    decision: ask
    reason: "Adding Python dependency via uv"

  - id: poetry-add
    level: high
    match:
      command: poetry
      args:
        any_of: ["add"]
    decision: ask
    reason: "Adding Python dependency via Poetry"

  - id: poetry-install
    level: high
    match:
      command: poetry
      args:
        any_of: ["install"]
    decision: ask
    reason: "Installing Python dependencies via Poetry"

  - id: pipx-install
    level: high
    match:
      command: pipx
      args:
        any_of: ["install"]
    decision: ask
    reason: "Installing Python application via pipx"

  - id: pdm-add
    level: high
    match:
      command: pdm
      args:
        any_of: ["add"]
    decision: ask
    reason: "Adding Python dependency via PDM"

  - id: pdm-install
    level: high
    match:
      command: pdm
      args:
        any_of: ["install"]
    decision: ask
    reason: "Installing Python dependencies via PDM"

  - id: rye-add
    level: high
    match:
      command: rye
      args:
        any_of: ["add"]
    decision: ask
    reason: "Adding Python dependency via Rye"

  - id: conda-install
    level: high
    match:
      command:
        any_of: [conda, mamba]
      args:
        any_of: ["install"]
    decision: ask
    reason: "Installing packages via Conda/Mamba"

  # ── JavaScript/Node package managers ─────────────────────────
  - id: npm-install
    level: high
    match:
      command: npm
      args:
        any_of: ["install", "i", "ci"]
    decision: ask
    reason: "Installing npm packages"

  - id: npm-audit-fix
    level: high
    match:
      command: npm
      args:
        any_of: ["audit"]
      flags:
        any_of: ["fix"]
    decision: ask
    reason: "npm audit fix modifies package dependencies"

  - id: npm-exec
    level: high
    match:
      command: npm
      args:
        any_of: ["exec"]
    decision: ask
    reason: "npm exec runs arbitrary package code"

  - id: yarn-add
    level: high
    match:
      command: yarn
      args:
        any_of: ["add"]
    decision: ask
    reason: "Adding npm package via Yarn"

  - id: yarn-install
    level: high
    match:
      command: yarn
      args:
        any_of: ["install"]
    decision: ask
    reason: "Installing npm packages via Yarn"

  - id: pnpm-add
    level: high
    match:
      command: pnpm
      args:
        any_of: ["add"]
    decision: ask
    reason: "Adding npm package via pnpm"

  - id: pnpm-install
    level: high
    match:
      command: pnpm
      args:
        any_of: ["install", "i"]
    decision: ask
    reason: "Installing npm packages via pnpm"

  - id: bun-add
    level: high
    match:
      command: bun
      args:
        any_of: ["add"]
    decision: ask
    reason: "Adding npm package via Bun"

  - id: bun-install
    level: high
    match:
      command: bun
      args:
        any_of: ["install", "i"]
    decision: ask
    reason: "Installing npm packages via Bun"

  # ── Ruby package managers ────────────────────────────────────
  - id: gem-install
    level: high
    match:
      command: gem
      args:
        any_of: ["install"]
    decision: ask
    reason: "Installing Ruby gems"

  - id: bundle-install
    level: high
    match:
      command:
        any_of: [bundle, bundler]
      args:
        any_of: ["install"]
    decision: ask
    reason: "Installing Ruby gems via Bundler"

  - id: bundle-add
    level: high
    match:
      command:
        any_of: [bundle, bundler]
      args:
        any_of: ["add"]
    decision: ask
    reason: "Adding Ruby gem via Bundler"

  # ── Rust package managers ────────────────────────────────────
  - id: cargo-add
    level: high
    match:
      command: cargo
      args:
        any_of: ["add"]
    decision: ask
    reason: "Adding Rust crate dependency"

  - id: cargo-install
    level: high
    match:
      command: cargo
      args:
        any_of: ["install"]
    decision: ask
    reason: "Installing Rust binary"

  # ── Go package managers ──────────────────────────────────────
  - id: go-get
    level: high
    match:
      command: go
      args:
        any_of: ["get"]
    decision: ask
    reason: "Fetching Go module"

  - id: go-install
    level: high
    match:
      command: go
      args:
        any_of: ["install"]
    decision: ask
    reason: "Installing Go binary"

  # ── PHP package managers ─────────────────────────────────────
  - id: composer-require
    level: high
    match:
      command: composer
      args:
        any_of: ["require"]
    decision: ask
    reason: "Adding PHP package via Composer"

  - id: composer-install
    level: high
    match:
      command: composer
      args:
        any_of: ["install"]
    decision: ask
    reason: "Installing PHP packages via Composer"

  # ── System package managers ──────────────────────────────────
  - id: brew-install
    level: high
    match:
      command: brew
      args:
        any_of: ["install"]
    decision: ask
    reason: "Installing package via Homebrew"

  - id: brew-upgrade
    level: high
    match:
      command: brew
      args: { any_of: ["upgrade"] }
    decision: ask
    reason: "Upgrading packages via Homebrew"

  - id: brew-uninstall
    level: high
    match:
      command: brew
      args: { any_of: ["uninstall", "remove", "rm"] }
    decision: ask
    reason: "Uninstalling package via Homebrew"

  - id: brew-update
    level: high
    match:
      command: brew
      args: { any_of: ["update"] }
    decision: ask
    reason: "Updating Homebrew package index"

  - id: brew-tap
    level: high
    match:
      command: brew
      args: { any_of: ["tap", "untap"] }
    decision: ask
    reason: "Modifying Homebrew taps"

  - id: brew-services-mutate
    level: high
    match:
      command: brew
      args: { any_of: ["start", "stop", "restart"] }
    decision: ask
    reason: "Managing Homebrew services"

  - id: brew-link
    level: high
    match:
      command: brew
      args: { any_of: ["link", "unlink"] }
    decision: ask
    reason: "Linking/unlinking Homebrew packages"

  - id: brew-cleanup
    level: high
    match:
      command: brew
      args: { any_of: ["cleanup", "autoremove"] }
    decision: ask
    reason: "Cleaning up Homebrew packages"

  - id: apt-install
    level: high
    match:
      command:
        any_of: [apt, apt-get]
      args:
        any_of: ["install"]
    decision: ask
    reason: "Installing system package via apt"

  - id: dnf-install
    level: high
    match:
      command:
        any_of: [dnf, yum]
      args:
        any_of: ["install"]
    decision: ask
    reason: "Installing system package via dnf/yum"

  - id: pacman-install
    level: high
    match:
      command: pacman
      flags:
        any_of: ["-S", "--sync"]
    decision: ask
    reason: "Installing system package via pacman"

  - id: apk-add
    level: high
    match:
      command: apk
      args:
        any_of: ["add"]
    decision: ask
    reason: "Installing Alpine package"

  - id: snap-install
    level: high
    match:
      command: snap
      args:
        any_of: ["install"]
    decision: ask
    reason: "Installing Snap package"

  - id: flatpak-install
    level: high
    match:
      command: flatpak
      args:
        any_of: ["install"]
    decision: ask
    reason: "Installing Flatpak application"

  - id: nix-env-install
    level: high
    match:
      command: nix-env
      flags:
        any_of: ["-i", "--install"]
    decision: ask
    reason: "Installing package via Nix"

  # ── Deno package managers ────────────────────────────────────
  - id: deno-install
    level: high
    match:
      command: deno
      args:
        any_of: ["install"]
    decision: ask
    reason: "Installing Deno package"

  - id: deno-add
    level: high
    match:
      command: deno
      args:
        any_of: ["add"]
    decision: ask
    reason: "Adding Deno dependency"

  # ── .NET package managers ────────────────────────────────────
  - id: dotnet-add-package
    level: high
    match:
      command: dotnet
      args:
        any_of: ["add"]
    decision: ask
    reason: "Adding .NET package"

  - id: nuget-install
    level: high
    match:
      command: nuget
      args:
        any_of: ["install"]
    decision: ask
    reason: "Installing NuGet package"

  # ── Elixir package managers ──────────────────────────────────
  - id: mix-deps-get
    level: high
    match:
      command: mix
      args:
        any_of: ["deps.get"]
    decision: ask
    reason: "Fetching Elixir dependencies"

  - id: mix-archive-install
    level: high
    match:
      command: mix
      args:
        any_of: ["archive.install", "escript.install"]
    decision: ask
    reason: "Installing Elixir archive/escript"

  # ── Dart/Flutter package managers ────────────────────────────
  - id: dart-pub-get
    level: high
    match:
      command: dart
      args:
        any_of: ["pub"]
      flags:
        any_of: ["get", "add"]
    decision: ask
    reason: "Installing Dart packages"

  - id: flutter-pub-get
    level: high
    match:
      command: flutter
      args:
        any_of: ["pub"]
      flags:
        any_of: ["get", "add"]
    decision: ask
    reason: "Installing Flutter packages"

  - id: pub-get
    level: high
    match:
      command: pub
      args:
        any_of: ["get", "add"]
    decision: ask
    reason: "Installing Dart packages via pub"

  # ── Haskell package managers ─────────────────────────────────
  - id: cabal-install
    level: high
    match:
      command: cabal
      args:
        any_of: ["install", "v2-install"]
    decision: ask
    reason: "Installing Haskell package via Cabal"

  - id: stack-install
    level: high
    match:
      command: stack
      args:
        any_of: ["install"]
    decision: ask
    reason: "Installing Haskell package via Stack"

  # ── Lua package managers ─────────────────────────────────────
  - id: luarocks-install
    level: high
    match:
      command: luarocks
      args:
        any_of: ["install"]
    decision: ask
    reason: "Installing Lua rock"

  # ── sudo/privilege escalation wrappers ───────────────────────
  - id: sudo-package-install
    level: high
    match:
      command: sudo
      args:
        any_of: ["pip", "pip3", "npm", "gem", "apt", "apt-get", "dnf", "yum",
                 "pacman", "apk", "brew", "snap", "flatpak"]
    decision: ask
    reason: "Package installation with sudo"

  - id: doas-package-install
    level: high
    match:
      command: doas
      args:
        any_of: ["pip", "pip3", "npm", "gem", "apt", "apt-get", "dnf", "yum",
                 "pacman", "apk", "brew", "snap", "flatpak"]
    decision: ask
    reason: "Package installation with doas"