shield-llm 0.7.3 → 0.7.4
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/README.md +16 -2
- package/dist/{chunk-XMFALD5J.js → chunk-WH32F52L.js} +1 -1
- package/dist/cli.js +7 -2
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -195,8 +195,8 @@ All five are flagged for human review. Nothing auto-merges.
|
|
|
195
195
|
"root": ".",
|
|
196
196
|
"language": "ts",
|
|
197
197
|
"anchors": {
|
|
198
|
-
"system_prompt": { "file": "src/prompt.ts", "export": "
|
|
199
|
-
"output_render": { "file": "src/render.ts", "export": "
|
|
198
|
+
"system_prompt": { "file": "src/ai/system-prompt.ts", "export": "SYSTEM_PROMPT_EFFECTIVE" },
|
|
199
|
+
"output_render": { "file": "src/render/message.ts", "export": "renderMessage" }
|
|
200
200
|
},
|
|
201
201
|
"redeploy": {
|
|
202
202
|
"command": "pnpm build && pnpm deploy:staging",
|
|
@@ -211,6 +211,20 @@ An anchor you have not declared is a soft skip: the recipe does not run, and the
|
|
|
211
211
|
output names the exact config key to add. An anchor pointing at a file or export
|
|
212
212
|
that does not exist is a hard error, because a stale config fakes coverage.
|
|
213
213
|
|
|
214
|
+
The two anchors need a precise shape, because the recipes edit them:
|
|
215
|
+
|
|
216
|
+
- **`system_prompt`** names the value your code actually sends to the model,
|
|
217
|
+
written as a composition line: `export const SYSTEM_PROMPT_EFFECTIVE = SYSTEM_PROMPT;`
|
|
218
|
+
(no type annotation, ending with `;`). Your prompt itself stays in its own
|
|
219
|
+
constant, in any form; the recipes never touch it. They add guardrail
|
|
220
|
+
constants above that line and rewrite it to
|
|
221
|
+
`[SYSTEM_PROMPT, SHIELD_GUARDRAIL_…].join("\n\n")`.
|
|
222
|
+
- **`output_render`** is a function declaration named exactly `renderMessage`
|
|
223
|
+
(`export function renderMessage(text) { … }`, not an arrow function), in a
|
|
224
|
+
file one level below `src/`. The output recipes rename it, wrap it, and import
|
|
225
|
+
their helper from `src/shield/`. Two output recipes cannot both wrap it in the
|
|
226
|
+
same run: the second one is skipped as a conflict.
|
|
227
|
+
|
|
214
228
|
### What "verified" actually means
|
|
215
229
|
|
|
216
230
|
`fix --verify` redeploys your target with `codebase.redeploy`, then replays each
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __cjs_createRequire } from "module"; import { fileURLToPath as __cjs_fileURLToPath } from "url"; import { dirname as __cjs_dirname } from "path"; const __filename = __cjs_fileURLToPath(import.meta.url); const __dirname = __cjs_dirname(__filename); const require = __cjs_createRequire(import.meta.url);
|
|
2
2
|
|
|
3
3
|
// package.json
|
|
4
|
-
var version = "0.7.
|
|
4
|
+
var version = "0.7.4";
|
|
5
5
|
|
|
6
6
|
// src/config/schema.ts
|
|
7
7
|
import { z as z2 } from "zod";
|
package/dist/cli.js
CHANGED
|
@@ -67,7 +67,7 @@ import {
|
|
|
67
67
|
sha256Hex,
|
|
68
68
|
summarizeAttackErrors,
|
|
69
69
|
version
|
|
70
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-WH32F52L.js";
|
|
71
71
|
|
|
72
72
|
// src/load-env.ts
|
|
73
73
|
try {
|
|
@@ -5600,7 +5600,12 @@ async function verifyClaimsCommand(opts) {
|
|
|
5600
5600
|
baseline: claim.benignBaseline,
|
|
5601
5601
|
contract: claim.contract,
|
|
5602
5602
|
target,
|
|
5603
|
-
|
|
5603
|
+
// The same judge the replay used, as `fix --verify` does. This passed
|
|
5604
|
+
// `opts.evaluator`, which only tests set: for a logged-in user the gate
|
|
5605
|
+
// always found "no judge", so a prompt-level claim could close only with
|
|
5606
|
+
// --assume-benign-green. A regex evaluator cannot judge benign answers,
|
|
5607
|
+
// hence `backed`.
|
|
5608
|
+
evaluator: backed ? evaluator : void 0,
|
|
5604
5609
|
assumeGreen: opts.assumeBenignGreen
|
|
5605
5610
|
});
|
|
5606
5611
|
const outcome = resolveClaim({
|
package/dist/index.js
CHANGED