Commit 37b5cbe
feat(gate): opt-in CONTEXTCRAWLER_TRUST_UNATTESTABLE for unattended runs
The rtk-ai#2286 can't-attest Ask (command substitution / file-write redirect)
has no escape hatch, so trusted overnight/headless workflows that
legitimately read credentials, write files, or curl with substitution
(structurally identical to the exfil shape the gate guards) hang on a
prompt no one can answer.
Add an opt-in env var CONTEXTCRAWLER_TRUST_UNATTESTABLE=1 (or "true")
that skips ONLY the can't-attest Ask, letting such commands fall through
to normal per-segment allow-matching and then the host's own permission
mode. Off by default; safe-by-default is unchanged. Deny rules still fire
regardless — trust never overrides a hard deny.
The env read is split out (`unattestable_gate_trusted`) so the core
`check_command_with_rules_trusted(.., trusted)` stays pure and testable
with no env mutation. The rtk-ai#2286 Ask message now names the escape hatch so
it's discoverable when hit. Mirrors the existing
CONTEXTCRAWLER_TIRITH_DISABLED / CONTEXTCRAWLER_SUPPLY_CHAIN opt-outs.
Tests: trust skips the Ask (sub + redirect), full allow-set reaches
Allow, and deny still wins under trust.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent ca5873f commit 37b5cbe
2 files changed
Lines changed: 90 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
658 | 658 | | |
659 | 659 | | |
660 | 660 | | |
661 | | - | |
| 661 | + | |
| 662 | + | |
662 | 663 | | |
663 | 664 | | |
664 | 665 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
107 | 119 | | |
| 120 | + | |
| 121 | + | |
108 | 122 | | |
109 | 123 | | |
110 | 124 | | |
111 | 125 | | |
112 | 126 | | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
113 | 145 | | |
114 | 146 | | |
115 | 147 | | |
| |||
142 | 174 | | |
143 | 175 | | |
144 | 176 | | |
145 | | - | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
146 | 186 | | |
147 | 187 | | |
148 | 188 | | |
| |||
2043 | 2083 | | |
2044 | 2084 | | |
2045 | 2085 | | |
| 2086 | + | |
| 2087 | + | |
| 2088 | + | |
| 2089 | + | |
| 2090 | + | |
| 2091 | + | |
| 2092 | + | |
| 2093 | + | |
| 2094 | + | |
| 2095 | + | |
| 2096 | + | |
| 2097 | + | |
| 2098 | + | |
| 2099 | + | |
| 2100 | + | |
| 2101 | + | |
| 2102 | + | |
| 2103 | + | |
| 2104 | + | |
| 2105 | + | |
| 2106 | + | |
| 2107 | + | |
| 2108 | + | |
| 2109 | + | |
| 2110 | + | |
| 2111 | + | |
| 2112 | + | |
| 2113 | + | |
| 2114 | + | |
| 2115 | + | |
| 2116 | + | |
| 2117 | + | |
| 2118 | + | |
| 2119 | + | |
| 2120 | + | |
| 2121 | + | |
| 2122 | + | |
| 2123 | + | |
| 2124 | + | |
| 2125 | + | |
| 2126 | + | |
| 2127 | + | |
| 2128 | + | |
| 2129 | + | |
| 2130 | + | |
| 2131 | + | |
| 2132 | + | |
2046 | 2133 | | |
2047 | 2134 | | |
2048 | 2135 | | |
| |||
0 commit comments