safe-chains 0.239.2

Auto-allow safe bash commands in agentic coding tools
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
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
# Environment variables whose VALUE changes what a command does.
#
# `VAR=value cmd` is not `cmd`. A leading assignment can make the process run different code, load
# code from a different place, or reach a different system — all without changing the command name
# safe-chains classifies. This file is the researched list of variables where that is true, and the
# SHAPE of each one's value so a rule we already have can judge it.
#
# ONLY THE NAMES LISTED HERE ARE INSPECTED. An unlisted assignment is ignored exactly as before, and
# the absence of an assignment changes nothing. This file adds no denials outside itself — it is not
# a switch that makes unknown environment variables suspicious. That property is deliberate and is
# what makes the list safe to grow one entry at a time.
#
# Nothing here is "forbidden" either. `GIT_DIR=/tmp/evil` denies because `/tmp` is out-of-worktree
# under the ordinary locus rules, and `GIT_PAGER=cat` passes because `cat` passes. The value is
# classified; the name only says HOW.
#
# shape:
#   command    the value is a command line → classified by `command_verdict`, the same recursion
#              `sudo X` already uses. `GIT_PAGER=cat` allows, `GIT_PAGER='sh -c evil'` denies.
#   exec-path  the value names a path SUPPLYING CODE → gated at the executor locus, like cargo's
#              `--manifest-path`. Worktree allows; /tmp, home and system paths deny. This is not the
#              read rule: `cat /tmp/x.so` is a fine read, while LOADING /tmp/x.so is not.
#   data-path  the value names a path read or written as DATA → ordinary read/write locus.
#   data-write the value names a file the process WRITES (a trace, a key log) → the write locus.
#   opaque     the value cannot be judged on its own → presence denies, whatever the value.
#   config-dir   the value is a directory whose config files programs read (HOME) → allowed only
#                when it is absolute and lies in the project or under $HOME, and neither it nor a
#                file in it is a temp root (so the session scratchpad), a sibling project, or the
#                projects folder above it, in any letter case. Every other folder is refused, since
#                macOS reaches /tmp by other names too (/System/Volumes/Data, /Volumes/<disk>, /.vol).
#                A relative value is refused: `git -C`, `jj -R` and the like resolve it from another
#                folder than the one the command starts in. A `for` loop over the variable is judged
#                item by item the same way, and `read` into it or a bash nameref (`declare -n`) is
#                refused, since either sets it without an assignment.
#   config-file  the value names a config file or repository that can name programs to run → the
#                exec-path rule, and never a temp root or sibling project either.
#
# An entry may also carry `twin_flag` / `twin_base`, naming the FLAG spelling of the same thing:
#   twin_flag = "rsync -e {v} ./src/ ./dst/"   the flag invocation, `{v}` marking the value
#   twin_base = "rsync ./src/ ./dst/"          the command the variable prefixes
# `a_tagged_env_var_classifies_the_same_as_its_flag_twin` then holds the two spellings to the SAME
# verdict for a foreign path, a workspace path and a bare name. Tag every pair: gating one spelling
# and leaving the other open is a complete bypass that reads as a closed gate — which is exactly how
# `borg --rsh /tmp/evil` came to deny while `BORG_RSH=/tmp/evil borg` was approved.

# Every entry's `because` is the measured behaviour where one was taken; see
# docs/design/env-prefix-classification.md for the probes. Entries marked `measured = false` are
# enumerated from documentation because the toolchain was not installed to test against.

# ── Dynamic loader ───────────────────────────────────────────────────────────
# Injects code into the process before main. On macOS the DYLD_* pair is stripped by SIP for system
# binaries but honored for user-installed ones (Homebrew/cargo/npm) — which is most of a dev
# toolchain. LD_* is the Linux equivalent and is not restricted that way.
[env.LD_PRELOAD]
shape = "exec-path"
because = "loads an arbitrary shared object into the process before main"
[env.LD_AUDIT]
shape = "exec-path"
because = "loads an auditor library that observes and can alter symbol resolution"
[env.LD_LIBRARY_PATH]
shape = "exec-path"
because = "prepends a library search directory, so a planted .so satisfies a normal link"
[env.DYLD_INSERT_LIBRARIES]
shape = "exec-path"
because = "macOS loader injection; honored for user-installed binaries (measured)"
[env.DYLD_LIBRARY_PATH]
shape = "exec-path"
because = "macOS library search path"
[env.DYLD_FRAMEWORK_PATH]
shape = "exec-path"
because = "macOS framework search path"
# The rest of each loader's variables. glibc's LD_* and dyld's DYLD_* also include path searches
# (LD_ORIGIN_PATH, DYLD_FALLBACK_LIBRARY_PATH, DYLD_VERSIONED_*), a library-name swap
# (DYLD_IMAGE_SUFFIX), profiling (LD_PROFILE) and debug output written to a named file
# (LD_DEBUG_OUTPUT, LD_PROFILE_OUTPUT, DYLD_PRINT_TO_FILE). No build step sets one of these on a
# command line, so every name not listed above is refused whatever its value. LD_BIND_NOW and the
# like are refused with them; the cost is a debugging prefix that now asks.
[env."LD_*"]
shape = "opaque"
because = "the rest of glibc's loader variables: further library searches, LD_PROFILE, and debug output written to a named file"
measured = false
[env."DYLD_*"]
shape = "opaque"
because = "the rest of dyld's variables: fallback and versioned library searches, DYLD_IMAGE_SUFFIX, and DYLD_PRINT_TO_FILE"
measured = false

# ── C library: locale, conversion, resolver, allocator ───────────────────────
# glibc loads iconv converters as shared objects from GCONV_PATH, and getconf runs helper programs
# from GETCONF_DIR. Locale data and message catalogs are parsed binary files whose readers have had
# memory-safety bugs, so a foreign one is refused like code. GLIBC_TUNABLES and the MALLOC_*
# tunables only change allocator behaviour (their past exploit needed a setuid binary) and stay
# unlisted; MALLOC_TRACE names a file the process writes.
[env.GCONV_PATH]
shape = "exec-path"
because = "glibc iconv loads its converter modules (.so) from these directories"
measured = false
[env.GETCONF_DIR]
shape = "exec-path"
because = "glibc getconf runs the per-environment helper programs it finds in this directory"
measured = false
[env.NLSPATH]
shape = "exec-path"
because = "the template catopen() uses to find message catalogs, parsed binary files"
measured = false
[env.LOCPATH]
shape = "exec-path"
because = "glibc reads compiled locale data from here instead of the system locales"
measured = false
[env.MALLOC_TRACE]
shape = "data-write"
because = "glibc mtrace() writes its allocation trace to this file"
measured = false
[env.HOSTALIASES]
shape = "opaque"
because = "a file of host-name aliases the resolver applies, so a name resolves to another host"
measured = false
[env.RES_OPTIONS]
shape = "opaque"
because = "overrides resolv.conf options for the process"
measured = false
[env.LOCALDOMAIN]
shape = "opaque"
because = "replaces the resolver's search domains, so a short name resolves under another domain"
measured = false
[env."RESOLV_*"]
shape = "opaque"
because = "older glibc resolver settings (RESOLV_HOST_CONF names a host.conf to read)"
measured = false

# ── Shell ────────────────────────────────────────────────────────────────────
[env.BASH_ENV]
shape = "exec-path"
because = "sourced by non-interactive bash before the script runs (measured: executes)"
[env.ENV]
shape = "exec-path"
because = "the POSIX-sh equivalent of BASH_ENV"
[env.SHELLOPTS]
shape = "opaque"
because = "bash reads it at startup to turn options on, so SHELLOPTS=xtrace expands PS4 (a command substitution in it runs) before every command (measured: executes)"
[env.BASHOPTS]
shape = "opaque"
because = "bash reads it at startup to turn shopt options on, extdebug among them"
measured = false
[env.PS4]
shape = "opaque"
because = "expanded before each traced command, so a command substitution in it runs once tracing is on (measured: executes with SHELLOPTS=xtrace)"
[env."BASH_FUNC_*"]
shape = "opaque"
because = "bash imports BASH_FUNC_<name>%% as a function definition, so the command it names runs the value's body instead (measured: executes)"
[env."__BASH_FUNC*"]
shape = "opaque"
because = "the macOS /bin/bash spelling of BASH_FUNC_ (__BASH_FUNC<name>%%)"
measured = false

# ── Command substitution: the value IS a command ─────────────────────────────
[env.GIT_SSH_COMMAND]
shape = "command"
because = "git runs this instead of ssh"
[env.GIT_SSH]
shape = "command"
because = "older form of GIT_SSH_COMMAND"
[env.GIT_EXTERNAL_DIFF]
shape = "command"
because = "git runs this instead of its own diff"
[env.GIT_EDITOR]
shape = "command"
because = "git launches this for interactive operations"
[env.GIT_SEQUENCE_EDITOR]
shape = "command"
because = "git launches this for the rebase todo list"
[env.GIT_PAGER]
shape = "command"
because = "git pipes output through this"
[env.GIT_ASKPASS]
shape = "command"
because = "git runs this to obtain credentials"
[env.GIT_PROXY_COMMAND]
shape = "command"
because = "git runs this to open a connection"
[env.EDITOR]
shape = "command"
because = "launched by many tools for interactive edits"
[env.VISUAL]
shape = "command"
because = "as EDITOR"
[env.PAGER]
shape = "command"
because = "output is piped through it"
[env.LESSOPEN]
shape = "command"
because = "less runs this input preprocessor on the file it is asked to show"
[env.LESSCLOSE]
shape = "command"
because = "less runs this after the preprocessor"
[env.RUSTC_WRAPPER]
shape = "command"
because = "cargo invokes this in place of rustc (measured: executes). The flag spelling, --config build.rustc-wrapper, is already denied"
[env.RUSTC_WORKSPACE_WRAPPER]
shape = "command"
because = "as RUSTC_WRAPPER, for workspace members"
[env.CARGO_BUILD_RUSTC_WRAPPER]
shape = "command"
because = "the CARGO_* config-mirror spelling of RUSTC_WRAPPER"
[env.CARGO_MUTANTS_OUTPUT]
shape = "data-path"
because = "names the directory cargo-mutants creates mutants.out in — the environment spelling of its --output flag, which the cargo mutants entry deliberately omits. Left unlisted the assignment is simply ignored, so the write lands wherever it points"
[env.RUSTC]
shape = "command"
because = "replaces the compiler cargo invokes"
[env.CARGO_BUILD_RUSTC]
shape = "command"
because = "the CARGO_* config-mirror spelling of RUSTC"
measured = false
[env.CARGO_BUILD_RUSTC_WORKSPACE_WRAPPER]
shape = "command"
because = "the CARGO_* config-mirror spelling of RUSTC_WORKSPACE_WRAPPER"
measured = false
[env.RUSTDOC]
shape = "command"
because = "replaces the rustdoc cargo doc and cargo test --doc invoke"
measured = false
[env.CARGO_BUILD_RUSTDOC]
shape = "command"
because = "the CARGO_* config-mirror spelling of RUSTDOC"
measured = false
[env.CARGO_HOME]
shape = "config-dir"
because = "cargo reads config.toml from here, which can name a rustc wrapper, a linker, aliases and credential providers"
measured = false
[env.MANPAGER]
shape = "command"
because = "man pipes the page through this, ahead of PAGER"
measured = false
[env.GH_PAGER]
shape = "command"
because = "gh pipes output through this, ahead of PAGER"
measured = false
[env.SSH_ASKPASS]
shape = "command"
because = "ssh runs this program to ask for a passphrase. SSH_ASKPASS_REQUIRE only says when it runs, so it is not listed"
measured = false

# ── Code-supplying paths ─────────────────────────────────────────────────────
[env.PYTHONPATH]
shape = "exec-path"
because = "python auto-imports sitecustomize from this path at startup (measured: executes)"
[env.PYTHONHOME]
shape = "exec-path"
because = "relocates the interpreter's own standard library"
[env.PYTHONSTARTUP]
shape = "exec-path"
because = "executed at interactive interpreter start (measured: NOT executed for `python3 -c`)"
[env.RUBYLIB]
shape = "exec-path"
because = "ruby load path, so a planted file satisfies a later require"
[env.PERL5LIB]
shape = "exec-path"
because = "perl @INC, the lever that makes -M load attacker code"
[env.PERLLIB]
shape = "exec-path"
because = "perl's older @INC variable, read when PERL5LIB is unset"
measured = false
[env.PERL5DB]
shape = "opaque"
because = "perl code the debugger runs in place of perl5db.pl under -d"
measured = false
[env.PYTHONUSERBASE]
shape = "exec-path"
because = "the user site-packages root; python processes its .pth files at startup, and a .pth line starting with import runs"
measured = false
[env.PYTHONWARNINGS]
shape = "opaque"
because = "a warning filter whose category names a module.Class, which python imports to resolve it"
measured = false
[env.PYTHONBREAKPOINT]
shape = "opaque"
because = "names the callable breakpoint() imports and calls"
measured = false
[env.GEM_HOME]
shape = "exec-path"
because = "where rubygems installs and loads gems, so a planted gem satisfies a require"
measured = false
[env.GEM_PATH]
shape = "exec-path"
because = "additional gem directories rubygems loads from"
measured = false
[env.BUNDLE_GEMFILE]
shape = "exec-path"
because = "the Gemfile bundler evaluates as Ruby"
measured = false
[env.RUBYGEMS_GEMDEPS]
shape = "exec-path"
because = "a Gemfile rubygems evaluates as Ruby at interpreter start"
measured = false
[env.OPENSSL_CONF]
shape = "exec-path"
because = "an openssl.cnf can load engines and providers, which are shared objects"
measured = false
[env.OPENSSL_ENGINES]
shape = "exec-path"
because = "the directory OpenSSL loads engine shared objects from"
measured = false
[env.OPENSSL_MODULES]
shape = "exec-path"
because = "the directory OpenSSL 3 loads provider shared objects from"
measured = false
[env.PKG_CONFIG_PATH]
shape = "exec-path"
because = "pkg-config reads .pc files from here, and the compiler and linker flags they hold (-fplugin, -Wl,…) reach the build"
measured = false
[env.TERMINFO]
shape = "exec-path"
because = "curses reads compiled terminal descriptions from here, parsed binary files"
measured = false
[env.TERMINFO_DIRS]
shape = "exec-path"
because = "as TERMINFO, a list of directories"
measured = false
[env.MAGIC]
shape = "exec-path"
because = "file and libmagic read their compiled pattern database from here, a parsed binary file"
measured = false
[env.SSL_CERT_FILE]
shape = "exec-path"
because = "replaces the CA bundle OpenSSL trusts, so a planted root certificate makes a forged server pass"
measured = false
[env.SSL_CERT_DIR]
shape = "exec-path"
because = "as SSL_CERT_FILE, a directory of CA certificates"
measured = false
[env.CURL_CA_BUNDLE]
shape = "exec-path"
because = "as SSL_CERT_FILE, for curl"
measured = false
[env.VIMINIT]
shape = "opaque"
because = "Ex commands vim runs at startup in place of the vimrc, and :! runs a program"
measured = false
[env.EXINIT]
shape = "opaque"
because = "as VIMINIT, for vi and ex"
measured = false
[env.PERL_USE_UNSAFE_INC]
shape = "opaque"
because = "puts the working directory on perl's @INC, so `-MMod` loads and runs `./Mod.pm`; a switch, not a path, so its value names nothing to gate"
measured = false
[env.NODE_PATH]
shape = "exec-path"
because = "node module search path"
[env.NODE_REPL_EXTERNAL_MODULE]
shape = "exec-path"
because = "node loads this module in the REPL"
[env.CLASSPATH]
shape = "exec-path"
because = "JVM class search path (measured: a planted class on it was loaded and run)"
[env.DOTNET_STARTUP_HOOKS]
shape = "exec-path"
because = "the .NET host loads this assembly before main (measured: load attempted)"
[env.CORECLR_PROFILER_PATH]
shape = "exec-path"
measured = false
because = "CoreCLR loads this native profiler library"
[env.PHPRC]
shape = "exec-path"
because = "names a php.ini, which can set auto_prepend_file to execute code before every script (measured: executes)"
[env.PHP_INI_SCAN_DIR]
shape = "exec-path"
because = "a directory of additional php.ini files, same effect as PHPRC (measured: executes)"
# ── Config locations ─────────────────────────────────────────────────────────
# git and jj config can name programs they run (core.pager, diff tools, core.fsmonitor, aliases,
# ui.pager, merge-tools). A variable that moves where that config is read from passes only for a
# normal folder: never a temp root (which holds the session scratchpad) or a sibling project, where
# an agent can write a config file without being asked and then run it with `HOME=<there> git log`.
# `config-dir` is a directory whose config files programs read; `config-file` is the executor rule
# of `exec-path` with the same refusal added, since the executor rule alone admits the scratchpad.
[env.HOME]
shape = "config-dir"
because = "git reads $HOME/.gitconfig and jj $HOME/.config/jj, and both can name programs to run; so does nearly every other tool's per-user config"
[env.XDG_CONFIG_HOME]
shape = "config-dir"
because = "git reads $XDG_CONFIG_HOME/git/config and jj $XDG_CONFIG_HOME/jj/config.toml"
[env.GIT_CONFIG_GLOBAL]
shape = "config-file"
because = "git config can define aliases and core.pager, so a caller-controlled config file is code execution"
[env.GIT_CONFIG_SYSTEM]
shape = "config-file"
because = "as GIT_CONFIG_GLOBAL"
[env.ZDOTDIR]
shape = "config-dir"
because = "zsh sources .zshenv (and for a login or interactive shell .zprofile and .zshrc) from this directory"
measured = false
[env.GH_CONFIG_DIR]
shape = "config-dir"
because = "gh reads config.yml from here, whose aliases can run shell commands"
measured = false
[env.CURL_HOME]
shape = "config-dir"
because = "curl reads .curlrc from here, which can add options to every request, output files among them"
measured = false
[env.WGETRC]
shape = "config-file"
because = "a wgetrc sets wget options for every run, output paths and proxies among them"
measured = false
[env.PIP_CONFIG_FILE]
shape = "config-file"
because = "a pip.conf can point installs at another package index, whose packages run setup code"
measured = false
[env.npm_config_script_shell]
shape = "command"
because = "the shell npm runs package scripts with. npm reads its npm_config_* variables in any letter case"
measured = false
[env.npm_config_shell]
shape = "command"
because = "the shell npm exec and npm explore start"
measured = false
[env.npm_config_git]
shape = "command"
because = "the git program npm runs for git dependencies"
measured = false
[env.npm_config_userconfig]
shape = "config-file"
because = "the user .npmrc npm reads, which can set script-shell, node-options and the registry"
measured = false
[env.npm_config_globalconfig]
shape = "config-file"
because = "as npm_config_userconfig, for the global npmrc"
measured = false
[env.GIT_TEMPLATE_DIR]
shape = "config-file"
because = "git init and git clone copy this directory's hooks into the new repository, where git later runs them"
measured = false
[env.GIT_CONFIG]
shape = "config-file"
because = "the file git config reads and writes, which can define aliases and core.pager"
measured = false
[env.R_PROFILE_USER]
shape = "exec-path"
because = "R sources this at startup (measured: ran under Rscript)"

# ── Data paths ───────────────────────────────────────────────────────────────
# GIT_DIR and friends are exec-path, not data-path: a .git you point git at carries CONFIG, and git
# config defines aliases and core.pager. Pointing git at a foreign repo therefore runs foreign code —
# the same reasoning that makes cargo's --manifest-path an `exec` role rather than a read.
[env.GIT_DIR]
shape = "config-file"
because = "selects which repository — and therefore whose config, aliases and pager — git obeys"
[env.GIT_COMMON_DIR]
shape = "config-file"
because = "retargets the shared git dir, which holds config"
[env.GIT_EXEC_PATH]
shape = "config-file"
because = "git runs its helpers from this directory (git-upload-pack on fetch, git-remote-*), so a planted helper runs"
[env.GIT_WORK_TREE]
shape = "exec-path"
because = "retargets the working tree git acts on"
[env.GIT_INDEX_FILE]
shape = "data-path"
because = "retargets the index"
[env.GIT_OBJECT_DIRECTORY]
shape = "data-path"
because = "retargets object storage"
[env.GIT_ALTERNATE_OBJECT_DIRECTORIES]
shape = "data-path"
because = "additional object directories to read"
[env.GIT_ALLOW_PROTOCOL]
shape = "opaque"
because = "the transports git may use; listing ext lets a remote URL name a command git runs"
measured = false
[env."GIT_TRACE*"]
shape = "data-write"
because = "an absolute path sends git's trace (packets, curl, performance) to that file, which git creates or appends to"
measured = false
[env.SSLKEYLOGFILE]
shape = "data-write"
because = "curl, OpenSSL-based clients and browsers append TLS session secrets to this file"
measured = false
[env.BROWSER]
shape = "command"
because = "the program many tools (python webbrowser, git web--browse, gh) run to open a URL"
measured = false

# ── Env twins of flags we already gate ───────────────────────────────────────
# A tool that mirrors its config surface into the environment gives every guarded flag a second
# spelling. Found by sweeping for "a flag we deny that has an environment form"; in each case the
# danger was ALREADY documented in the command's own TOML and only the spelling went unchecked.

# `cargo test --config target.<triple>.runner=X` is denied; the env spelling was not. The runner
# executes the compiled test binary, so it is a plain command substitution. The `*` stands for the
# target triple, which is why an exact-name table could not reach it.
[env."CARGO_TARGET_*_RUNNER"]
shape = "command"
because = "cargo runs this to execute the built test/bench binary; the --config spelling is denied"
[env."CARGO_TARGET_*_LINKER"]
shape = "command"
because = "cargo invokes this as the linker for that target"

# `git -c <key>=<value>` is already classified PER KEY, with `core.pager`'s value recursed as a
# command. The environment spelling splits one assignment across three variables
# (GIT_CONFIG_COUNT / GIT_CONFIG_KEY_n / GIT_CONFIG_VALUE_n), so no single value can be judged on
# its own — `GIT_CONFIG_VALUE_0` is a command when the paired key is `core.pager` and inert when it
# is `user.name`. Presence denies, which matches the flag spelling: `git -c user.name=x log` already
# denies because that key is not on git's permitted list.
[env.GIT_CONFIG_COUNT]
shape = "opaque"
because = "injects arbitrary git config; the key/value pairing is split across other variables, so a single value cannot be certified"
[env."GIT_CONFIG_KEY_*"]
shape = "opaque"
because = "as GIT_CONFIG_COUNT"
[env."GIT_CONFIG_VALUE_*"]
shape = "opaque"
because = "as GIT_CONFIG_COUNT"
# The fourth spelling: git passes `-c` settings to its child processes in this variable, and obeys it
# when the caller sets it. One value carries any number of quoted pairs, `'core.pager'='sh -c x'` or
# `'safe.directory'='*'`.
[env.GIT_CONFIG_PARAMETERS]
shape = "opaque"
because = "injects arbitrary git config, as `git -c` does, for every git process that inherits it"
# fzf reads its options from the environment before its argument list, so every option the command
# line is checked for (`--bind`, `--preview`, `--listen`) has a second spelling here.
[env.FZF_DEFAULT_OPTS]
shape = "opaque"
because = "fzf parses this as options before its arguments, including ones that run commands"
[env.FZF_DEFAULT_OPTS_FILE]
shape = "opaque"
because = "a file of fzf options, read as FZF_DEFAULT_OPTS is"
[env.FZF_DEFAULT_COMMAND]
shape = "command"
because = "fzf runs this to list its input when stdin is a terminal"
[env.RIPGREP_CONFIG_PATH]
shape = "exec-path"
because = "a file of rg arguments, which can add --pre (a program rg runs on every file searched)"
[env.JJ_CONFIG]
shape = "config-file"
because = "a jj config file or directory, which can name programs jj runs (ui.pager, ui.diff-formatter, merge-tools)"
[env.JJ_EDITOR]
shape = "command"
because = "jj launches this for descriptions and interactive edits, ahead of ui.editor and EDITOR"
[env.ACK_PAGER]
shape = "command"
because = "ack pipes its output through this, as with --pager"
[env.ACK_PAGER_COLOR]
shape = "command"
because = "as ACK_PAGER, when output is colored"
[env.ACK_OPTIONS]
shape = "opaque"
because = "ack parses this as options before its arguments, including --pager"
[env.ACKRC]
shape = "exec-path"
because = "an ack config file, which can set --pager"

# ── Interpreter option strings ───────────────────────────────────────────────
# These carry a FLAG STRING for an interpreter, so the value is parsed as flags and every token must
# match a researched-inert entry. The dangerous flags are never enumerated — a switch invented
# tomorrow denies by not being listed, which is what keeps these entries from rotting.
#
# A PATH-VALUED FLAG GOES IN `path_flags`, NEVER IN `allowed`. `allowed` matches the flag NAME and
# never looks at the value, so listing a path-valued flag there hands out an unclassified filesystem
# target: `-Cincremental` was in `allowed` and admitted `RUSTFLAGS='-Cincremental=/etc/cron.d' cargo
# build`, an out-of-worktree write, while the command-line spelling `cargo build --target-dir /etc/x`
# was denied — the env-twin-of-a-guarded-flag bug this file exists to close.
#
# `path_flags = [{ flag = "-Cincremental", role = "write" }]` instead routes the VALUE through the
# ordinary locus rules, so the env spelling and the flag spelling agree: in-worktree allows,
# out-of-worktree denies. `role` is read or write, spelled as the registry's `PathRole` spells it.
# An undeclared flag still denies, so this opens nothing by itself.
#
# AN ENTRY IS A WHOLE FLAG UNLESS IT ENDS IN `*`. `-mod` admits `-mod` and `-mod=vendor`, but NOT
# `-modfile=/tmp/evil.mod`, which is a different flag that merely starts the same way. Write the `*`
# only where the VALUE GLUES ONTO THE FLAG with no delimiter to stop it — `-Xmx*` for `-Xmx2g`, `-D*`
# for rustc's `-Dwarnings`. Every `*` widens the entry to things nobody researched, so it is a claim
# that nothing else in that tool shares the spelling; check before adding one.
#
# The accepted sets below were determined empirically (see the design note), not read from manuals:
# the Node documentation's claim that --require and --import are refused in NODE_OPTIONS is false on
# v22.17.0, where both load and execute.

# Ruby refuses -e itself. The remaining code vectors are -r<file> and -I<dir>, both paths, so they
# are excluded here and the invocation falls to approval rather than being path-classified — a
# RUBYOPT is not the place to be loading worktree code from.
[env.RUBYOPT]
shape = "option-string"
allowed = ["-w", "-W*", "-v", "--verbose", "--debug", "-E*", "-U", "-T*", "--jit", "--yjit",
           "--enable=*", "--disable=*"]
because = "ruby flag string; -r and -I load code (measured: -r executes)"

# Perl refuses -e/-E itself. -I is the lever that makes -M/-m/-d: load attacker code, so it is
# excluded; -M alone is confined to the installed @INC but is excluded too, since its danger is
# entirely contextual.
[env.PERL5OPT]
shape = "option-string"
allowed = ["-w", "-W", "-t", "-T", "-C*", "-D*"]
because = "perl flag string; -I/-M/-m/-d: load code (measured: -I -MInject and -I -d:Inj execute)"

# Node refuses only --eval/--print, so nearly everything else is accepted by the interpreter and the
# allowlist has to be narrow. Three distinct danger classes are excluded: code loading (--require,
# --import, --experimental-loader), a network-exposed debugger (--inspect*, which grants execution
# to anyone who can reach the port), and permission-model relaxers (--allow-*).
[env.NODE_OPTIONS]
shape = "option-string"
allowed = ["--max-old-space-size", "--max-semi-space-size", "--enable-source-maps",
           "--stack-size", "--no-warnings", "--no-deprecation", "--trace-warnings",
           "--trace-deprecation", "--unhandled-rejections", "--use-openssl-ca", "--use-bundled-ca",
           "--disable-warning", "--title", "--v8-pool-size"]
because = "node flag string; --require/--import execute (measured), --inspect exposes a debugger, --allow-* relax the permission model"
[env.npm_config_node_options]
shape = "option-string"
allowed = ["--max-old-space-size", "--max-semi-space-size", "--enable-source-maps",
           "--stack-size", "--no-warnings", "--no-deprecation", "--trace-warnings",
           "--trace-deprecation", "--unhandled-rejections", "--use-openssl-ca", "--use-bundled-ca",
           "--disable-warning", "--title", "--v8-pool-size"]
because = "the NODE_OPTIONS npm passes to the scripts it runs"
measured = false

# `--config build.rustflags=[...]` is already denied; this is its environment twin. -C linker= and
# -C link-arg= invoke an arbitrary binary (measured: the linker ran), and -Z / --extern reach
# further, so only the diagnostic and codegen-tuning flags are listed.
[env.RUSTFLAGS]
shape = "option-string"
allowed = ["-Copt-level", "-Cdebuginfo", "-Cdebug-assertions", "-Coverflow-checks",
           "-Ctarget-cpu", "-Ctarget-feature", "-Ccodegen-units", "-Cpanic", "-Cstrip",
           "-Clto", "-D*", "-W*", "-A*", "-F*", "--cfg"]
path_flags = [{ flag = "-Cincremental", role = "write" }]
because = "rustc flag string; -C linker= runs an arbitrary binary (measured). The --config build.rustflags spelling is already denied"
[env.CARGO_BUILD_RUSTFLAGS]
shape = "option-string"
allowed = ["-Copt-level", "-Cdebuginfo", "-Cdebug-assertions", "-Coverflow-checks",
           "-Ctarget-cpu", "-Ctarget-feature", "-Ccodegen-units", "-Cpanic", "-Cstrip",
           "-Clto", "-D*", "-W*", "-A*", "-F*", "--cfg"]
path_flags = [{ flag = "-Cincremental", role = "write" }]
because = "the CARGO_* config-mirror spelling of RUSTFLAGS"
[env.CARGO_ENCODED_RUSTFLAGS]
shape = "option-string"
allowed = ["-Copt-level", "-Cdebuginfo", "-Cdebug-assertions", "-Coverflow-checks",
           "-Ctarget-cpu", "-Ctarget-feature", "-Ccodegen-units", "-Cpanic", "-Cstrip",
           "-Clto", "-D*", "-W*", "-A*", "-F*", "--cfg"]
path_flags = [{ flag = "-Cincremental", role = "write" }]
because = "cargo reads this ahead of RUSTFLAGS and build.rustflags"
measured = false
[env.RUSTDOCFLAGS]
shape = "option-string"
allowed = ["-D*", "-W*", "-A*", "-F*", "--cfg", "--document-private-items"]
because = "rustdoc flag string, same family as RUSTFLAGS"
[env.CARGO_BUILD_RUSTDOCFLAGS]
shape = "option-string"
allowed = ["-D*", "-W*", "-A*", "-F*", "--cfg", "--document-private-items"]
because = "the CARGO_* config-mirror spelling of RUSTDOCFLAGS"
measured = false
[env.CARGO_ENCODED_RUSTDOCFLAGS]
shape = "option-string"
allowed = ["-D*", "-W*", "-A*", "-F*", "--cfg", "--document-private-items"]
because = "cargo reads this ahead of RUSTDOCFLAGS and build.rustdocflags"
measured = false
[env.CFLAGS]
shape = "option-string"
allowed = ["-O*", "-g*", "-Wall", "-Wextra", "-Werror*", "-Wno-*", "-Wpedantic", "-Wshadow", "-Wconversion",
           "-Wformat*", "-Wunused*", "-w", "-std=*", "-pedantic", "-pipe", "-fPIC", "-fPIE", "-fno-*",
           "-march=*", "-mtune=*", "-D*", "-U*", "-pthread"]
path_flags = [{ flag = "-I", role = "exec", sep = "space" }, { flag = "-L", role = "exec", sep = "space" }]
because = "C compiler flags read by make and cargo build scripts; -fplugin, -B, --specs and -Wl, load code or invoke a linker"
measured = false
[env.CXXFLAGS]
shape = "option-string"
allowed = ["-O*", "-g*", "-Wall", "-Wextra", "-Werror*", "-Wno-*", "-Wpedantic", "-Wshadow", "-Wconversion",
           "-Wformat*", "-Wunused*", "-w", "-std=*", "-pedantic", "-pipe", "-fPIC", "-fPIE", "-fno-*",
           "-march=*", "-mtune=*", "-D*", "-U*", "-pthread"]
path_flags = [{ flag = "-I", role = "exec", sep = "space" }, { flag = "-L", role = "exec", sep = "space" }]
because = "as CFLAGS, for C++"
measured = false
[env.CPPFLAGS]
shape = "option-string"
allowed = ["-Wall", "-Wextra", "-Werror*", "-Wno-*", "-w", "-D*", "-U*"]
path_flags = [{ flag = "-I", role = "exec", sep = "space" }]
because = "as CFLAGS, for the C preprocessor"
measured = false
[env.LDFLAGS]
shape = "option-string"
allowed = ["-s", "-S", "-pthread", "-rdynamic", "-shared", "-static", "-pie", "-no-pie", "-flto*"]
path_flags = [{ flag = "-L", role = "exec", sep = "space" }]
because = "linker flags read by make and build scripts"
measured = false
[env.PYTEST_ADDOPTS]
shape = "option-string"
allowed = ["-v", "-q", "-s", "-x", "--tb=*", "-k", "-m", "--maxfail", "--durations", "--strict-markers", "--no-header", "-r*"]
because = "pytest prepends these options to its command line; -p loads a plugin module and -c/--rootdir read a foreign conftest.py"
measured = false

# Applies to EVERY JVM started while set. Enumerated from the Oracle java launcher reference, then
# MEASURED on OpenJDK 26.0.2: all three variables were confirmed to execute a `-javaagent:` jar.
#
# `-XX:` CANNOT be a blanket prefix. Most -XX flags are GC/JIT tuning, but `-XX:OnError=<cmd>` and
# `-XX:OnOutOfMemoryError=<cmd>` run a custom command — direct execution wearing the same prefix as
# the harmless ones. BOTH were measured to run a script (OnOutOfMemoryError under a 16m heap;
# OnError under -XX:+CrashOnOutOfMemoryError). So the tuning flags are listed individually.
#
# `-XX:+ScavengeBeforeFullGC` is kept although OpenJDK 26 reports it "Unrecognized" — it dates to the
# ParallelGC era. An unrecognized VM option makes the JVM REFUSE TO START, so it cannot become a
# route to execution, and users on older JDKs still get the flag.
#
# `-D<name>=<value>` is NOT allowlisted, despite tuning guides calling system properties harmless.
# Properties reach security-relevant machinery (`java.rmi.server.codebase` historically enabled
# remote class loading, `jdk.attach.allowAttachSelf` opens self-attach), and telling which is which
# needs per-property research nobody has done.
#
# Excluded as code loaders: -javaagent:, -agentlib:, -agentpath:, -Xbootclasspath/a:, --module-path,
# --upgrade-module-path, @argfile, -XX:VMOptionsFile=, -XX:CompilerDirectivesFile=.
#
# -cp/-classpath/--class-path are NOT excluded — they are GATED, on JDK_JAVA_OPTIONS only. They are
# the flag spelling of CLASSPATH, which is already an `exec-path` entry, so refusing them here while
# admitting `CLASSPATH=./lib` was the same one-spelling-checked inconsistency this file exists to
# close; measured live on `mvn test` and `gradle build`, both of which auto-approve.
[env.JAVA_TOOL_OPTIONS]
shape = "option-string"
allowed = [
  "-Xms*", "-Xmx*", "-Xmn*", "-Xss*", "-verbose:*",
  "-XX:MaxDirectMemorySize", "-XX:ThreadStackSize", "-XX:MaxGCPauseMillis",
  "-XX:ReservedCodeCacheSize", "-XX:InitialCodeCacheSize", "-XX:CompileThresholdScaling",
  "-XX:+UseG1GC", "-XX:+UseSerialGC", "-XX:+UseParallelGC", "-XX:+UseZGC",
  "-XX:+ScavengeBeforeFullGC", "-XX:+UseStringDeduplication",
  "-XX:+TieredCompilation", "-XX:-TieredCompilation",
  "-XX:+PrintCommandLineFlags", "-XX:+PrintCompilation", "-XX:+HeapDumpOnOutOfMemoryError",
]
path_flags = [{ flag = "-XX:HeapDumpPath", role = "write" }]
because = "applies to every JVM started while set; -javaagent loads code and -XX:OnError/-XX:OnOutOfMemoryError run a command (all measured)"
[env._JAVA_OPTIONS]
shape = "option-string"
allowed = [
  "-Xms*", "-Xmx*", "-Xmn*", "-Xss*", "-verbose:*",
  "-XX:MaxDirectMemorySize", "-XX:ThreadStackSize", "-XX:MaxGCPauseMillis",
  "-XX:ReservedCodeCacheSize", "-XX:InitialCodeCacheSize", "-XX:CompileThresholdScaling",
  "-XX:+UseG1GC", "-XX:+UseSerialGC", "-XX:+UseParallelGC", "-XX:+UseZGC",
  "-XX:+ScavengeBeforeFullGC", "-XX:+UseStringDeduplication",
  "-XX:+TieredCompilation", "-XX:-TieredCompilation",
  "-XX:+PrintCommandLineFlags", "-XX:+PrintCompilation", "-XX:+HeapDumpOnOutOfMemoryError",
]
path_flags = [{ flag = "-XX:HeapDumpPath", role = "write" }]
because = "as JAVA_TOOL_OPTIONS; takes precedence over it (measured: -javaagent ran)"
[env.JAVA_OPTS]
shape = "option-string"
allowed = [
  "-Xms*", "-Xmx*", "-Xmn*", "-Xss*", "-verbose:*",
  "-XX:MaxDirectMemorySize", "-XX:ThreadStackSize", "-XX:MaxGCPauseMillis",
  "-XX:ReservedCodeCacheSize", "-XX:InitialCodeCacheSize", "-XX:CompileThresholdScaling",
  "-XX:+UseG1GC", "-XX:+UseSerialGC", "-XX:+UseParallelGC", "-XX:+UseZGC",
  "-XX:+ScavengeBeforeFullGC", "-XX:+UseStringDeduplication",
  "-XX:+TieredCompilation", "-XX:-TieredCompilation",
  "-XX:+PrintCommandLineFlags", "-XX:+PrintCompilation", "-XX:+HeapDumpOnOutOfMemoryError",
]
path_flags = [{ flag = "-XX:HeapDumpPath", role = "write" }]
because = "passed to the JVM launcher by wrapper scripts and build tools"
measured = false
[env.GRADLE_OPTS]
shape = "option-string"
allowed = [
  "-Xms*", "-Xmx*", "-Xmn*", "-Xss*", "-verbose:*",
  "-XX:MaxDirectMemorySize", "-XX:ThreadStackSize", "-XX:MaxGCPauseMillis",
  "-XX:ReservedCodeCacheSize", "-XX:InitialCodeCacheSize", "-XX:CompileThresholdScaling",
  "-XX:+UseG1GC", "-XX:+UseSerialGC", "-XX:+UseParallelGC", "-XX:+UseZGC",
  "-XX:+ScavengeBeforeFullGC", "-XX:+UseStringDeduplication",
  "-XX:+TieredCompilation", "-XX:-TieredCompilation",
  "-XX:+PrintCommandLineFlags", "-XX:+PrintCompilation", "-XX:+HeapDumpOnOutOfMemoryError",
]
path_flags = [{ flag = "-XX:HeapDumpPath", role = "write" }]
because = "passed to the JVM running the Gradle client and daemon"
measured = false
[env.MAVEN_OPTS]
shape = "option-string"
allowed = [
  "-Xms*", "-Xmx*", "-Xmn*", "-Xss*", "-verbose:*",
  "-XX:MaxDirectMemorySize", "-XX:ThreadStackSize", "-XX:MaxGCPauseMillis",
  "-XX:ReservedCodeCacheSize", "-XX:InitialCodeCacheSize", "-XX:CompileThresholdScaling",
  "-XX:+UseG1GC", "-XX:+UseSerialGC", "-XX:+UseParallelGC", "-XX:+UseZGC",
  "-XX:+ScavengeBeforeFullGC", "-XX:+UseStringDeduplication",
  "-XX:+TieredCompilation", "-XX:-TieredCompilation",
  "-XX:+PrintCommandLineFlags", "-XX:+PrintCompilation", "-XX:+HeapDumpOnOutOfMemoryError",
]
path_flags = [{ flag = "-XX:HeapDumpPath", role = "write" }]
because = "passed to the JVM running Maven"
measured = false
[env.JDK_JAVA_OPTIONS]
shape = "option-string"
allowed = [
  "-Xms*", "-Xmx*", "-Xmn*", "-Xss*", "-verbose:*",
  "-XX:MaxDirectMemorySize", "-XX:ThreadStackSize", "-XX:MaxGCPauseMillis",
  "-XX:ReservedCodeCacheSize", "-XX:InitialCodeCacheSize", "-XX:CompileThresholdScaling",
  "-XX:+UseG1GC", "-XX:+UseSerialGC", "-XX:+UseParallelGC", "-XX:+UseZGC",
  "-XX:+ScavengeBeforeFullGC", "-XX:+UseStringDeduplication",
  "-XX:+TieredCompilation", "-XX:-TieredCompilation",
  "-XX:+PrintCommandLineFlags", "-XX:+PrintCompilation", "-XX:+HeapDumpOnOutOfMemoryError",
]
path_flags = [
  { flag = "-XX:HeapDumpPath", role = "write" },
  # LAUNCHER options, accepted here and NOWHERE ELSE (measured on OpenJDK 26.0.2: `-cp` in
  # JAVA_TOOL_OPTIONS/_JAVA_OPTIONS is "Unrecognized option" and the JVM refuses to start, while
  # here it loaded and ran a planted class). Gated at the executor locus, so they agree with the
  # CLASSPATH entry: `./lib` allows, `/tmp/evil` denies.
  { flag = "-cp", role = "exec", sep = "space" },
  { flag = "-classpath", role = "exec", sep = "space" },
  { flag = "--class-path", role = "exec", sep = "space" },
]
because = "the LAUNCHER-processed spelling: a superset of JAVA_TOOL_OPTIONS that also takes -cp (measured: -javaagent ran; -cp ran a planted class)"

# Go's default build flags, measured on go1.26.5. `-toolexec` invokes an arbitrary program in place
# of the toolchain — the direct analogue of RUSTC_WRAPPER — `-exec` runs the built binary through
# one, and `-overlay` maps disk paths to different backing files, substituting source before
# compilation. `-toolexec` and `-overlay` were both confirmed: the overlay probe printed the planted
# source, not the file on disk. `-ldflags`/`-gcflags` pass through to the linker and compiler and are
# excluded for the reason RUSTFLAGS' `-C link-arg` is.
#
# The whole-flag rule matters most here: `-mod` must not admit `-modfile`, which was measured to
# change the module the build resolves (`go list -m` reported the planted module name).
[env.GOFLAGS]
shape = "option-string"
allowed = ["-v", "-x", "-n", "-count", "-tags", "-race", "-mod", "-short", "-timeout",
           "-run", "-skip", "-buildvcs", "-trimpath", "-json"]
because = "-toolexec runs an arbitrary program and -overlay substitutes source files before compilation (both measured); -exec runs the built binary through one"

# LUA_INIT is code OR a path depending on its first character: a leading `@` names a file to run,
# anything else IS Lua source executed at interpreter start. Both forms were measured to run on Lua
# 5.5.0. One shape cannot express that, and Lua source is not something this classifier reads, so
# presence denies.
[env.LUA_INIT]
shape = "opaque"
because = "executes its contents as Lua, or runs the file named by a leading @, at interpreter start (measured: BOTH forms ran)"

[env.JULIA_LOAD_PATH]
shape = "exec-path"
because = "julia module search path (measured: a planted module satisfied a `using` and ran)"
[env.JULIA_DEPOT_PATH]
shape = "exec-path"
because = "the depot CONTAINS config/startup.jl, so pointing it anywhere runs that file at startup — no import needed (measured)"
[env.CORECLR_ENABLE_PROFILING]
shape = "opaque"
measured = false
because = "arms the CoreCLR profiler pair; the library it loads is named by CORECLR_PROFILER_PATH, so neither value certifies alone"
[env.CARGO_REGISTRY_CREDENTIAL_PROVIDER]
shape = "command"
because = "cargo runs this executable to obtain registry credentials"
measured = false
[env.CARGO_TARGET_DIR]
shape = "data-write"
single_value = true
because = "names the directory cargo writes build artifacts into (the --target-dir twin)"
measured = false
[env.CARGO_BUILD_TARGET_DIR]
shape = "data-write"
single_value = true
because = "the CARGO_* config-mirror spelling of CARGO_TARGET_DIR"
measured = false
[env.RUSTUP_HOME]
shape = "config-dir"
single_value = true
because = "rustup resolves toolchains under $RUSTUP_HOME/toolchains, so pointing it at a scratch directory runs binaries from there"
measured = false
[env.CC]
shape = "exec-path"
single_value = true
because = "the C compiler invoked by make and cargo build scripts"
measured = false
[env.CXX]
shape = "exec-path"
single_value = true
because = "the C++ compiler invoked by make and cargo build scripts"
measured = false
[env.LD]
shape = "exec-path"
single_value = true
because = "the linker invoked by make and build scripts"
measured = false
[env.AR]
shape = "exec-path"
single_value = true
because = "the archiver invoked by make and cargo build scripts"
measured = false
[env.JAVA_HOME]
shape = "exec-path"
single_value = true
because = "selects the JDK directory whose bin/java the wrapper and build tools execute"
measured = false
[env.GRADLE_USER_HOME]
shape = "config-dir"
single_value = true
because = "gradle runs init.gradle and reads gradle.properties from this directory"
measured = false
[env.YARN_YARN_PATH]
shape = "exec-path"
single_value = true
because = "yarn executes this script in place of itself"
measured = false
[env.npm_config_node_gyp]
shape = "exec-path"
single_value = true
because = "the node-gyp program npm runs for native addons"
measured = false
[env.BUNDLE_APP_CONFIG]
shape = "config-dir"
single_value = true
because = "bundler reads its config file from this directory"
measured = false
[env.PYTEST_PLUGINS]
shape = "exec-path"
because = "pytest imports every plugin module named here at startup"
measured = false
[env.PYTHONPYCACHEPREFIX]
shape = "data-write"
single_value = true
because = "python writes compiled .pyc files under this directory"
measured = false
[env.COVERAGE_PROCESS_START]
shape = "exec-path"
single_value = true
because = "coverage.py's startup hook reads this config file at interpreter start"
measured = false
[env.HGRCPATH]
shape = "config-file"
because = "mercurial reads .hgrc files from here, whose [hooks] and [extensions] run commands and Python files"
measured = false
[env.TF_CLI_CONFIG_FILE]
shape = "config-file"
single_value = true
because = "terraform reads CLI config from here, whose dev_overrides replace provider binaries"
measured = false
[env.AWS_CONFIG_FILE]
shape = "config-file"
single_value = true
because = "aws reads config from here, which can set credential_process to run a command"
measured = false
[env.AWS_SHARED_CREDENTIALS_FILE]
shape = "config-file"
single_value = true
because = "as AWS_CONFIG_FILE"
measured = false
[env.AWS_PAGER]
shape = "command"
because = "aws pipes output through this, ahead of PAGER"
measured = false
[env.BAT_PAGER]
shape = "command"
because = "bat pipes output through this, ahead of PAGER"
measured = false
[env.DELTA_PAGER]
shape = "command"
because = "delta pipes output through this, ahead of PAGER"
measured = false
[env.BAT_CONFIG_PATH]
shape = "exec-path"
single_value = true
because = "a file of bat options, which can set --pager"
measured = false
[env.LESS]
shape = "opaque"
because = "less parses this as options before its arguments, including +cmd and -o log-file"
measured = false
[env.LESSKEYIN]
shape = "exec-path"
single_value = true
because = "less reads key bindings and shell-escape macros from this file"
measured = false
[env.LESSKEY]
shape = "exec-path"
single_value = true
because = "older compiled lesskey file path"
measured = false
[env.DOCKER_HOST]
shape = "opaque"
because = "redirects docker to another daemon or an ssh:// transport"
measured = false
[env.GOROOT]
shape = "exec-path"
single_value = true
because = "relocates the Go toolchain binaries and standard library"
measured = false
[env.GOENV]
shape = "exec-path"
single_value = true
because = "a file of default Go environment variables, GOFLAGS among them"
measured = false
[env.GOTOOLCHAIN]
shape = "opaque"
because = "selects or downloads the Go toolchain binary go executes"
measured = false
[env.MAKEFILES]
shape = "exec-path"
because = "make reads and evaluates these makefiles before the main Makefile"
measured = false
[env.MAKEFLAGS]
shape = "opaque"
because = "make parses this as options, including -f and -C"
measured = false
[env.MFLAGS]
shape = "opaque"
because = "as MAKEFLAGS"
measured = false
[env.GNUMAKEFLAGS]
shape = "opaque"
because = "GNU make parses this as options before MAKEFLAGS"
measured = false

# ── Env twins of executor FLAGS ──────────────────────────────────────────────
# Each of these is the environment spelling of a flag that is already gated at the
# executor locus. Gating one spelling and not the other is not a partial fix: the
# ungated spelling is a complete bypass, and the flag gate reads as closed while it
# is not. `exec-path` (not `command`) so both spellings judge the value the same
# way — a bare name on $PATH stays trusted, a path into /tmp does not.
[env.BORG_RSH]
shape = "exec-path"
single_value = true
twin_flag = "borg --rsh {v} check repo"
twin_base = "borg check repo"
because = "borg runs this instead of ssh to reach the repository (the --rsh twin)"
[env.BORG_REMOTE_PATH]
shape = "exec-path"
single_value = true
twin_flag = "borg --remote-path {v} list repo"
twin_base = "borg list repo"
because = "the borg executable invoked on the far side (the --remote-path twin)"
[env.RESTIC_PASSWORD_COMMAND]
shape = "exec-path"
single_value = true
twin_flag = "restic --password-command {v} snapshots"
twin_base = "restic snapshots"
because = "restic runs this to obtain the repository password (the --password-command twin)"
[env.RSYNC_RSH]
shape = "exec-path"
single_value = true
twin_flag = "rsync -e {v} ./src/ ./dst/"
twin_base = "rsync ./src/ ./dst/"
because = "the remote shell rsync executes (the --rsh/-e twin)"
[env.KUBECONFIG]
shape = "exec-path"
because = "a kubeconfig can carry a users[].user.exec credential plugin the client RUNS (the --kubeconfig twin)"