Open History to see the last commit
1import {
2 AntigravitySettings,
3 ClaudeSettings,
4 CodexSettings,
5 defaultInstanceIdForDriver,
6 disallowedProviderMessage,
7 type ManagedProviderInstance,
8 type ManagedProviderLimits,
9 type ManagedPolicySummary,
10 ProviderDriverKind,
11 type ProviderInstanceConfig,
12 type ProviderInstanceEnvironmentVariable,
13 type ProviderInstanceId,
14 resolveProviderInstanceEnabled,
15 type RuntimeMode,
16 type ServerSettings,
17} from "@t3tools/contracts";
18import { acpRegistryClient } from "@t3tools/provider-acp-registry/client";
19import { cursorClient } from "@t3tools/provider-cursor/client";
20import { fxClient } from "@t3tools/provider-fx/client";
21import { grokClient } from "@t3tools/provider-grok/client";
22import { museClient } from "@t3tools/provider-muse/client";
23import { openCodeClient } from "@t3tools/provider-opencode/client";
24import { piClient } from "@t3tools/provider-pi/client";
25import type { ProviderClientDefinition } from "@t3tools/provider-core/client";
26
27interface KnownDriver {
28 readonly label: string;
29 readonly configFields: ReadonlySet<string>;
30 readonly hasDefaultInstance: boolean;
31}
32
33const known = (
34 driverKind: string,
35 label: string,
36 settingsSchema: { readonly fields: object },
37 hasDefaultInstance = true,
38) =>
39 [
40 ProviderDriverKind.make(driverKind),
41 { label, configFields: new Set(Object.keys(settingsSchema.fields)), hasDefaultInstance },
42 ] as const;
43
44const PACKAGED_CLIENTS: ReadonlyArray<ProviderClientDefinition> = [
45 cursorClient,
46 grokClient,
47 fxClient,
48 museClient,
49 openCodeClient,
50 piClient,
51 acpRegistryClient,
52];
53
54/**
55 * Fields that make an instance launch without the settings a pin sets: managed Codex runs T3's own
56 * runtime against OpenAI, and a server URL points OpenCode at a server it does not start. A policy
57 * that owns a pin owns these too, holding each at the value given here, which clients still send
58 * when they add an instance.
59 */
60const PIN_BYPASS_FIELDS: ReadonlyMap<
61 ProviderDriverKind,
62 Readonly<Record<string, unknown>>
63> = new Map<ProviderDriverKind, Readonly<Record<string, unknown>>>([
64 [ProviderDriverKind.make("codex"), { setupMode: "existing" }],
65 [ProviderDriverKind.make("opencode"), { serverUrl: "" }],
66]);
67
68/** Drivers this build knows, by the names users see; a policy naming any other is refused. */
69const KNOWN_DRIVERS: ReadonlyMap<ProviderDriverKind, KnownDriver> = new Map([
70 known("codex", "Codex", CodexSettings),
71 known("claudeAgent", "Claude", ClaudeSettings),
72 known("antigravity", "Antigravity", AntigravitySettings),
73 ...PACKAGED_CLIENTS.map((client) =>
74 known(client.driverKind, client.label, client.settingsSchema, client.hasDefaultInstance),
75 ),
76]);
77
78const PINNED_CONFIG_FIELDS = ["binaryPath", "launchArgs"] as const;
79type PinnedConfigField = (typeof PINNED_CONFIG_FIELDS)[number];
80
81/**
82 * Fields that decide what a provider starts and reads on startup; a driver has those its schema
83 * has. Under a ceiling they are the administrator's: a wrapper binary, a skip-permissions flag, or
84 * a config directory with allow rules each outrank T3 Code's mode, and no flag filter stops a wrapper.
85 */
86const LAUNCH_CONFIG_FIELDS = [
87 "binaryPath",
88 "launchArgs",
89 "homePath",
90 "shadowHomePath",
91 "commandPath",
92 "commandArgs",
93 "serverUrl",
94] as const;
95
96export type ProviderWriteVerdict =
97 | { readonly _tag: "Allowed"; readonly settings: ServerSettings }
98 | { readonly _tag: "Locked"; readonly path: string }
99 | {
100 readonly _tag: "Disallowed";
101 readonly instanceId: ProviderInstanceId;
102 readonly label: string;
103 };
104
105/**
106 * How a policy's `limits.providers` shapes provider instances. Like settings locks, pinned
107 * fields are laid over instances on every read and never written to the user's settings file.
108 */
109export interface ManagedProviders {
110 readonly isDriverAllowed: (driver: ProviderDriverKind) => boolean;
111 /** Lay pinned fields over every instance of a pinned driver, its default instance included. */
112 readonly applyLimits: (settings: ServerSettings) => ServerSettings;
113 /**
114 * Vet a write from stored `current` to `next`. Refuses enabling a disallowed driver and moving
115 * a locked field off its pinned value. Pinned values a client sends back are dropped, so the
116 * user's own values return once the policy is gone.
117 */
118 readonly vetWrite: (current: ServerSettings, next: ServerSettings) => ProviderWriteVerdict;
119 /**
120 * Per driver, the instance fields users cannot change, for clients. `environment` alone means
121 * every variable.
122 */
123 readonly lockedInstanceFields: Readonly<Record<string, ReadonlyArray<string>>>;
124}
125
126export const unmanagedProviders: ManagedProviders = {
127 isDriverAllowed: () => true,
128 applyLimits: (settings) => settings,
129 vetWrite: (_current, next) => ({ _tag: "Allowed", settings: next }),
130 lockedInstanceFields: {},
131};
132
133const labelFor = (driver: ProviderDriverKind) => KNOWN_DRIVERS.get(driver)?.label ?? driver;
134
135/** Why the policy clients were told about keeps `driver` from running, or undefined when it may run. */
136export const disallowedDriverReason = (
137 summary: ManagedPolicySummary | undefined,
138 driver: ProviderDriverKind,
139): string | undefined => {
140 const allowed = summary?.limits?.providers?.allowedDrivers;
141 return allowed === undefined || allowed.includes(driver)
142 ? undefined
143 : disallowedProviderMessage(summary?.organization, labelFor(driver));
144};
145
146/**
147 * Variables that replace a provider's launch configuration. From the environment that starts the
148 * server they are ignored under any policy, which can lock launch arguments in more than one way;
149 * from an instance's own variables they are ignored when the policy locks launch arguments.
150 */
151const LAUNCH_OVERRIDE_VARIABLES = ["T3CODE_CODEX_LAUNCH_ARGS"] as const;
152
153/** The environment provider drivers launch from under the policy clients were told about. */
154export const providerHostEnvironment = (
155 summary: ManagedPolicySummary | undefined,
156 environment: NodeJS.ProcessEnv,
157): NodeJS.ProcessEnv => {
158 if (summary === undefined) return environment;
159 const next = { ...environment };
160 for (const name of Object.keys(next)) {
161 if (LAUNCH_OVERRIDE_VARIABLES.some((override) => override === name.toUpperCase())) {
162 delete next[name];
163 }
164 }
165 return next;
166};
167
168/** Each driver's home variable, and the settings that rewrite it at launch. */
169const HOME_VARIABLES: ReadonlyMap<
170 ProviderDriverKind,
171 { readonly variable: string; readonly fields: ReadonlyArray<string> }
172> = new Map([
173 [ProviderDriverKind.make("claudeAgent"), { variable: "CLAUDE_CONFIG_DIR", fields: ["homePath"] }],
174 [
175 ProviderDriverKind.make("codex"),
176 { variable: "CODEX_HOME", fields: ["homePath", "shadowHomePath"] },
177 ],
178]);
179
180const configRecord = (instance: ProviderInstanceConfig | undefined): Record<string, unknown> =>
181 instance?.config !== null &&
182 typeof instance?.config === "object" &&
183 !Array.isArray(instance.config)
184 ? (instance.config as Record<string, unknown>)
185 : {};
186
187/** Empty strings and empty lists are how clients clear a field, so they count as unset. */
188const configValue = (instance: ProviderInstanceConfig | undefined, field: string) => {
189 const value = configRecord(instance)[field];
190 return value === "" || (Array.isArray(value) && value.length === 0) ? undefined : value;
191};
192
193const sameValue = (left: unknown, right: unknown) =>
194 left === right || JSON.stringify(left) === JSON.stringify(right);
195
196const sameVariable = (
197 left: ProviderInstanceEnvironmentVariable | undefined,
198 right: ProviderInstanceEnvironmentVariable | undefined,
199) =>
200 left === right ||
201 (left !== undefined &&
202 right !== undefined &&
203 left.value === right.value &&
204 left.sensitive === right.sensitive);
205
206const pinnedFields = (pin: ManagedProviderInstance): ReadonlyArray<PinnedConfigField> =>
207 PINNED_CONFIG_FIELDS.filter((field) => pin[field] !== undefined);
208
209/**
210 * What the administrator owns on one driver's instances. `config` fields take the pin or the
211 * default, never the user's value; `fill` fields take the pin only where the user left them empty.
212 * `environment`: `all` runs with only pinned variables, `locked` lets them win, `fill` fills gaps.
213 */
214interface DriverRule {
215 readonly pin: ManagedProviderInstance | undefined;
216 readonly config: ReadonlyArray<string>;
217 readonly fill: ReadonlyArray<PinnedConfigField>;
218 readonly environment: "all" | "locked" | "fill";
219}
220
221const pinnedValue = (pin: ManagedProviderInstance | undefined, field: string): unknown =>
222 pin === undefined ? undefined : (pin as Record<string, unknown>)[field];
223
224const overlayInstance = (
225 instance: ProviderInstanceConfig,
226 rule: DriverRule,
227 variableKey: (name: string) => string,
228): ProviderInstanceConfig => {
229 const config = { ...configRecord(instance) };
230 for (const field of rule.config) {
231 const value = pinnedValue(rule.pin, field);
232 if (value === undefined) delete config[field];
233 else config[field] = value;
234 }
235 for (const field of rule.fill) {
236 if (configValue(instance, field) === undefined) config[field] = rule.pin?.[field];
237 }
238 const pinnedEnvironment = (rule.pin?.environment ?? []).map((variable) => ({
239 name: variable.name,
240 value: variable.value,
241 sensitive: false,
242 }));
243 const pinnedByName = new Map(
244 pinnedEnvironment.map((variable) => [variableKey(variable.name), variable]),
245 );
246 const environment: Array<NonNullable<ProviderInstanceConfig["environment"]>[number]> =
247 rule.environment === "all" ? pinnedEnvironment : [];
248 if (rule.environment !== "all") {
249 const seen = new Set<string>();
250 // A user's override would replace launch arguments the administrator locked.
251 const overrides = rule.config.includes("launchArgs")
252 ? new Set(LAUNCH_OVERRIDE_VARIABLES.map(variableKey))
253 : new Set<string>();
254 // The last entry for a name wins at launch, so a lock replaces every entry with that name.
255 for (const variable of instance.environment ?? []) {
256 const key = variableKey(variable.name);
257 if (overrides.has(key)) continue;
258 const pinned = rule.environment === "locked" ? pinnedByName.get(key) : undefined;
259 if (pinned === undefined) environment.push(variable);
260 else if (!seen.has(key)) environment.push(pinned);
261 seen.add(key);
262 }
263 for (const pinned of pinnedEnvironment) {
264 if (!seen.has(variableKey(pinned.name))) environment.push(pinned);
265 }
266 }
267 const { config: _config, environment: _environment, ...envelope } = instance;
268 return {
269 ...envelope,
270 ...(instance.config === undefined && Object.keys(config).length === 0 ? {} : { config }),
271 ...(environment.length === 0 ? {} : { environment }),
272 };
273};
274
275/**
276 * Build the overlay for `limits.providers` and `limits.maxRuntimeMode`, or say why it cannot be
277 * enforced. A ceiling takes each driver's launch fields and its whole `environment`, which can
278 * carry `CLAUDE_CONFIG_DIR`, `PATH`, or `NODE_OPTIONS`; a deny list would miss the next one.
279 */
280export function makeManagedProviders(
281 limits: ManagedProviderLimits,
282 maxRuntimeMode: RuntimeMode | undefined,
283 platform: NodeJS.Platform,
284):
285 | { readonly _tag: "Valid"; readonly providers: ManagedProviders }
286 | { readonly _tag: "Invalid"; readonly reason: string } {
287 // Windows reads a variable name without regard to case, so there a lock covers every spelling.
288 const variableKey = (name: string) => (platform === "win32" ? name.toUpperCase() : name);
289 for (const driver of limits.allowedDrivers ?? []) {
290 if (!KNOWN_DRIVERS.has(driver)) {
291 return { _tag: "Invalid", reason: `"${driver}" in allowedDrivers is not a known provider` };
292 }
293 }
294 const pins = new Map<ProviderDriverKind, ManagedProviderInstance>();
295 for (const [rawDriver, pin] of Object.entries(limits.instances ?? {})) {
296 const driver = ProviderDriverKind.make(rawDriver);
297 const known = KNOWN_DRIVERS.get(driver);
298 if (known === undefined) {
299 return { _tag: "Invalid", reason: `"${driver}" in instances is not a known provider` };
300 }
301 const unsupported = pinnedFields(pin).find((field) => !known.configFields.has(field));
302 if (unsupported !== undefined) {
303 return {
304 _tag: "Invalid",
305 reason: `the ${known.label} provider has no ${unsupported} setting`,
306 };
307 }
308 const names = (pin.environment ?? []).map((variable) => variableKey(variable.name));
309 if (new Set(names).size !== names.length) {
310 return { _tag: "Invalid", reason: `instances.${driver}.environment repeats a variable` };
311 }
312 pins.set(driver, pin);
313 }
314
315 const rules = new Map<ProviderDriverKind, DriverRule>();
316 for (const [driver, known] of KNOWN_DRIVERS) {
317 const pin = pins.get(driver);
318 const bypasses = pin === undefined ? [] : Object.keys(PIN_BYPASS_FIELDS.get(driver) ?? {});
319 if (maxRuntimeMode !== undefined) {
320 rules.set(driver, {
321 pin,
322 config: [
323 ...LAUNCH_CONFIG_FIELDS.filter((field) => known.configFields.has(field)),
324 ...bypasses,
325 ],
326 fill: [],
327 environment: "all",
328 });
329 } else if (pin !== undefined) {
330 // A home path setting rewrites the provider's home variable at launch, so a lock on that
331 // variable owns the setting too.
332 const home = HOME_VARIABLES.get(driver);
333 const homeLocked =
334 home !== undefined &&
335 (pin.environment ?? []).some(
336 (variable) => variableKey(variable.name) === variableKey(home.variable),
337 );
338 rules.set(driver, {
339 pin,
340 config: pin.locked
341 ? [...pinnedFields(pin), ...bypasses, ...(homeLocked ? home.fields : [])]
342 : [],
343 fill: pin.locked ? [] : pinnedFields(pin),
344 environment: pin.locked ? "locked" : "fill",
345 });
346 }
347 }
348
349 const allowed =
350 limits.allowedDrivers === undefined ? undefined : new Set<string>(limits.allowedDrivers);
351 const isDriverAllowed = (driver: ProviderDriverKind) => allowed?.has(driver) ?? true;
352 const allowedSelection = (
353 settings: ServerSettings,
354 selection: { readonly instanceId: ProviderInstanceId } | null | undefined,
355 ) =>
356 selection == null ||
357 isDriverAllowed(
358 settings.providerInstances[selection.instanceId]?.driver ??
359 ProviderDriverKind.make(selection.instanceId),
360 );
361
362 const cache = new WeakMap<ServerSettings, ServerSettings>();
363 const applyLimits = (settings: ServerSettings): ServerSettings => {
364 const cached = cache.get(settings);
365 if (cached !== undefined) return cached;
366 const providerInstances: Record<string, ProviderInstanceConfig> = {
367 ...settings.providerInstances,
368 };
369 // Default instances exist without a settings entry until the user edits one; pin them too.
370 for (const driver of pins.keys()) {
371 const instanceId = defaultInstanceIdForDriver(driver);
372 if (KNOWN_DRIVERS.get(driver)?.hasDefaultInstance === false) continue;
373 if (providerInstances[instanceId] === undefined) providerInstances[instanceId] = { driver };
374 }
375 for (const [instanceId, instance] of Object.entries(providerInstances)) {
376 const rule = rules.get(instance.driver);
377 if (rule !== undefined) {
378 providerInstances[instanceId] = overlayInstance(instance, rule, variableKey);
379 }
380 }
381 // A cleared selection falls back to the text generation model, which is resolved afterwards.
382 const result: ServerSettings = {
383 ...settings,
384 providerInstances: providerInstances as ServerSettings["providerInstances"],
385 sourceControlWriterModelSelection: allowedSelection(
386 settings,
387 settings.sourceControlWriterModelSelection,
388 )
389 ? settings.sourceControlWriterModelSelection
390 : null,
391 reviewGuideModelSelection: allowedSelection(settings, settings.reviewGuideModelSelection)
392 ? settings.reviewGuideModelSelection
393 : null,
394 };
395 cache.set(settings, result);
396 return result;
397 };
398
399 type Locked = { readonly _tag: "Locked"; readonly path: string };
400
401 /**
402 * Vet the environment a client sent. Pinned values it echoes back are dropped; anything else
403 * the administrator owns must match what is stored. Returns the environment to store.
404 */
405 const vetEnvironment = (
406 instanceId: string,
407 stored: ProviderInstanceConfig | undefined,
408 next: ProviderInstanceConfig,
409 rule: DriverRule,
410 ):
411 | Locked
412 | {
413 readonly _tag: "Kept";
414 readonly environment: ReadonlyArray<ProviderInstanceEnvironmentVariable>;
415 } => {
416 const pinned = rule.pin?.environment ?? [];
417 const storedVariable = (name: string) =>
418 stored?.environment?.find((existing) => variableKey(existing.name) === variableKey(name));
419 const storedUnchanged = (variable: ProviderInstanceEnvironmentVariable) =>
420 (stored?.environment ?? []).some((existing) => sameVariable(variable, existing));
421 const echoed = (variable: ProviderInstanceEnvironmentVariable) =>
422 !variable.sensitive &&
423 pinned.some((pin) => pin.name === variable.name && pin.value === variable.value);
424 if (rule.environment === "all") {
425 // Only the pinned variables were shown, so the user's own stay as stored.
426 for (const variable of next.environment ?? []) {
427 if (echoed(variable) || storedUnchanged(variable)) continue;
428 return { _tag: "Locked", path: `providerInstances.${instanceId}.environment` };
429 }
430 return { _tag: "Kept", environment: stored?.environment ?? [] };
431 }
432 let environment: ReadonlyArray<ProviderInstanceEnvironmentVariable> = next.environment ?? [];
433 for (const variable of pinned) {
434 const sent = environment.find(
435 (existing) => variableKey(existing.name) === variableKey(variable.name),
436 );
437 const kept = storedVariable(variable.name);
438 if ((sent !== undefined && echoed(sent)) || sameVariable(sent, kept)) {
439 // Put the user's own entries back where it was sent, or drop the echoed policy value.
440 const storedEntries = (stored?.environment ?? []).filter(
441 (existing) => variableKey(existing.name) === variableKey(variable.name),
442 );
443 let restored = false;
444 environment = environment.flatMap((existing) => {
445 if (variableKey(existing.name) !== variableKey(variable.name)) return [existing];
446 if (restored) return [];
447 restored = true;
448 return storedEntries;
449 });
450 } else if (rule.environment === "locked") {
451 return {
452 _tag: "Locked",
453 path: `providerInstances.${instanceId}.environment.${variable.name}`,
454 };
455 }
456 }
457 // The client never saw a launch override the lock hides, so keep the stored one.
458 if (rule.config.includes("launchArgs")) {
459 const overrides = new Set(LAUNCH_OVERRIDE_VARIABLES.map(variableKey));
460 environment = [
461 ...environment.filter((variable) => !overrides.has(variableKey(variable.name))),
462 ...(stored?.environment ?? []).filter((variable) =>
463 overrides.has(variableKey(variable.name)),
464 ),
465 ];
466 }
467 return { _tag: "Kept", environment };
468 };
469
470 const vetInstance = (
471 instanceId: string,
472 stored: ProviderInstanceConfig | undefined,
473 next: ProviderInstanceConfig,
474 rule: DriverRule,
475 ): Locked | { readonly _tag: "Kept"; readonly instance: ProviderInstanceConfig | undefined } => {
476 const config = { ...configRecord(next) };
477 const harmless = PIN_BYPASS_FIELDS.get(next.driver) ?? {};
478 for (const field of [...rule.config, ...rule.fill]) {
479 const value = configValue(next, field);
480 const storedValue = configValue(stored, field);
481 if (
482 sameValue(value, pinnedValue(rule.pin, field)) ||
483 sameValue(value, storedValue) ||
484 (field in harmless && sameValue(value, harmless[field]))
485 ) {
486 if (storedValue === undefined) delete config[field];
487 else config[field] = configRecord(stored)[field];
488 } else if (rule.config.includes(field)) {
489 return { _tag: "Locked", path: `providerInstances.${instanceId}.config.${field}` };
490 }
491 }
492 const vettedEnvironment = vetEnvironment(instanceId, stored, next, rule);
493 if (vettedEnvironment._tag === "Locked") return vettedEnvironment;
494 const { environment } = vettedEnvironment;
495 const { config: _config, environment: _environment, ...envelope } = next;
496 const kept: ProviderInstanceConfig = {
497 ...envelope,
498 ...(Object.keys(config).length === 0 && stored?.config === undefined ? {} : { config }),
499 ...(environment.length === 0 ? {} : { environment }),
500 };
501 // A default instance the client echoed back with only pinned values stays implicit.
502 const echoedDefault =
503 stored === undefined &&
504 instanceId === defaultInstanceIdForDriver(next.driver) &&
505 Object.keys(kept).length === 1;
506 return { _tag: "Kept", instance: echoedDefault ? undefined : kept };
507 };
508
509 const vetWrite = (current: ServerSettings, next: ServerSettings): ProviderWriteVerdict => {
510 const providerInstances: Record<string, ProviderInstanceConfig> = {};
511 for (const [instanceId, instance] of Object.entries(next.providerInstances)) {
512 const stored = current.providerInstances[instanceId as ProviderInstanceId];
513 // Clients echo instances with policy fields laid over them, so compare only whether it runs.
514 // A driver's default instance runs before it is configured.
515 const wasEnabled =
516 stored !== undefined
517 ? stored.driver === instance.driver && resolveProviderInstanceEnabled(stored)
518 : instanceId === defaultInstanceIdForDriver(instance.driver);
519 if (
520 !isDriverAllowed(instance.driver) &&
521 resolveProviderInstanceEnabled(instance) &&
522 !wasEnabled
523 ) {
524 return {
525 _tag: "Disallowed",
526 instanceId: instanceId as ProviderInstanceId,
527 label: labelFor(instance.driver),
528 };
529 }
530 const rule = rules.get(instance.driver);
531 if (rule === undefined) {
532 providerInstances[instanceId] = instance;
533 continue;
534 }
535 const vetted = vetInstance(
536 instanceId,
537 stored?.driver === instance.driver ? stored : undefined,
538 instance,
539 rule,
540 );
541 if (vetted._tag === "Locked") return vetted;
542 if (vetted.instance !== undefined) providerInstances[instanceId] = vetted.instance;
543 }
544 // A project can switch an instance on for itself; that is enabling it too.
545 for (const [projectId, overrides] of Object.entries(next.projectSettingsOverrides)) {
546 const storedOverrides =
547 current.projectSettingsOverrides[projectId as keyof typeof current.projectSettingsOverrides]
548 ?.providerInstances;
549 for (const [instanceId, override] of Object.entries(overrides.providerInstances ?? {})) {
550 const driver =
551 next.providerInstances[instanceId as ProviderInstanceId]?.driver ??
552 ProviderDriverKind.make(instanceId);
553 if (
554 override.enabled === true &&
555 storedOverrides?.[instanceId as ProviderInstanceId]?.enabled !== true &&
556 !isDriverAllowed(driver)
557 ) {
558 return {
559 _tag: "Disallowed",
560 instanceId: instanceId as ProviderInstanceId,
561 label: labelFor(driver),
562 };
563 }
564 }
565 }
566 return {
567 _tag: "Allowed",
568 settings: {
569 ...next,
570 providerInstances: providerInstances as ServerSettings["providerInstances"],
571 },
572 };
573 };
574
575 const lockedInstanceFields = Object.fromEntries(
576 [...rules].flatMap(([driver, rule]) => {
577 const fields = [
578 ...rule.config.map((field) => `config.${field}`),
579 ...(rule.environment === "all"
580 ? ["environment"]
581 : rule.environment === "locked"
582 ? (rule.pin?.environment ?? []).map((variable) => `environment.${variable.name}`)
583 : []),
584 ];
585 return fields.length === 0 ? [] : [[driver, fields] as const];
586 }),
587 );
588
589 return {
590 _tag: "Valid",
591 providers: {
592 isDriverAllowed,
593 applyLimits,
594 vetWrite,
595 lockedInstanceFields,
596 },
597 };
598}