@jjanczur/tyran 0.1.48 → 0.1.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,7 +11,7 @@
11
11
  {
12
12
  "name": "tyran",
13
13
  "description": "A task conductor for Claude Code: multi-agent orchestration with an enforced evidence contract, repo-specific learning, and update-safe local evolution.",
14
- "version": "0.1.48",
14
+ "version": "0.1.50",
15
15
  "source": "./",
16
16
  "author": {
17
17
  "name": "Jacek Janczura",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tyran",
3
- "version": "0.1.48",
3
+ "version": "0.1.50",
4
4
  "description": "A task conductor for Claude Code: multi-agent orchestration with an enforced evidence contract, repo-specific learning, and update-safe local evolution.",
5
5
  "author": {
6
6
  "name": "Jacek Janczura",
package/CHANGELOG.md CHANGED
@@ -1,5 +1,83 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.50 — 2026-11-19
4
+
5
+ ### `boundaries.kernel: allow` — no floor in a bypassPermissions session
6
+
7
+ An operator asked for a way to remove the last distinction: when they start a
8
+ session in bypass mode, agents should be able to edit any file, the gates
9
+ included. Until now no setting could do that. `preset: open` and every flag
10
+ stopped at the floor: `hooks/**`, `.tyran/policies/**`,
11
+ `.claude/settings*.json` and `.tyran/STOP`.
12
+
13
+ The new key `boundaries.kernel` (`refuse` | `allow`, default `refuse`) removes
14
+ the floor and every path class in the policy for paths inside the repository,
15
+ on the write tools and in the text of a shell command. It counts only when the
16
+ call's `permission_mode` is `bypassPermissions`. Both are required. The key
17
+ alone does nothing in `default`, `acceptEdits` or `plan`, so an overnight resume
18
+ (`acceptEdits`) never gets it. Bypass alone does nothing, so an install that
19
+ runs in bypass and never set the key keeps its floor. Subagents inherit the
20
+ session's mode. No preset sets the key, so a repo already on `preset: open`
21
+ gains nothing by updating.
22
+
23
+ `.tyran/STOP` is included, by the operator's choice: under the unlock an agent
24
+ can clear the brake.
25
+
26
+ What it does not change: secret scanning at commit and push; the credential,
27
+ outside-repo and push rules, which keep their own flags; the other hooks.
28
+
29
+ The cost: `.tyran/config.yaml` is class `AUTO`. Inside a bypass session an
30
+ agent can write `kernel: allow` itself and edit the gates on its next call. In
31
+ bypass the key is a default, not a lock. `docs/configuration.md` says so.
32
+
33
+ Also: doctor's `boundaries-relaxed` names what `kernel` opens, the Settings tab
34
+ has the knob, and `scan-repo` and `templates/config.yaml` write `kernel: refuse`.
35
+
36
+ ### `usage-gate` reads `warn` before the pause marker
37
+
38
+ The second half of the 0.1.49 fix. The gate read `limits.mode: warn` only when
39
+ no marker existed, so a marker already on disk, from `pause` mode or from
40
+ 0.1.48, still refused every unattended session in the repo. It now returns PASS
41
+ for any mode other than `pause` before it reads the marker. The marker is
42
+ ignored, not deleted; `overnight.mjs cancel --clear` still removes it.
43
+
44
+ Both gate changes are in `hooks/scripts/`, which is KERNEL in this repository,
45
+ and were applied by hand.
46
+
47
+ Five new tests. The kernel key needs both conditions; the test names its two
48
+ mutants (drop either check), which were not run because the gate is KERNEL
49
+ here. It opens the floor for every actor and tool, and nothing else. No preset
50
+ moves it; that mutant (`kernel: 'allow'` in the open preset) was run and goes
51
+ red. An active marker under `warn` passes while the same marker under `pause`
52
+ still denies; on the unpatched gate that test is red.
53
+
54
+ ## 0.1.49 — 2026-11-14
55
+
56
+ ### `limits.mode: warn` no longer writes a pause marker that blocks the whole repo
57
+
58
+ Reported from a real install running `warn`. One Claude account reached 100%
59
+ of its weekly window. The wall watcher (`limitSweep`, run by the board's timer
60
+ and by `overnight.mjs watch-limit`) then wrote `.tyran/state/paused-until.json`
61
+ with a resume five days out. The marker is per repo, the account is per
62
+ session, and `usage-gate` denies on the marker alone, so every unattended
63
+ session in the repo was refused, including sessions on accounts that still had
64
+ quota. It held for several minutes, until someone removed the marker by hand.
65
+
66
+ The cause was one condition. `limitSweep` skipped `mode: off` and treated
67
+ every other mode as `pause`. It now writes a marker only under `pause` and
68
+ returns `reason: 'limits-warn'` under `warn`. `watch-limit` refuses to start
69
+ under `warn` with the same message it gives under `off`, because it would have
70
+ nothing to do.
71
+
72
+ Still open: `usage-gate` reads `warn` only when NO marker exists. A marker
73
+ already on disk, from `pause` mode or from 0.1.48, still binds every
74
+ unattended session under `warn` until `overnight.mjs cancel --clear` removes
75
+ it. The fix is in `hooks/scripts/`, which is KERNEL in this repo, so it is a
76
+ human edit and is not in this release.
77
+
78
+ One new test: a wall under `warn` writes no marker, journals nothing and sends
79
+ no notification. Its mutant (the 0.1.48 `=== 'off'` condition) goes red.
80
+
3
81
  ## 0.1.48 — 2026-09-25
4
82
 
5
83
  ### `mistakes.mjs` writes no em dash, and reads a rule whose dash a human fixed
package/README.md CHANGED
@@ -329,7 +329,7 @@ enforces the cap (3947 of 5000 characters). What each one assumes, when it
329
329
  fires and who invokes it, is in
330
330
  [skills and agents](https://jjanczur.github.io/tyran/skills/); the prompts
331
331
  themselves are in [`skills/`](skills/) and [`agents/`](agents/). Behind all of
332
- it: 1715 unit tests, run with `node --test "tests/**/*.test.mjs"`.
332
+ it: 1721 unit tests, run with `node --test "tests/**/*.test.mjs"`.
333
333
 
334
334
  ## Documentation
335
335
 
@@ -1113,8 +1113,22 @@ export async function decide({ input, runner = runChild, startedAt = Date.now(),
1113
1113
  const askable = actor === 'main' && field(input, 'permission_mode') === 'acceptEdits';
1114
1114
 
1115
1115
  const boundaries = await loadBoundaries(root);
1116
+ // `boundaries.kernel: allow` is the operator taking the floor out, and it
1117
+ // counts only in a session a human started with --permission-mode
1118
+ // bypassPermissions. Both, because each alone says less than the operator
1119
+ // meant: the key alone would reach an overnight resume (acceptEdits) or a
1120
+ // subagent of a supervised session, and bypass alone would reach every
1121
+ // install that runs in bypass and never chose this. Subagents inherit the
1122
+ // session's mode (measured, see SUPERVISED_MODES), so the actors doing the
1123
+ // work are covered.
1124
+ //
1125
+ // STATED, NOT HIDDEN: config.yaml is class AUTO, so inside a bypass session
1126
+ // an agent can write `kernel: allow` itself and be unlocked on its next
1127
+ // call. The key constrains every OTHER mode; in bypass it is a default, not
1128
+ // a lock. docs/configuration.md says the same.
1129
+ const kernelOpen = boundaries.kernel === 'allow' && field(input, 'permission_mode') === 'bypassPermissions';
1116
1130
 
1117
- if (toolName === 'Bash') return await decideBash({ input, toolInput, root, runner, budget, boundaries });
1131
+ if (toolName === 'Bash') return await decideBash({ input, toolInput, root, runner, budget, boundaries, kernelOpen });
1118
1132
 
1119
1133
  const targets = pathTargets(toolInput);
1120
1134
  const isWriteTool = typeof toolName === 'string' && WRITE_TOOLS.includes(toolName);
@@ -1234,6 +1248,12 @@ export async function decide({ input, runner = runChild, startedAt = Date.now(),
1234
1248
  if (normalized !== null && decidingRule(policy, normalized) === null && !isGoverned(normalized)) {
1235
1249
  continue;
1236
1250
  }
1251
+ // The one setting below the floor. Inside the repository, every class and
1252
+ // every floor path stands down: hooks/**, .tyran/policies/**,
1253
+ // .claude/settings*.json and .tyran/STOP included, the last by the
1254
+ // operator's explicit choice. Outside the repository `outside_repo` still
1255
+ // decides, above.
1256
+ if (kernelOpen && normalized !== null) continue;
1237
1257
  // The floor is consulted BEFORE the flag, so no ordering of settings can
1238
1258
  // reach the files that enforce every other boundary.
1239
1259
  const relaxClasses =
@@ -1446,8 +1466,10 @@ export const SHELL_PROTECTED_GLOBS = Object.freeze([
1446
1466
  ]);
1447
1467
 
1448
1468
  /**
1449
- * Paths no `boundaries:` setting can reach, checked before `path_classes` is
1450
- * consulted.
1469
+ * Paths no `boundaries:` setting but one can reach, checked before
1470
+ * `path_classes` is consulted. The one is `kernel: allow` in a
1471
+ * bypassPermissions session (see `kernelOpen` in `decide`), and no preset
1472
+ * sets it.
1451
1473
  *
1452
1474
  * `SHELL_PROTECTED_GLOBS` is already "the files that switch every gate off":
1453
1475
  * the enforcement hooks, the policy that classifies them, and the settings
@@ -1924,7 +1946,7 @@ function refuseShellPaths(findings, command = '', allowCredentials = false) {
1924
1946
  return { decision: 'deny', reason: lines.join('\n') };
1925
1947
  }
1926
1948
 
1927
- async function decideBash({ input, toolInput, root, runner, budget, boundaries }) {
1949
+ async function decideBash({ input, toolInput, root, runner, budget, boundaries, kernelOpen = false }) {
1928
1950
  const command = field(toolInput, 'command');
1929
1951
  if (typeof command !== 'string') {
1930
1952
  return {
@@ -1945,10 +1967,13 @@ async function decideBash({ input, toolInput, root, runner, budget, boundaries }
1945
1967
  // check that only runs once a policy loads is a check an unconfigured repo
1946
1968
  // does not have.
1947
1969
  // `credentials: allow` drops the CREDENTIAL findings and nothing else. A
1948
- // kernel finding is a path that protects the gate, and no setting reaches
1949
- // those — which is why this filters the list rather than skipping the call.
1970
+ // kernel finding is a path that protects the gate, and only `kernelOpen`
1971
+ // (`kernel: allow` in a bypassPermissions session) drops those — which is
1972
+ // why this filters the list rather than skipping the call.
1950
1973
  const findings = shellPathFindings(command, startDir, root).filter(
1951
- (f) => !(f.kind === 'credential' && boundaries.credentials === 'allow'),
1974
+ (f) =>
1975
+ !(f.kind === 'credential' && boundaries.credentials === 'allow') &&
1976
+ !(f.kind === 'kernel' && kernelOpen),
1952
1977
  );
1953
1978
  // The exemption SKIPS this refusal; it does not return PASS. A `git log` that
1954
1979
  // names a protected path still travels the deployment class and every other
@@ -2173,7 +2198,8 @@ export async function handle({ input, runner, startedAt, env }) {
2173
2198
  'tyran policy-gate: approved without asking. This repository sets `boundaries.prompts: skip` ' +
2174
2199
  'in .tyran/config.yaml, so a tool call no gate objects to is auto-approved.\n' +
2175
2200
  'What this does NOT reach: a refusal from any other gate still wins, so secret scanning at ' +
2176
- 'commit and push is unaffected, and so are the paths that protect the gates themselves.',
2201
+ 'commit and push is unaffected, and so are the paths that protect the gates themselves ' +
2202
+ 'unless `boundaries.kernel: allow` is set and this session runs in bypassPermissions.',
2177
2203
  };
2178
2204
  } catch (err) {
2179
2205
  if (err instanceof PolicyFailure) {
@@ -436,6 +436,11 @@ export function decide(
436
436
 
437
437
  const limits = readLimitsFn(repoRoot);
438
438
  if (limits === null) return PASS;
439
+ // `warn` never denies, marker or not, so it is read BEFORE the marker. The
440
+ // marker is per repo and the account is per session: a marker that binds
441
+ // under `warn` refuses sessions on accounts with quota left. Until 0.1.50
442
+ // this check sat below, on the no-marker branch only.
443
+ if (limits.mode !== 'pause') return PASS;
439
444
 
440
445
  const nowMs = now();
441
446
  let marker = readMarkerFn(repoRoot, nowMs);
@@ -445,7 +450,6 @@ export function decide(
445
450
  if (sidecar === null) return PASS; // no telemetry = unknown = open
446
451
  const tripped = trippedWindow(sidecar, limits);
447
452
  if (tripped === null) return PASS;
448
- if (limits.mode === 'warn') return PASS; // surfacing is doctor's job
449
453
  if (!isUnsupervised(input)) return PASS; // never bind the operator
450
454
  const journal = locate(repoRoot);
451
455
  marker = markerOf(tripped, limits, nowMs, field(input, 'session_id'), journal.init ? forJournal(journal.init) : null);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jjanczur/tyran",
3
- "version": "0.1.48",
3
+ "version": "0.1.50",
4
4
  "description": "Command-line scripts for the Tyran task conductor (doctor, journal, schema, and repo tooling) for CI and terminals outside Claude Code. Installing this package does NOT install the Claude Code plugin — add that separately with `/plugin marketplace add jjanczur/tyran` inside Claude Code.",
5
5
  "type": "module",
6
6
  "engines": {
@@ -2049,8 +2049,13 @@ export function runStateChecks({
2049
2049
  'boundaries-relaxed',
2050
2050
  show(configPath),
2051
2051
  `boundaries: ${relaxed.join(', ')} ${relaxed.length === 1 ? 'is' : 'are'} turned down, so the policy gate ` +
2052
- 'no longer refuses what they cover. Secret scanning at commit and push, the enforcement hooks, ' +
2053
- '.claude/settings.json and .tyran/STOP are unaffected — no setting reaches those',
2052
+ 'no longer refuses what they cover. ' +
2053
+ (relaxed.includes('kernel')
2054
+ ? 'kernel: allow means a session started with --permission-mode bypassPermissions may edit the ' +
2055
+ 'enforcement hooks, .tyran/policies, .claude/settings*.json and .tyran/STOP. Secret scanning at ' +
2056
+ 'commit and push is unaffected'
2057
+ : 'Secret scanning at commit and push, the enforcement hooks, .claude/settings.json and ' +
2058
+ '.tyran/STOP are unaffected — only boundaries.kernel reaches those, and only in bypassPermissions'),
2054
2059
  `node scripts/schema.mjs validate config ${sq(configPath)} # then edit boundaries: to tighten`,
2055
2060
  ),
2056
2061
  );
@@ -774,6 +774,11 @@ export function wallOf(reading) {
774
774
  export function limitSweep(repo, { nowMs = Date.now(), readTranscript = readTranscriptRejection, notify = notifyDesktop } = {}) {
775
775
  const limits = readLimitsFile(repo);
776
776
  if (limits === null || limits.mode === 'off') return { action: 'none', reason: 'limits-off' };
777
+ // `warn` never pauses, and the marker IS a pause: the gate denies on its
778
+ // presence alone. The line above was the only check until 0.1.49, so a repo on
779
+ // `warn` that hit the wall on ONE account got a repo-wide marker, and every
780
+ // unsupervised session in it was refused, on accounts with quota left too.
781
+ if (limits.mode !== 'pause') return { action: 'none', reason: 'limits-warn' };
777
782
  if (checkStop(repo).stopped) return { action: 'none', reason: 'stop-brake' };
778
783
 
779
784
  // An existing marker means the gate already saw this, or a previous sweep
@@ -839,9 +844,9 @@ export function limitSweep(repo, { nowMs = Date.now(), readTranscript = readTran
839
844
 
840
845
  function doWatchLimit(repo, flags) {
841
846
  const limits = readLimitsFile(repo);
842
- if (limits.mode === 'off') {
847
+ if (limits.mode !== 'pause') {
843
848
  console.error(
844
- 'overnight: limits.mode is "off" in .tyran/config.yaml — nothing to watch for.\n' +
849
+ `overnight: limits.mode is "${limits.mode}" in .tyran/config.yaml — only "pause" pauses, so nothing to watch for.\n` +
845
850
  ' set limits.mode: pause to have the wall detected and the resume armed.',
846
851
  );
847
852
  process.exit(1);
@@ -565,10 +565,11 @@ export function renderConfig(config) {
565
565
  '# where the most agents run.\n' +
566
566
  '#\n' +
567
567
  '# GIVING AGENTS MORE ROOM: `boundaries:` below is the one place the policy\n' +
568
- '# gate can be turned down. `preset: open` relaxes all five at once — the\n' +
569
- '# closest thing to running with permissions skipped. Secret scanning at\n' +
570
- '# commit and push, the enforcement hooks, `.claude/settings.json` and\n' +
571
- '# `.tyran/STOP` are NOT reachable from it, whatever it is set to.\n' +
568
+ '# gate can be turned down. `preset: open` relaxes all but `kernel` at\n' +
569
+ '# once — the closest thing to running with permissions skipped. Secret\n' +
570
+ '# scanning at commit and push is never reachable. The enforcement hooks,\n' +
571
+ '# `.claude/settings.json` and `.tyran/STOP` are reachable only with\n' +
572
+ '# `kernel: allow` AND a session started in bypassPermissions mode.\n' +
572
573
  '# See docs/configuration.md.\n' +
573
574
  '#\n' +
574
575
  '# Validate: node scripts/schema.mjs validate config .tyran/config.yaml\n' +
@@ -51,14 +51,24 @@ export const KNOWLEDGE_KINDS = Object.freeze(['fact', 'convention', 'gotcha', 'c
51
51
  export const BOUNDARY_PRESETS = Object.freeze(['strict', 'open']);
52
52
  export const BOUNDARY_VALUES = Object.freeze(['refuse', 'allow']);
53
53
  export const BOUNDARY_PROMPTS = Object.freeze(['ask', 'skip']);
54
- /** The four refusal flags, in the order they are documented. */
55
- export const BOUNDARY_FLAGS = Object.freeze(['outside_repo', 'credentials', 'path_classes', 'push']);
54
+ /**
55
+ * The refusal flags, in the order they are documented.
56
+ *
57
+ * `kernel` is last and is the one no preset moves: it reaches the files that
58
+ * enforce every other flag in this list (`hooks/**`, `.tyran/policies/**`,
59
+ * `.claude/settings*.json`, `.tyran/STOP`), and the gate honours it only in a
60
+ * session a human started with `--permission-mode bypassPermissions`. An
61
+ * install that already says `preset: open` must not gain kernel writes by
62
+ * updating, so it is spelled out or it is `refuse`.
63
+ */
64
+ export const BOUNDARY_FLAGS = Object.freeze(['outside_repo', 'credentials', 'path_classes', 'push', 'kernel']);
56
65
  /** Every key legal inside the block. */
57
66
  export const BOUNDARY_KEYS = Object.freeze(['preset', ...BOUNDARY_FLAGS, 'prompts']);
58
67
  /** What each preset resolves to before per-key overrides are applied. */
59
68
  const BOUNDARY_BY_PRESET = Object.freeze({
60
- strict: Object.freeze({ outside_repo: 'refuse', credentials: 'refuse', path_classes: 'refuse', push: 'refuse', prompts: 'ask' }),
61
- open: Object.freeze({ outside_repo: 'allow', credentials: 'allow', path_classes: 'allow', push: 'allow', prompts: 'skip' }),
69
+ strict: Object.freeze({ outside_repo: 'refuse', credentials: 'refuse', path_classes: 'refuse', push: 'refuse', kernel: 'refuse', prompts: 'ask' }),
70
+ // `kernel: 'refuse'` under open too, on purpose: see BOUNDARY_FLAGS.
71
+ open: Object.freeze({ outside_repo: 'allow', credentials: 'allow', path_classes: 'allow', push: 'allow', kernel: 'refuse', prompts: 'skip' }),
62
72
  });
63
73
  /** The safe answer, used for an absent block and for every value the schema rejects. */
64
74
  export const BOUNDARIES_STRICT = BOUNDARY_BY_PRESET.strict;
@@ -127,17 +127,17 @@ export const GROUPS = Object.freeze([
127
127
  id: 'boundaries',
128
128
  title: 'What agents may touch',
129
129
  blurb:
130
- 'How far the policy gate turns its refusals down. Everything here starts at the strict setting, and every move toward the looser one asks you to confirm it a second time. Four things are NOT on this screen because no setting reaches them: secret scanning at commit and push, the enforcement hooks themselves, the file that registers them, and the STOP brake.',
130
+ 'How far the policy gate turns its refusals down. Everything here starts at the strict setting, and every move toward the looser one asks you to confirm it a second time. Secret scanning at commit and push is NOT on this screen because no setting reaches it. The enforcement hooks, the file that registers them and the STOP brake are reached only by "The gates themselves", and only in a session started in bypassPermissions mode.',
131
131
  settings: [
132
132
  {
133
133
  id: 'boundaries.preset',
134
134
  path: ['boundaries', 'preset'],
135
135
  label: 'Preset',
136
- help: 'The one switch. "Open" turns every boundary below to its loose setting at once — the closest thing Tyran has to running Claude Code with permissions skipped. Anything you set individually below wins over the preset.',
136
+ help: 'The one switch. "Open" turns every boundary below except "The gates themselves" to its loose setting at once — the closest thing Tyran has to running Claude Code with permissions skipped. Anything you set individually below wins over the preset.',
137
137
  explain: {
138
138
  what: 'The master position for every boundary in this group at once.',
139
139
  changes: 'Flips outside-repo access, credential reads, your path rules, push checks and permission prompts together; any boundary you set individually below overrides it.',
140
- effect: 'On "open", agents move without friction and without asking — the four things no setting reaches (secret scanning, the hooks, their registry, the STOP brake) still hold.',
140
+ effect: 'On "open", agents move without friction and without asking — secret scanning, the hooks, their registry and the STOP brake still hold; only "The gates themselves" below reaches the last three.',
141
141
  },
142
142
  widening: {
143
143
  scale: 'preset',
@@ -146,7 +146,7 @@ export const GROUPS = Object.freeze([
146
146
  },
147
147
  ...choice(BOUNDARY_PRESETS, {
148
148
  strict: 'Every boundary on. This is what Tyran has always done.',
149
- open: 'Every boundary below turned down at once.',
149
+ open: 'Every boundary below except the gates themselves turned down at once.',
150
150
  }),
151
151
  },
152
152
  {
@@ -192,10 +192,10 @@ export const GROUPS = Object.freeze([
192
192
  id: 'boundaries.path_classes',
193
193
  path: ['boundaries', 'path_classes'],
194
194
  label: 'Your own path rules',
195
- help: 'The AUTO / GATED / KERNEL rules in the policy below. Allowing this makes them advisory: a subagent may write a path you gated. The four paths that protect the gate itself stay refused whatever this says.',
195
+ help: 'The AUTO / GATED / KERNEL rules in the policy below. Allowing this makes them advisory: a subagent may write a path you gated. The paths that protect the gate itself stay refused whatever this says; only "The gates themselves" reaches them.',
196
196
  explain: {
197
197
  what: 'Whether the AUTO / GATED / KERNEL classes in the autonomy policy further down this page are enforced on writes.',
198
- changes: 'On "allow" they become advisory: a subagent may write a path you gated, and only the four self-protecting paths still refuse.',
198
+ changes: 'On "allow" they become advisory: a subagent may write a path you gated, and only the self-protecting paths still refuse.',
199
199
  effect: 'Turning this off removes the distinction the policy exists to draw — everything an agent can reach becomes effectively AUTO.',
200
200
  },
201
201
  widening: {
@@ -227,6 +227,26 @@ export const GROUPS = Object.freeze([
227
227
  allow: 'Any push is allowed, including the irreversible ones.',
228
228
  }),
229
229
  },
230
+ {
231
+ id: 'boundaries.kernel',
232
+ path: ['boundaries', 'kernel'],
233
+ label: 'The gates themselves',
234
+ help: 'The enforcement hooks, the autonomy policy, .claude/settings*.json and .tyran/STOP. "Allow" counts only in a session you started with --permission-mode bypassPermissions; in every other mode these stay refused. The "Open" preset never sets this.',
235
+ explain: {
236
+ what: 'Whether an agent may edit the files that enforce every other boundary on this page, in a bypassPermissions session.',
237
+ changes: 'On "allow", a bypassPermissions session may write hooks/**, .tyran/policies/**, .claude/settings*.json and .tyran/STOP, from any tool. Other modes are unchanged.',
238
+ effect: 'In that session nothing on this page is a boundary any more: an agent can edit or remove the gates, and clear your STOP brake.',
239
+ },
240
+ widening: {
241
+ scale: 'boundary',
242
+ consequence:
243
+ 'In a bypassPermissions session agents may edit the enforcement hooks, the policy, the hook registry and the STOP brake.',
244
+ },
245
+ ...choice(BOUNDARY_VALUES, {
246
+ refuse: 'The gates and your brake are edited by hand, outside a session.',
247
+ allow: 'A bypassPermissions session may edit the gates and the brake.',
248
+ }),
249
+ },
230
250
  {
231
251
  id: 'boundaries.prompts',
232
252
  path: ['boundaries', 'prompts'],
@@ -259,8 +259,9 @@ value asks for a confirmation.
259
259
 
260
260
  Say the floor in the same breath, because it is what makes the offer safe to
261
261
  make: secret scanning at commit and push, the enforcement hooks,
262
- `.claude/settings.json` and `.tyran/STOP` are unreachable from it at any
263
- setting.
262
+ `.claude/settings.json` and `.tyran/STOP` are unreachable from the preset.
263
+ Only a separate `kernel: allow` key, honoured only in a bypassPermissions
264
+ session, reaches the last three. Do not mention that key unless asked.
264
265
 
265
266
  **Do not recommend a value, and do not ask which they want.** Strict is
266
267
  already written and already correct; this is a pointer for the operator who
@@ -47,28 +47,35 @@ shared_zones: []
47
47
  # strict one, which is what Tyran did before this block existed — nothing is
48
48
  # relaxed by having it in the file, only made editable from the Settings tab.
49
49
  #
50
- # preset: strict | open one switch. `open` sets all five below at once and
51
- # is the closest thing to running with permissions
52
- # skipped. Anything you set explicitly wins over it.
50
+ # preset: strict | open one switch. `open` sets the first four below and
51
+ # `prompts` at once, and is the closest thing to
52
+ # running with permissions skipped. It never sets
53
+ # `kernel`. Anything you set explicitly wins over it.
53
54
  # outside_repo refuse | allow — files outside this repository
54
55
  # credentials refuse | allow — .env, keys, ~/.ssh, ~/.aws
55
56
  # path_classes refuse | allow — the GATED/KERNEL rules you wrote
56
57
  # push refuse | allow — the deployment class on git push
58
+ # kernel refuse | allow — the enforcement hooks, the policy,
59
+ # .claude/settings*.json and .tyran/STOP. `allow`
60
+ # counts ONLY in a session started with
61
+ # --permission-mode bypassPermissions.
57
62
  # prompts ask | skip — skip Claude Code's own prompts
58
63
  #
59
- # FOUR THINGS NO SETTING HERE REACHES, whatever it says: secret scanning at
60
- # commit and push, the enforcement hooks, `.claude/settings.json`, and
61
- # `.tyran/STOP`. A refusal from any gate still wins over an auto-approval.
64
+ # Unless `kernel: allow` AND a bypassPermissions session, nothing here reaches
65
+ # the enforcement hooks, `.tyran/policies/`, `.claude/settings.json` or
66
+ # `.tyran/STOP`. No setting reaches secret scanning at commit and push. A
67
+ # refusal from any gate still wins over an auto-approval.
62
68
  #
63
69
  # This file is class AUTO, so an agent can widen these itself — the same trade
64
- # `autonomy:` above already makes, and the reason the four exceptions are
65
- # mechanical rather than a matter of policy. See docs/policy-gate.md.
70
+ # `autonomy:` above already makes. That includes `kernel`: in a bypass session
71
+ # an agent can set it and then edit the gates. See docs/configuration.md.
66
72
  boundaries:
67
73
  preset: strict
68
74
  outside_repo: refuse
69
75
  credentials: refuse
70
76
  path_classes: refuse
71
77
  push: refuse
78
+ kernel: refuse
72
79
  prompts: ask
73
80
 
74
81
  # Overnight mode — pause autonomous work near the subscription usage limits