@intutic/shared-types 1.10.0 → 1.10.1

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.
Files changed (122) hide show
  1. package/README.md +1 -1
  2. package/dist/anomaly.d.ts +11 -0
  3. package/dist/anomaly.d.ts.map +1 -1
  4. package/dist/api-contracts.d.ts +97 -9
  5. package/dist/api-contracts.d.ts.map +1 -1
  6. package/dist/api-contracts.js +9 -0
  7. package/dist/api-contracts.js.map +1 -1
  8. package/dist/auth.d.ts +157 -1
  9. package/dist/auth.d.ts.map +1 -1
  10. package/dist/auth.js +39 -1
  11. package/dist/auth.js.map +1 -1
  12. package/dist/billing.d.ts +2 -99
  13. package/dist/billing.d.ts.map +1 -1
  14. package/dist/billing.js +2 -17
  15. package/dist/billing.js.map +1 -1
  16. package/dist/enums.d.ts +341 -4
  17. package/dist/enums.d.ts.map +1 -1
  18. package/dist/enums.js +369 -6
  19. package/dist/enums.js.map +1 -1
  20. package/dist/errors.d.ts +20 -1
  21. package/dist/errors.d.ts.map +1 -1
  22. package/dist/errors.js +20 -1
  23. package/dist/errors.js.map +1 -1
  24. package/dist/finops.d.ts +97 -1
  25. package/dist/finops.d.ts.map +1 -1
  26. package/dist/governanceCoverage.d.ts +82 -0
  27. package/dist/governanceCoverage.d.ts.map +1 -0
  28. package/dist/governanceCoverage.js +72 -0
  29. package/dist/governanceCoverage.js.map +1 -0
  30. package/dist/guardrailIr.d.ts +287 -0
  31. package/dist/guardrailIr.d.ts.map +1 -0
  32. package/dist/guardrailIr.js +301 -0
  33. package/dist/guardrailIr.js.map +1 -0
  34. package/dist/guardrailRender.d.ts +154 -0
  35. package/dist/guardrailRender.d.ts.map +1 -0
  36. package/dist/guardrailRender.js +440 -0
  37. package/dist/guardrailRender.js.map +1 -0
  38. package/dist/identity.d.ts +75 -0
  39. package/dist/identity.d.ts.map +1 -1
  40. package/dist/identity.js +5 -1
  41. package/dist/identity.js.map +1 -1
  42. package/dist/index.d.ts +34 -14
  43. package/dist/index.d.ts.map +1 -1
  44. package/dist/index.js +124 -2
  45. package/dist/index.js.map +1 -1
  46. package/dist/intelligence.d.ts +37 -11
  47. package/dist/intelligence.d.ts.map +1 -1
  48. package/dist/intelligence.js.map +1 -1
  49. package/dist/modelCatalog.d.ts +89 -0
  50. package/dist/modelCatalog.d.ts.map +1 -0
  51. package/dist/modelCatalog.generated.d.ts +7204 -0
  52. package/dist/modelCatalog.generated.d.ts.map +1 -0
  53. package/dist/modelCatalog.generated.js +576 -0
  54. package/dist/modelCatalog.generated.js.map +1 -0
  55. package/dist/modelCatalog.js +112 -0
  56. package/dist/modelCatalog.js.map +1 -0
  57. package/dist/notifications.d.ts +134 -2
  58. package/dist/notifications.d.ts.map +1 -1
  59. package/dist/observability.d.ts +4 -0
  60. package/dist/observability.d.ts.map +1 -1
  61. package/dist/policyGuardrails.d.ts +433 -0
  62. package/dist/policyGuardrails.d.ts.map +1 -0
  63. package/dist/policyGuardrails.js +91 -0
  64. package/dist/policyGuardrails.js.map +1 -0
  65. package/dist/posturePresets.d.ts +74 -0
  66. package/dist/posturePresets.d.ts.map +1 -0
  67. package/dist/posturePresets.js +139 -0
  68. package/dist/posturePresets.js.map +1 -0
  69. package/dist/providerVerification.d.ts +64 -0
  70. package/dist/providerVerification.d.ts.map +1 -0
  71. package/dist/providerVerification.js +184 -0
  72. package/dist/providerVerification.js.map +1 -0
  73. package/dist/providers.d.ts +93 -0
  74. package/dist/providers.d.ts.map +1 -0
  75. package/dist/providers.js +176 -0
  76. package/dist/providers.js.map +1 -0
  77. package/dist/rulePredicateDsl.d.ts +101 -0
  78. package/dist/rulePredicateDsl.d.ts.map +1 -0
  79. package/dist/rulePredicateDsl.js +263 -0
  80. package/dist/rulePredicateDsl.js.map +1 -0
  81. package/dist/rulePredicateEval.d.ts +38 -0
  82. package/dist/rulePredicateEval.d.ts.map +1 -0
  83. package/dist/rulePredicateEval.js +124 -0
  84. package/dist/rulePredicateEval.js.map +1 -0
  85. package/dist/scriptScan.d.ts +162 -0
  86. package/dist/scriptScan.d.ts.map +1 -0
  87. package/dist/scriptScan.js +362 -0
  88. package/dist/scriptScan.js.map +1 -0
  89. package/dist/secretPatterns.d.ts +43 -0
  90. package/dist/secretPatterns.d.ts.map +1 -0
  91. package/dist/secretPatterns.js +73 -0
  92. package/dist/secretPatterns.js.map +1 -0
  93. package/dist/skillScan.d.ts +166 -0
  94. package/dist/skillScan.d.ts.map +1 -0
  95. package/dist/skillScan.js +398 -0
  96. package/dist/skillScan.js.map +1 -0
  97. package/dist/sop.d.ts +188 -9
  98. package/dist/sop.d.ts.map +1 -1
  99. package/dist/sop.js +54 -2
  100. package/dist/sop.js.map +1 -1
  101. package/dist/sourceProviders.d.ts +41 -0
  102. package/dist/sourceProviders.d.ts.map +1 -0
  103. package/dist/sourceProviders.js +48 -0
  104. package/dist/sourceProviders.js.map +1 -0
  105. package/dist/sync.d.ts +98 -8
  106. package/dist/sync.d.ts.map +1 -1
  107. package/dist/sync.js.map +1 -1
  108. package/dist/toon.d.ts +80 -0
  109. package/dist/toon.d.ts.map +1 -0
  110. package/dist/toon.js +278 -0
  111. package/dist/toon.js.map +1 -0
  112. package/dist/usage.d.ts +23 -0
  113. package/dist/usage.d.ts.map +1 -1
  114. package/dist/wasmHost.d.ts +58 -0
  115. package/dist/wasmHost.d.ts.map +1 -0
  116. package/dist/wasmHost.js +80 -0
  117. package/dist/wasmHost.js.map +1 -0
  118. package/dist/workspaceSettings.d.ts +463 -21
  119. package/dist/workspaceSettings.d.ts.map +1 -1
  120. package/dist/workspaceSettings.js +86 -1
  121. package/dist/workspaceSettings.js.map +1 -1
  122. package/package.json +4 -3
@@ -19,7 +19,56 @@ export type { McpProxyFailBehavior, McpProxyMode, BypassEnforcementTier };
19
19
  * DEFAULT_WORKSPACE_SETTINGS by the control-plane GET handler and the
20
20
  * sync-daemon before writing runtime.env.
21
21
  */
22
+ /** BYOC trace-storage configuration (mirrors the control plane's WorkspaceByocConfig). */
23
+ export interface ByocStorageConfig {
24
+ provider: 'gcs' | 's3' | 'disabled';
25
+ bucketName?: string;
26
+ prefix?: string;
27
+ projectId?: string;
28
+ region?: string;
29
+ accessKeyId?: string;
30
+ secretAccessKey?: string;
31
+ credentials?: string;
32
+ mode?: 'mirror' | 'primary';
33
+ }
22
34
  export interface WorkspaceSettings {
35
+ /**
36
+ * Whether developers' local markdown vaults (Obsidian/Logseq/Foam) may feed
37
+ * the `/fix` command's Memory context on their machines.
38
+ *
39
+ * Enforced by the proxy at connect time via the sync channel. Vault content
40
+ * never reaches the control plane either way — this governs only whether
41
+ * the local search runs at all. Personal notes injected into prompts are a
42
+ * memory-poisoning surface (OWASP agentic T1), which is why the switch is a
43
+ * workspace policy rather than purely personal preference.
44
+ */
45
+ allowLocalMemoryVaults: boolean;
46
+ /**
47
+ * Days of SSO inactivity after which a member's API keys stop authenticating.
48
+ *
49
+ * `null` disables the gate. Defaults to 30 days. SCIM provisioning was removed,
50
+ * so nothing reconciles membership against the identity provider: without this,
51
+ * removing a developer at the IdP stops their dashboard login but not their
52
+ * agents, because API-key auth never consults SSO (TD-218). Setting it makes IdP
53
+ * removal expire the keys on its own.
54
+ *
55
+ * Opt-in on purpose — a CI key belongs to a member who may never log in
56
+ * interactively, and enabling this globally would break those pipelines.
57
+ */
58
+ ssoKeyMaxIdleDays: number | null;
59
+ /**
60
+ * ISO timestamp of when `ssoKeyMaxIdleDays` was switched on, set by the settings
61
+ * endpoint. The gate grants one full window from this point before it refuses
62
+ * anything, so enabling it ramps rather than cutting off members who have no
63
+ * recorded SSO login yet. Cleared when the gate is turned off.
64
+ */
65
+ ssoKeyGateEnabledAt: string | null;
66
+ /**
67
+ * Bring-your-own-cloud trace storage. Optional — absent means Intutic-managed
68
+ * storage. Previously accessed only through `as unknown as` casts; typed here
69
+ * so the settings UI and the control plane share one shape.
70
+ */
71
+ byocStorage?: ByocStorageConfig;
23
72
  /**
24
73
  * What the MCP governance proxy does when the Intutic control plane is
25
74
  * unreachable during a tool call interception attempt.
@@ -29,22 +78,25 @@ export interface WorkspaceSettings {
29
78
  * "Governance check failed — Intutic control plane unreachable.
30
79
  * Tool call blocked by workspace policy."
31
80
  *
32
- * Applies to 13/17 harnesses (those with MCP proxy injection).
33
- * See TD-151 for the 4 harnesses this does not reach.
81
+ * Applies to 8/19 harnesses (those with MCP proxy injection — 9 config
82
+ * paths across 8 harnesses, see sync-daemon mcpAutoWrite.ts).
83
+ * See TD-151 for the harnesses this does not reach.
34
84
  */
35
85
  mcpProxyFailBehavior: McpProxyFailBehavior;
36
86
  /**
37
87
  * MCP proxy deployment model.
38
88
  *
39
- * - `'per-session'` (default, Phase 4): a new proxy process is spawned per
89
+ * - `'per-session'` (default): a new proxy process is spawned per
40
90
  * MCP connection. Policy is fetched from control plane at startup with a
41
91
  * 60s in-process TTL.
42
- * - `'daemon'` (Phase 5, stored but not yet active): a long-lived proxy
43
- * daemon shares policy cache across all MCP sessions. Requires macOS
44
- * notarization. See TD-153.
92
+ * - `'daemon'` (active): a long-lived proxy daemon shares its policy cache
93
+ * across all MCP sessions. Requires macOS notarization. See TD-153.
45
94
  *
46
- * In Phase 4, setting this to `'daemon'` is accepted and stored but the
47
- * sync-daemon will log a warning and continue in per-session mode.
95
+ * The sync-daemon writes this value through verbatim to
96
+ * ~/.intutic/env/runtime.env (lib/runtimeEnv.ts) and the MCP proxy honours
97
+ * it: with `'daemon'` set, policy lookups go through the daemon's Unix
98
+ * socket. Caveat: daemon health telemetry is not reported — the
99
+ * health-snapshot route was removed and the dashboard flag is hardcoded off.
48
100
  */
49
101
  mcpProxyMode: McpProxyMode;
50
102
  /**
@@ -68,26 +120,81 @@ export interface WorkspaceSettings {
68
120
  ff_response_cache_semantic?: boolean;
69
121
  /** Phase 5 — MetaClaw prompt evolution engine (Enterprise only) */
70
122
  ff_metaclaw_evolution?: boolean;
123
+ /**
124
+ * Evaluate every detector, record what it would have done, and allow the
125
+ * request anyway. Read by the proxy from `workspace:feature_flags:{ws}`.
126
+ *
127
+ * Declaring it here is not enough on its own — the PUT schema in
128
+ * `routes/workspace.ts` must list it too, because that `z.object` strips
129
+ * unknown keys. `ff_metaclaw_evolution` above was declared here and omitted
130
+ * there, so it has never been settable either.
131
+ */
132
+ ff_shadow_enforcement?: boolean;
133
+ /**
134
+ * Let a MetaClaw evolution proposal auto-apply instead of waiting for
135
+ * human review. Read directly off raw settings JSON by
136
+ * `promptEvolutionService.runEvolutionCycle` — no Valkey mirror, since
137
+ * nothing else needs a hot-path read of it.
138
+ *
139
+ * Also declared here without being settable until now — same "declared,
140
+ * never added to the PUT schema" bug as `ff_shadow_enforcement` above.
141
+ */
142
+ ff_metaclaw_auto_apply?: boolean;
143
+ /**
144
+ * Let a high-confidence SkillOpt config-edit suggestion auto-apply
145
+ * instead of waiting for human review. Mirrored into Valkey
146
+ * (`ff:{workspaceId}:skillopt_auto_apply`) by `persistAndSyncSettings`,
147
+ * since `skillOptService.autoApplyIfEnabled` needs a hot-path read.
148
+ */
149
+ ff_skillopt_auto_apply?: boolean;
150
+ /**
151
+ * Promote `destructive.sql_drop` from `warn` to `block` on the sync
152
+ * daemon's hook-gate path (Wave 7, audit-remediation). Read by
153
+ * `GET /api/v1/policy/resolve` (`routes/evaluate.ts`), which surfaces it
154
+ * as `sqlDropStrictBlock` on the response; the sync daemon's
155
+ * `buildSnapshotRules` (`services/sync-daemon/src/lib/policySnapshot.ts`)
156
+ * applies it as a per-rule override on the next sync cycle — independent
157
+ * of `DESTRUCTIVE_TIER_SEVERITY`, the evidence-gated promotion ramp that
158
+ * governs the OTHER six `DESTRUCTIVE_COMMAND_PATTERNS` entries.
159
+ * `destructive.sql_drop` was never part of that ramp (its own static
160
+ * definition is `severity: 'warn'`, not `'block'`, so the ramp's ternary
161
+ * never reaches it) — its rationale is a genuinely different one
162
+ * (the gate cannot distinguish a dev DSN from a production one; the MCP
163
+ * path already blocks, because the proxy CAN make that distinction).
164
+ * This flag exists for a workspace that wants the hook path to match the
165
+ * MCP path anyway, accepting the dev-DSN false-positive risk explicitly.
166
+ * `false` by default; `true` in the `strict` security posture preset
167
+ * (`posturePresets.ts`) — never auto-promoted by traffic evidence the
168
+ * way the six-pattern ramp is.
169
+ */
170
+ ff_sql_drop_strict_block?: boolean;
71
171
  };
72
- /**
73
- * TD-126 — Autonomous Skill Transfer
74
- *
75
- * When `true`, this workspace participates in the cross-workspace SOP
76
- * propagation system:
77
- * - High-performing validated SOPs (Gödel score ≥ 0.85) from this workspace
78
- * may be cloned to other opt-in workspaces as DRAFT SOPs.
79
- * - This workspace will receive propagated SOPs from other opt-in workspaces
80
- * provided no structurally similar SOP already exists (Jaccard ≥ 0.70).
81
- *
82
- * Defaults to `false` (opt-in only).
83
- */
84
- enableAutonomousSkillTransfer?: boolean;
85
172
  /**
86
173
  * Whether to automatically delete local skills/rules segments that fail
87
174
  * security audits (leakage of secrets or unsafe wildcard command patterns).
88
175
  * Defaults to `false`.
89
176
  */
90
177
  enableLocalSkillAuditDelete?: boolean;
178
+ /**
179
+ * Phase S3. Whether `intutic skill audit` should AUTOMATICALLY run the
180
+ * opt-in Cisco `skill-scanner` integration (`tools/cli/src/lib/ciscoScanner.ts`)
181
+ * alongside native scanning, when the `skill-scanner` binary happens to be
182
+ * on PATH. Off by default — a workspace that never configured this must
183
+ * not start shelling out to an external tool it never asked for.
184
+ *
185
+ * This is distinct from `--engine cisco` (an explicit, per-invocation
186
+ * request that fails loudly if the binary is absent): this setting gates
187
+ * a graceful, best-effort AUTO-run — when true but the binary is absent,
188
+ * the CLI logs an info-level skip and continues with native scanning
189
+ * only, exactly the "opt-in but gracefully degrading" contract this
190
+ * integration promises throughout.
191
+ *
192
+ * No Valkey projection, following the exact precedent
193
+ * `enableLocalSkillAuditDelete` sets immediately above: the CLI reads
194
+ * this straight off the synced `settings` object via `fetchConfig`, and
195
+ * nothing else needs a hot-path read of it.
196
+ */
197
+ ciscoSkillScannerEnabled?: boolean;
91
198
  /**
92
199
  * Configurable trigger keywords for classifying bandit task types.
93
200
  */
@@ -97,6 +204,331 @@ export interface WorkspaceSettings {
97
204
  review?: string[];
98
205
  debugging?: string[];
99
206
  };
207
+ /**
208
+ * Container-image provenance policy, enforced at the gate before a deploy
209
+ * runs. Off unless explicitly enabled — a workspace that never configured
210
+ * this must not start refusing deploys because a default changed.
211
+ *
212
+ * The control plane has no filesystem, so it can only verify images written
213
+ * into the tool call itself. `unverifiableAction` decides what happens to a
214
+ * `kubectl apply -f manifest.yaml`, and defaults to `allow`: refusing every
215
+ * file-based apply would refuse the correct ones too, and a control that
216
+ * broad gets switched off. See imageProvenanceService.ts.
217
+ */
218
+ imageProvenance?: {
219
+ enabled?: boolean;
220
+ /** Refuse any image not pinned to an `@sha256:` digest. */
221
+ requireDigest?: boolean;
222
+ /** Registry prefixes that may be pulled from. Empty means any. */
223
+ allowedRegistries?: string[];
224
+ /** `repository -> approved digests`. Empty means any digest satisfies pinning. */
225
+ approvedDigests?: Record<string, string[]>;
226
+ unverifiableAction?: 'allow' | 'warn' | 'block';
227
+ };
228
+ /**
229
+ * Whether an APPROVED `review_before` decision may let the *matching retried
230
+ * call* through the local gate, instead of only recording the decision.
231
+ *
232
+ * Off (undefined/false) by default. `POST /api/v1/decisions` and its Slack
233
+ * approve button have always recorded a decision — this flag governs a
234
+ * separate, additive effect: when true, approving a decision tied to a
235
+ * `review_before` hold writes a short-lived, exact-match bypass entry
236
+ * (workspace + SOP rule + normalised tool name + hashed target/command) to
237
+ * Valkey, synced to `.intutic/hooks/approved-bypasses.jsonl` and consulted by
238
+ * the gate immediately before it would otherwise block on that rule. It never
239
+ * relaxes the rule itself, never matches fuzzily, and never outlives
240
+ * {@link reviewHoldBypassTtlMinutes}.
241
+ */
242
+ reviewHoldBypassEnabled?: boolean;
243
+ /**
244
+ * Minutes an approved `review_before` bypass stays valid, when
245
+ * {@link reviewHoldBypassEnabled} is true. Defaults to 10 when the feature is
246
+ * on but this is unset; capped at 60 by the settings PUT schema — a bypass is
247
+ * meant to let one already-reviewed retry through, not to stand up a lasting
248
+ * exemption.
249
+ */
250
+ reviewHoldBypassTtlMinutes?: number;
251
+ /**
252
+ * Central egress-enforcement posture, distributed to this workspace's proxies
253
+ * (LLD #63 §4). One of `'off'` | `'monitor'` | `'enforce'`. When set, the
254
+ * sync-daemon writes it to `.intutic/hooks/egress-policy.json` and the proxy
255
+ * hot-reloads it, so an admin sets the mode once here rather than in each
256
+ * developer's local config. Undefined leaves the proxy on its local config /
257
+ * `INTUTIC_EGRESS_MODE` — central management is additive, never a silent
258
+ * override of a deployment that never opted in.
259
+ */
260
+ egressMode?: 'off' | 'monitor' | 'enforce';
261
+ /**
262
+ * Central egress allow policy: exact hosts, `.suffix` domains, or CIDRs the
263
+ * proxy permits in `enforce`/`monitor` mode, distributed alongside
264
+ * {@link egressMode}. UNIONed with the proxy's local allow entries so a
265
+ * developer's local infra allowances are never dropped by a central list.
266
+ */
267
+ egressAllow?: string[];
268
+ /**
269
+ * Approved-models allowlist: model ids the proxy will accept for this
270
+ * workspace's completions. Distributed to the proxy's control-plane cache
271
+ * under `workspace:allowed_models:{workspaceId}` (mirrors the `egressAllow`
272
+ * distribution pattern above).
273
+ *
274
+ * Absent or empty means UNRESTRICTED — matches `egressAllow`'s own
275
+ * backward-compatible default, so a workspace that never configured this
276
+ * must not start refusing completions because a default changed.
277
+ */
278
+ allowedModels?: string[];
279
+ /**
280
+ * Additive MCP server allowlist: server names the MCP governance proxy
281
+ * (`packages/mcp-proxy`) will proxy for this workspace, matched against
282
+ * the `--server-name` identity threaded through by
283
+ * `services/sync-daemon/src/harness/mcpAutoWrite.ts`'s `wrapWithProxy`.
284
+ * Delivered to the proxy the same way `mcpAllowedTools` already is — via
285
+ * `PolicyClient.absorbCuration` (`packages/mcp-proxy/src/policy.ts`),
286
+ * fed from `GET /api/v1/sop/rules` (`services/control-plane/src/routes/
287
+ * sops.ts`).
288
+ *
289
+ * Absent or empty means UNRESTRICTED — the exact same convention as
290
+ * `allowedModels` above: a workspace that never configured this must not
291
+ * start refusing every MCP server because a default changed.
292
+ */
293
+ mcpAllowedServers?: string[];
294
+ /**
295
+ * Workspace-supplied prompt-injection regex sources for the MCP governance
296
+ * proxy (TD-436), on top of its hardcoded floor. Delivered with the rest of
297
+ * the MCP curation; the proxy compiles them and drops one that does not.
298
+ * Absent or empty means the floor alone.
299
+ */
300
+ mcpInjectionPatterns?: string[];
301
+ /**
302
+ * Negotiated per-token rates, by model id, in USD per 1k tokens (TD-434).
303
+ * The `model_pricing` table is LIST price; a workspace paying below list
304
+ * had every savings figure skewed by the difference. Where a model is
305
+ * listed here it is priced at these rates in the routing shadow-savings
306
+ * report; anything else falls back to list. Absent or empty means list
307
+ * for everything.
308
+ */
309
+ contractedRates?: Record<string, {
310
+ inputCostPer1k: number;
311
+ outputCostPer1k: number;
312
+ }>;
313
+ /**
314
+ * Whether agents in this workspace must run inside a sandbox (LLD #63 §6).
315
+ * - `'off'` (default): `intutic exec` runs on the host as before.
316
+ * - `'warn'`: an un-sandboxed `intutic exec` runs but prints a warning.
317
+ * - `'require'`: `intutic exec` refuses to run un-sandboxed and tells the
318
+ * developer to add `--sandbox`.
319
+ *
320
+ * Enforced client-side by the CLI (the natural point — only it knows whether
321
+ * `--sandbox` was passed), the same layer as the harness-config controls. A
322
+ * server-side attestation (the proxy refusing traffic that cannot prove it
323
+ * originated in a sandbox) is a stronger follow-on, noted in the LLD.
324
+ * `undefined` leaves it off; open core, which has no control plane to read
325
+ * this from, is therefore never affected.
326
+ */
327
+ sandboxRequirement?: 'off' | 'warn' | 'require';
328
+ /**
329
+ * Promotes REPEATED anomaly findings within one session into enforcement
330
+ * (HIJACK steers with a corrective card, KILL blocks outright) — on top
331
+ * of ordinary per-trace detection, which always runs regardless of this
332
+ * setting. See `anomalyEnforcementService.ts` for the full mechanism:
333
+ * off by default and a single false positive can never trigger it, only
334
+ * a sustained pattern within one session can.
335
+ *
336
+ * Stored under the snake_case key `anomaly_enforcement`, not
337
+ * `anomalyEnforcement` — deliberately inconsistent with every other
338
+ * field here, because that key is already the load-bearing contract
339
+ * `anomalyEnforcementService.ts` (and its tests) read and write
340
+ * directly; renaming it to match this file's camelCase convention would
341
+ * be a breaking migration for every already-stored workspace setting,
342
+ * for no behavioral benefit.
343
+ *
344
+ * This is the wire/stored shape, not the resolved one — the read side
345
+ * additionally floors `minRepeats` at 2 (a workspace cannot configure
346
+ * its way to blocking on a single finding) and falls back `action` to
347
+ * `HIJACK` for anything other than exactly `'KILL'`. The PUT schema
348
+ * mirrors that floor as a 400 at write time, so an operator who tries a
349
+ * lower value is told now rather than discovering later that it was
350
+ * silently clamped.
351
+ */
352
+ anomaly_enforcement?: {
353
+ enabled?: boolean;
354
+ minRepeats?: number;
355
+ minConfidence?: number;
356
+ action?: 'HIJACK' | 'KILL';
357
+ /** Categories eligible for promotion. Empty/absent means all of them. */
358
+ categories?: string[];
359
+ };
360
+ /**
361
+ * Server-side trajectory monitoring mode (LLD #52, parallel monitoring).
362
+ * Read by `services/control-plane/src/services/trajectoryAnalysisService.ts`'s
363
+ * `getWorkspaceMonitorMode` on every `/trajectory/analyze` call:
364
+ *
365
+ * - `'ACTIVE'`: a CRITICAL/INTERVENE verdict can escalate into the
366
+ * anomaly-enforcement occurrence counter (KILL/HIJACK promotion) in
367
+ * addition to alerting.
368
+ * - `'PASSIVE'` (default): trajectories are analyzed and alerts are
369
+ * recorded/dispatched, but nothing ever escalates to enforcement.
370
+ * - `'OFF'`: trajectory analysis is skipped entirely for the workspace
371
+ * (capability-miss production still runs — it is a separate feature).
372
+ *
373
+ * Stored under the snake_case key `trajectory_monitor_mode`, not
374
+ * `trajectoryMonitorMode` — deliberately inconsistent with this file's
375
+ * camelCase convention, following the exact precedent
376
+ * {@link WorkspaceSettings.anomaly_enforcement} documents below: that
377
+ * snake_case key is already the load-bearing contract the reading service
378
+ * consumes from raw jsonb, and renaming it would be a breaking migration
379
+ * for every already-stored workspace setting for no behavioral benefit.
380
+ *
381
+ * CONSTRAINT: the entry in {@link DEFAULT_WORKSPACE_SETTINGS} MUST stay
382
+ * `'PASSIVE'`, byte-for-byte matching `getWorkspaceMonitorMode`'s own
383
+ * absent-key fallback. The enforcement path reads the raw jsonb and applies
384
+ * its own fallback; the default here only affects GET/display resolution —
385
+ * if the two ever diverge, the UI would show a different mode than the one
386
+ * enforcement actually runs under.
387
+ */
388
+ trajectory_monitor_mode?: 'ACTIVE' | 'PASSIVE' | 'OFF';
389
+ /**
390
+ * Additive MCP tool allowlist, enforced by the MCP governance proxy
391
+ * (`packages/mcp-proxy`) and served to it by
392
+ * `services/control-plane/src/lib/mcpCuration.ts` (both the `/sop/rules`
393
+ * and `/policy/resolve` projections). Empty/absent means UNRESTRICTED —
394
+ * the same convention as {@link mcpAllowedServers} below, whose doc
395
+ * comment has referenced this field as its sibling since it was written.
396
+ * Was settable via the PUT schema but never declared here — the inverse
397
+ * of the usual both-places defect (schema-only instead of type-only),
398
+ * caught by the settingsKeyParity gate.
399
+ */
400
+ mcpAllowedTools?: string[];
401
+ /**
402
+ * Per-tool `tools/list` description overrides, curated by an operator and
403
+ * substituted by the MCP governance proxy before descriptions reach the
404
+ * model. Delivered alongside {@link mcpAllowedTools} via
405
+ * `lib/mcpCuration.ts`. Absent means no overrides. Declared here for the
406
+ * same reason as `mcpAllowedTools` immediately above.
407
+ */
408
+ mcpToolDescriptionOverrides?: Record<string, string>;
409
+ /**
410
+ * Governed decisions log: whether the sync-daemon writes a bounded,
411
+ * auto-maintained record of GOVERNANCE decisions (adjudications,
412
+ * approved/rejected decisions, SOP-related settings changes) as context
413
+ * files the coding agent's harness reads — `.intutic/DECISIONS.md` (the
414
+ * full bounded record) plus a marker-delimited section injected into the
415
+ * `claude-code` harness's own regenerated config file. See
416
+ * `services/control-plane/src/routes/workspace.ts`'s
417
+ * `GET /api/v1/workspace/decisions-digest` and
418
+ * `services/sync-daemon/src/lib/decisionsDigest.ts`.
419
+ *
420
+ * Deliberately narrow: this is governance-decision records only, never
421
+ * conversational memory or general context management (this repo pivoted
422
+ * away from that harness product — see this repo's own CLAUDE.md history).
423
+ *
424
+ * Off (undefined/false) by default — per the standing rule elsewhere in
425
+ * this file (see {@link imageProvenance}, {@link reviewHoldBypassEnabled}):
426
+ * a workspace that never configured this must not start seeing new files
427
+ * written into its tree, and a growing context file is token spend the
428
+ * product must not silently impose on every workspace.
429
+ */
430
+ decisionsLogEnabled?: boolean;
431
+ /**
432
+ * Opt-in LLM-based semantic analysis of skill files (Phase S5, TD-357),
433
+ * on top of the always-on deterministic `scanSkillContent` pattern scan.
434
+ * When true:
435
+ * - The CLI (`intutic skill audit`) attaches the FULL content of a
436
+ * `SKILL.md` file (capped at 64 KiB) to its `/skills/report` entries —
437
+ * never bundled scripts, which stay S2/S3/S4's domain.
438
+ * - The control plane judges that content once per distinct sha256 (a
439
+ * 30-day Valkey marker skips re-judging unchanged content), subject to
440
+ * a per-workspace daily judge-call cap
441
+ * (`SEMANTIC_SKILL_JUDGE_DAILY_CAP`), and strips `content` from what it
442
+ * persists — only the verdict (`'clean' | 'suspicious' | 'malicious' |
443
+ * 'unjudged'`) is stored, never the judged text.
444
+ *
445
+ * Off (undefined/false) by default, per the standing rule elsewhere in
446
+ * this file: full skill content transiting the control plane is a real
447
+ * privacy/cost tradeoff a workspace must opt into, not one a default
448
+ * change should impose. See `apps/docs/guide/skill-scanning.md`'s
449
+ * "Semantic analysis (optional)" section for the full transit/retention
450
+ * statement.
451
+ */
452
+ semanticSkillAnalysisEnabled?: boolean;
453
+ /**
454
+ * BYO judge model for the MANAGED LLM-as-judge path (LLD #70).
455
+ *
456
+ * When set, chunk/finalize judge calls for this workspace run on this
457
+ * model, routed through the platform data-plane gateway with the
458
+ * workspace's own vk_ — so the completion is billed to the workspace's
459
+ * provider key (the key wizard), not the platform. Trade-offs, stated
460
+ * plainly rather than implied:
461
+ * - This REPLACES the platform's independent trusted monitor
462
+ * (`INTUTIC_TRUSTED_MONITOR_MODEL`) for this workspace. Verdicts are
463
+ * stamped `[workspace-judge]`; a judge equal to the monitored model is
464
+ * additionally stamped `[self-graded]` — provenance stays visible, it
465
+ * is never re-labelled as independent.
466
+ * - Judged content still transits the control plane and the platform
467
+ * gateway to the workspace's provider. The self-hosted local judge
468
+ * (`INTUTIC_GATEWAY_LOCAL_JUDGE`) remains the keep-content-in-org path.
469
+ * - Chunk judging fires per paragraph — that cost lands on the
470
+ * workspace's provider key.
471
+ * - A workspace policy KILL (DLP, budget) on the judge call itself fails
472
+ * safe to the standard judge-unavailable note, not a bypass.
473
+ *
474
+ * `null`/absent = the platform trusted monitor, exactly as before.
475
+ */
476
+ managedJudgeModel?: string | null;
477
+ /**
478
+ * Opt-in VirusTotal hash lookup for skill-bundled SCRIPTS (Phase S4,
479
+ * TD-361). When true, and only when a `connector_credentials` row for
480
+ * provider `'virustotal'` is also stored, `POST .../skills/report`
481
+ * fire-and-forget enqueues any reported script sha256 hashes for a
482
+ * `GET /api/v3/files/{sha256}` lookup — never an upload, never SKILL.md
483
+ * prose, see `virusTotalService.ts`'s own doc comment for the full
484
+ * hash-only doctrine. Off by default, per the standing rule elsewhere in
485
+ * this file: a workspace that never configured this must not start
486
+ * sending script hashes to a third party because a default changed.
487
+ *
488
+ * Distinct from, and narrower than, this product's standing decline of a
489
+ * global MCP-server-reputation/VirusTotal integration — see
490
+ * `apps/docs/guide/mcp-governance.md` and `docs/TECH_DEBT.md` TD-359 for
491
+ * that separate decision, which this setting does not reverse.
492
+ */
493
+ virusTotalSkillLookupEnabled?: boolean;
494
+ /**
495
+ * Fraction of ingested traces that receive the two heavier, LLM-adjacent
496
+ * security probes — `traceIngestClassifier.classifyTraceAtIngest`'s
497
+ * baseline/history-derived anomaly checks and `llmProbeService`'s
498
+ * output probe (Wave 7, audit-remediation). `1.0` (every trace) is the
499
+ * default and matches today's unconditional behavior exactly — setting
500
+ * this field at all is the opt-in, not any particular value.
501
+ *
502
+ * Exists to turn an informal "spot-check 1-in-N traces" practice into a
503
+ * config answer instead of a second, undocumented detection lane a
504
+ * workspace has no visibility into or control over. `0` disables both
505
+ * probes entirely (still runs the always-on deterministic checks
506
+ * elsewhere in the ingest path — this field only gates these two).
507
+ * Clamped to `[0, 1]` at the read site; an out-of-range stored value
508
+ * (there is no PUT-time validation preventing one) is treated as `1.0`,
509
+ * never as `0` — a malformed setting must not silently blind detection.
510
+ */
511
+ securityProbeSampleRate?: number;
512
+ /**
513
+ * Whether corrective governance cards accumulate adoption labels in
514
+ * `governance_card_labels` — the dataset a future judge fine-tune trains on.
515
+ *
516
+ * When true (the default), every corrective card queued for this workspace
517
+ * writes a row (card snapshot + queued_at), the proxy's delivery marker sets
518
+ * delivered_at, and the label sweep infers ADOPTED/NOT_ADOPTED from the
519
+ * session's subsequent traces unless a human has already ruled. Human labels
520
+ * (`label_source='human'`) always win over auto labels and are weighted
521
+ * higher when the dataset is used.
522
+ *
523
+ * When false, row creation and the auto-watcher stop, and the human labeling
524
+ * route refuses — data retention stops. Card generation, queueing, and
525
+ * delivery are UNCHANGED either way: opting out stops the dataset, not
526
+ * governance itself. On by default because the rows contain only what the
527
+ * workspace's own traces already persist (the card text the agent was shown),
528
+ * no third party is involved, and the aggregate is what makes the judge
529
+ * improve for everyone.
530
+ */
531
+ governanceCardLabelingEnabled: boolean;
100
532
  }
101
533
  /**
102
534
  * Default workspace settings.
@@ -109,4 +541,14 @@ export declare const DEFAULT_WORKSPACE_SETTINGS: WorkspaceSettings;
109
541
  * Ensures callers always receive a complete WorkspaceSettings object.
110
542
  */
111
543
  export declare function resolveWorkspaceSettings(stored: Partial<WorkspaceSettings> | null | undefined): WorkspaceSettings;
544
+ /**
545
+ * Read `securityProbeSampleRate` off already-resolved settings, clamped to
546
+ * the safe (unblinded) side of any bad value. The PUT schema in
547
+ * `routes/workspace.ts` bounds new writes to `[0, 1]`, but this also covers
548
+ * a value written before that bound existed, or one that reached the row by
549
+ * a path other than that route (a script, a fixture) — `NaN`, `undefined`,
550
+ * negative or `>1` all resolve to `1.0`. Only a genuine finite value in
551
+ * range is trusted to lower the sample rate.
552
+ */
553
+ export declare function resolveSecurityProbeSampleRate(settings: WorkspaceSettings): number;
112
554
  //# sourceMappingURL=workspaceSettings.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"workspaceSettings.d.ts","sourceRoot":"","sources":["../src/workspaceSettings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AAG3F,YAAY,EAAE,oBAAoB,EAAE,YAAY,EAAE,qBAAqB,EAAE,CAAA;AAEzE;;;;;;GAMG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;;;;;;;;OAWG;IACH,oBAAoB,EAAE,oBAAoB,CAAA;IAE1C;;;;;;;;;;;;OAYG;IACH,YAAY,EAAE,YAAY,CAAA;IAE1B;;;;;;;;;;;;OAYG;IACH,qBAAqB,EAAE,qBAAqB,CAAA;IAC5C,yDAAyD;IACzD,YAAY,CAAC,EAAE;QACb,iBAAiB,CAAC,EAAE,OAAO,CAAA;QAC3B,uBAAuB,CAAC,EAAE,OAAO,CAAA;QACjC,0BAA0B,CAAC,EAAE,OAAO,CAAA;QACpC,mEAAmE;QACnE,qBAAqB,CAAC,EAAE,OAAO,CAAA;KAChC,CAAA;IAED;;;;;;;;;;;OAWG;IACH,6BAA6B,CAAC,EAAE,OAAO,CAAA;IAEvC;;;;OAIG;IACH,2BAA2B,CAAC,EAAE,OAAO,CAAA;IAErC;;OAEG;IACH,cAAc,CAAC,EAAE;QACf,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;QAClB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;QACrB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;QACjB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;KACrB,CAAA;CACF;AAED;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,EAAE,iBAiBxC,CAAA;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC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;;;;OAoBG;IACH,4BAA4B,CAAC,EAAE,OAAO,CAAA;IAEtC;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAEjC;;;;;;;;;;;;;;;OAeG;IACH,4BAA4B,CAAC,EAAE,OAAO,CAAA;IAEtC;;;;;;;;;;;;;;;;OAgBG;IACH,uBAAuB,CAAC,EAAE,MAAM,CAAA;IAEhC;;;;;;;;;;;;;;;;;;OAkBG;IACH,6BAA6B,EAAE,OAAO,CAAA;CACvC;AAED;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,EAAE,iBAsFxC,CAAA;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAAG,IAAI,GAAG,SAAS,GACpD,iBAAiB,CAKnB;AAED;;;;;;;;GAQG;AACH,wBAAgB,8BAA8B,CAAC,QAAQ,EAAE,iBAAiB,GAAG,MAAM,CAIlF"}
@@ -14,6 +14,7 @@
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.DEFAULT_WORKSPACE_SETTINGS = void 0;
16
16
  exports.resolveWorkspaceSettings = resolveWorkspaceSettings;
17
+ exports.resolveSecurityProbeSampleRate = resolveSecurityProbeSampleRate;
17
18
  /**
18
19
  * Default workspace settings.
19
20
  * Applied when a workspace has no explicit settings (new workspaces)
@@ -21,21 +22,90 @@ exports.resolveWorkspaceSettings = resolveWorkspaceSettings;
21
22
  */
22
23
  exports.DEFAULT_WORKSPACE_SETTINGS = {
23
24
  mcpProxyFailBehavior: 'open',
25
+ allowLocalMemoryVaults: true,
26
+ // ON by default. Without it, removing a developer at the identity provider stops
27
+ // their dashboard login but not their agents, and nothing reconciles membership.
28
+ // 30 days is long enough that an ordinary working month keeps a key alive, and
29
+ // short enough that an offboarded developer's agents stop within a sprint. Set to
30
+ // null to disable. Automation keys are exempt (api_keys.is_service_account), and
31
+ // the gate only applies to workspaces that actually have an SSO provider.
32
+ ssoKeyMaxIdleDays: 30,
33
+ ssoKeyGateEnabledAt: null,
24
34
  mcpProxyMode: 'per-session',
25
35
  bypassEnforcementTier: 'rewrite',
26
36
  featureFlags: {
27
37
  ff_bandit_routing: false,
28
38
  ff_response_cache_exact: false,
29
39
  ff_response_cache_semantic: false,
40
+ ff_metaclaw_evolution: false,
41
+ // Off by default, and the proxy resolves an absent flag to false as well —
42
+ // an unreachable flag service must never silently disable enforcement.
43
+ ff_shadow_enforcement: false,
44
+ ff_metaclaw_auto_apply: false,
45
+ ff_skillopt_auto_apply: false,
46
+ // Off by default — see the field doc. The `strict` security posture
47
+ // preset turns it on; nothing else does.
48
+ ff_sql_drop_strict_block: false,
30
49
  },
31
- enableAutonomousSkillTransfer: false,
32
50
  enableLocalSkillAuditDelete: false,
51
+ // Off by default — see the field doc above. A workspace must explicitly
52
+ // opt in before the CLI shells out to any externally-installed tool.
53
+ ciscoSkillScannerEnabled: false,
54
+ // Off by default — full skill content transiting the control plane for
55
+ // semantic judging is opt-in. See the field doc for the full statement.
56
+ semanticSkillAnalysisEnabled: false,
33
57
  banditKeywords: {
34
58
  testing: ['test', 'spec', 'assert', 'vitest', 'jest', 'unittest'],
35
59
  deployment: ['deploy', 'release', 'kubernetes', 'docker', 'gke', 'pipeline', 'ci/cd'],
36
60
  review: ['review', 'audit', 'lint', 'eslint', 'pr'],
37
61
  debugging: ['fix', 'bug', 'issue', 'error', 'crash', 'debug'],
38
62
  },
63
+ // Off, and `enabled` must be literally true to turn it on. A workspace that
64
+ // never configured image provenance must not begin refusing deploys.
65
+ imageProvenance: {
66
+ enabled: false,
67
+ requireDigest: true,
68
+ allowedRegistries: [],
69
+ approvedDigests: {},
70
+ unverifiableAction: 'allow',
71
+ },
72
+ // Off by default — approving a review_before decision is observation-only
73
+ // until a workspace opts in. See the field doc for what turning it on does.
74
+ reviewHoldBypassEnabled: false,
75
+ // Only load-bearing once reviewHoldBypassEnabled is true; the value here is
76
+ // what "enabled but unset" resolves to.
77
+ reviewHoldBypassTtlMinutes: 10,
78
+ // Platform trusted monitor judges by default — see the field doc for what
79
+ // setting a workspace's own model trades away.
80
+ managedJudgeModel: null,
81
+ // Off by default — see the field doc for why a growing auto-written
82
+ // context file must be opt-in.
83
+ decisionsLogEnabled: false,
84
+ // MUST match getWorkspaceMonitorMode's absent-key fallback in
85
+ // trajectoryAnalysisService.ts exactly ('PASSIVE'): the enforcement path
86
+ // reads the raw jsonb with its own fallback, so this default is display
87
+ // resolution only — a different value here would make the UI show a mode
88
+ // enforcement does not actually run under. See the field doc.
89
+ trajectory_monitor_mode: 'PASSIVE',
90
+ // Off by default — mirrors anomalyEnforcementService.ts's own DISABLED
91
+ // default exactly, so a workspace that never configures this sees the
92
+ // identical values whether resolved here or read directly from the DB.
93
+ anomaly_enforcement: {
94
+ enabled: false,
95
+ minRepeats: 3,
96
+ minConfidence: 0.8,
97
+ action: 'HIJACK',
98
+ categories: [],
99
+ },
100
+ // Off by default — see the field doc for the hash-only doctrine and why
101
+ // this must never turn on for a workspace that never configured it.
102
+ virusTotalSkillLookupEnabled: false,
103
+ // ON by default — see the field doc. Opting out stops label retention for
104
+ // the judge fine-tuning dataset, never card delivery itself.
105
+ governanceCardLabelingEnabled: true,
106
+ // 1.0 = every trace, matching the unconditional behavior this knob
107
+ // replaces exactly. See the field doc for what a lower value gates.
108
+ securityProbeSampleRate: 1.0,
39
109
  };
40
110
  /**
41
111
  * Merge partial stored settings with defaults.
@@ -47,4 +117,19 @@ function resolveWorkspaceSettings(stored) {
47
117
  ...(stored ?? {}),
48
118
  };
49
119
  }
120
+ /**
121
+ * Read `securityProbeSampleRate` off already-resolved settings, clamped to
122
+ * the safe (unblinded) side of any bad value. The PUT schema in
123
+ * `routes/workspace.ts` bounds new writes to `[0, 1]`, but this also covers
124
+ * a value written before that bound existed, or one that reached the row by
125
+ * a path other than that route (a script, a fixture) — `NaN`, `undefined`,
126
+ * negative or `>1` all resolve to `1.0`. Only a genuine finite value in
127
+ * range is trusted to lower the sample rate.
128
+ */
129
+ function resolveSecurityProbeSampleRate(settings) {
130
+ const rate = settings.securityProbeSampleRate;
131
+ if (typeof rate !== 'number' || !Number.isFinite(rate) || rate < 0 || rate > 1)
132
+ return 1.0;
133
+ return rate;
134
+ }
50
135
  //# sourceMappingURL=workspaceSettings.js.map