@unorouter/verify-core 0.1.0 → 0.2.0
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/detectors/thinking-signature.d.ts +70 -0
- package/dist/detectors/thinking-signature.d.ts.map +1 -0
- package/dist/detectors/thinking-signature.js +177 -0
- package/dist/detectors/thinking-signature.js.map +1 -0
- package/dist/runner.d.ts +5 -0
- package/dist/runner.d.ts.map +1 -1
- package/dist/runner.js +14 -1
- package/dist/runner.js.map +1 -1
- package/dist/types.d.ts +3 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +4 -2
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Anthropic thinking-signature check.
|
|
3
|
+
*
|
|
4
|
+
* Claude attaches a server-generated `signature` to every thinking block. A
|
|
5
|
+
* relay serving some other model cannot produce one, so this is the only
|
|
6
|
+
* evidence here that does not rest on asking the model who it is: identity and
|
|
7
|
+
* behaviour probes can be coached with a system prompt, a signature cannot.
|
|
8
|
+
*
|
|
9
|
+
* What it does NOT prove: which tier answered. Sonnet returns a perfectly valid
|
|
10
|
+
* signature when sold as Opus, so a pass here still needs the tier checks.
|
|
11
|
+
*
|
|
12
|
+
* Ported from veridrop (AGPL-3.0), whose detector stops at "a signature-shaped
|
|
13
|
+
* string is present".
|
|
14
|
+
*
|
|
15
|
+
* Their DESIGN.md also specifies a replay step (hand the thinking block back so
|
|
16
|
+
* Anthropic re-validates the signature, rejecting a forgery with 400/422) which
|
|
17
|
+
* they never implemented. We built and measured it: **it does not work through a
|
|
18
|
+
* relay**. Tested against two live upstreams (a6 merchant 3542 and pol) by
|
|
19
|
+
* replaying a genuine block and then the same block with 308 bytes of random
|
|
20
|
+
* base64 in place of the signature. Both upstreams returned 200 for both. A
|
|
21
|
+
* relay re-issues the turn to its own backend rather than passing our thinking
|
|
22
|
+
* block through, so nothing ever validates it.
|
|
23
|
+
*
|
|
24
|
+
* `strict` therefore stays off by default and is documented as proving only
|
|
25
|
+
* that the endpoint accepts the block, not that the signature is real. Do not
|
|
26
|
+
* present it as cryptographic proof.
|
|
27
|
+
*/
|
|
28
|
+
import type { TransportFn } from "../transport";
|
|
29
|
+
export type SignatureState =
|
|
30
|
+
/** Signed thinking block: a genuine Anthropic path answered. */
|
|
31
|
+
"signed"
|
|
32
|
+
/**
|
|
33
|
+
* Thought, but no signature. Expected when the lane crosses an
|
|
34
|
+
* OpenAI-shaped hop, which has no field to carry one, so this is
|
|
35
|
+
* unprovable rather than fake. Never a hard fail on its own.
|
|
36
|
+
*/
|
|
37
|
+
| "unsigned"
|
|
38
|
+
/** Thinking was requested and no block came back at all. */
|
|
39
|
+
| "no-thinking"
|
|
40
|
+
/** Model or endpoint cannot be asked; carries no evidence either way. */
|
|
41
|
+
| "skipped";
|
|
42
|
+
export type SignatureResult = {
|
|
43
|
+
state: SignatureState;
|
|
44
|
+
signatureLength: number;
|
|
45
|
+
/** First 32 chars, for the report; never the whole signature. */
|
|
46
|
+
signaturePrefix: string | null;
|
|
47
|
+
thinkingChars: number;
|
|
48
|
+
/** Only set when the replay check actually ran. */
|
|
49
|
+
replayVerified?: boolean;
|
|
50
|
+
reason?: string;
|
|
51
|
+
};
|
|
52
|
+
export declare function thinkingModeFor(model: string): {
|
|
53
|
+
kind: "adaptive" | "extended";
|
|
54
|
+
} | null;
|
|
55
|
+
export declare function checkThinkingSignature(opts: {
|
|
56
|
+
transport: TransportFn;
|
|
57
|
+
baseUrl: string;
|
|
58
|
+
apiKey: string;
|
|
59
|
+
model: string;
|
|
60
|
+
timeoutMs: number;
|
|
61
|
+
/**
|
|
62
|
+
* Replay the thinking block to the same endpoint. Measured as NOT proving
|
|
63
|
+
* authenticity through a relay (see the module docstring): both a genuine and
|
|
64
|
+
* a forged signature come back 200, because the relay re-issues the turn
|
|
65
|
+
* upstream instead of forwarding our block. Off by default; it only tells you
|
|
66
|
+
* the endpoint accepts a thinking block in the request.
|
|
67
|
+
*/
|
|
68
|
+
strict?: boolean;
|
|
69
|
+
}): Promise<SignatureResult>;
|
|
70
|
+
//# sourceMappingURL=thinking-signature.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thinking-signature.d.ts","sourceRoot":"","sources":["../../src/detectors/thinking-signature.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAqBhD,MAAM,MAAM,cAAc;AACxB,gEAAgE;AAC9D,QAAQ;AACV;;;;GAIG;GACD,UAAU;AACZ,4DAA4D;GAC1D,aAAa;AACf,yEAAyE;GACvE,SAAS,CAAC;AAEd,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,cAAc,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,iEAAiE;IACjE,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,mDAAmD;IACnD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAkBF,wBAAgB,eAAe,CAC7B,KAAK,EAAE,MAAM,GACZ;IAAE,IAAI,EAAE,UAAU,GAAG,UAAU,CAAA;CAAE,GAAG,IAAI,CAK1C;AA4BD,wBAAsB,sBAAsB,CAAC,IAAI,EAAE;IACjD,SAAS,EAAE,WAAW,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,GAAG,OAAO,CAAC,eAAe,CAAC,CA0E3B"}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Anthropic thinking-signature check.
|
|
3
|
+
*
|
|
4
|
+
* Claude attaches a server-generated `signature` to every thinking block. A
|
|
5
|
+
* relay serving some other model cannot produce one, so this is the only
|
|
6
|
+
* evidence here that does not rest on asking the model who it is: identity and
|
|
7
|
+
* behaviour probes can be coached with a system prompt, a signature cannot.
|
|
8
|
+
*
|
|
9
|
+
* What it does NOT prove: which tier answered. Sonnet returns a perfectly valid
|
|
10
|
+
* signature when sold as Opus, so a pass here still needs the tier checks.
|
|
11
|
+
*
|
|
12
|
+
* Ported from veridrop (AGPL-3.0), whose detector stops at "a signature-shaped
|
|
13
|
+
* string is present".
|
|
14
|
+
*
|
|
15
|
+
* Their DESIGN.md also specifies a replay step (hand the thinking block back so
|
|
16
|
+
* Anthropic re-validates the signature, rejecting a forgery with 400/422) which
|
|
17
|
+
* they never implemented. We built and measured it: **it does not work through a
|
|
18
|
+
* relay**. Tested against two live upstreams (a6 merchant 3542 and pol) by
|
|
19
|
+
* replaying a genuine block and then the same block with 308 bytes of random
|
|
20
|
+
* base64 in place of the signature. Both upstreams returned 200 for both. A
|
|
21
|
+
* relay re-issues the turn to its own backend rather than passing our thinking
|
|
22
|
+
* block through, so nothing ever validates it.
|
|
23
|
+
*
|
|
24
|
+
* `strict` therefore stays off by default and is documented as proving only
|
|
25
|
+
* that the endpoint accepts the block, not that the signature is real. Do not
|
|
26
|
+
* present it as cryptographic proof.
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* Multi-step GCD: hard enough that adaptive models decide to think, and
|
|
30
|
+
* deliberately not the 1071/462 pair from Anthropic's own docs, which a relay
|
|
31
|
+
* could special-case.
|
|
32
|
+
*/
|
|
33
|
+
const PROBE_PROMPT = "Find the greatest common divisor of 2378 and 1547 using the Euclidean algorithm.";
|
|
34
|
+
const THINKING_BUDGET_TOKENS = 2000;
|
|
35
|
+
/**
|
|
36
|
+
* Covers thinking + answer together. Too small and an adaptive model skips
|
|
37
|
+
* thinking entirely to fit, which reads as a fake when it is our own fault.
|
|
38
|
+
*/
|
|
39
|
+
const MAX_TOKENS = 16000;
|
|
40
|
+
/** Real signatures run to hundreds of chars; this only rejects a stub. */
|
|
41
|
+
const SIGNATURE_MIN_LEN = 50;
|
|
42
|
+
/** Adaptive-thinking models take `effort` at the top level, not inside `thinking`. */
|
|
43
|
+
const ADAPTIVE_MODELS = ["claude-opus-4-7", "claude-opus-4-8"];
|
|
44
|
+
/** Extended-thinking models take a token budget instead. */
|
|
45
|
+
const EXTENDED_MODELS = [
|
|
46
|
+
"claude-opus-4-6",
|
|
47
|
+
"claude-opus-4-5",
|
|
48
|
+
"claude-opus-4-1",
|
|
49
|
+
"claude-sonnet-4-6",
|
|
50
|
+
"claude-sonnet-4-5",
|
|
51
|
+
"claude-haiku-4-5",
|
|
52
|
+
];
|
|
53
|
+
const normalize = (model) => model.toLowerCase().replace(/[._]/g, "-").split("/").pop() ?? "";
|
|
54
|
+
export function thinkingModeFor(model) {
|
|
55
|
+
const m = normalize(model);
|
|
56
|
+
if (ADAPTIVE_MODELS.some((p) => m.startsWith(p)))
|
|
57
|
+
return { kind: "adaptive" };
|
|
58
|
+
if (EXTENDED_MODELS.some((p) => m.startsWith(p)))
|
|
59
|
+
return { kind: "extended" };
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
function readThinking(data) {
|
|
63
|
+
const content = data?.content;
|
|
64
|
+
if (!Array.isArray(content))
|
|
65
|
+
return { block: null, signature: "", chars: 0 };
|
|
66
|
+
for (const raw of content) {
|
|
67
|
+
if (!raw || typeof raw !== "object")
|
|
68
|
+
continue;
|
|
69
|
+
const b = raw;
|
|
70
|
+
if (b.type !== "thinking" && b.type !== "redacted_thinking")
|
|
71
|
+
continue;
|
|
72
|
+
return {
|
|
73
|
+
block: b,
|
|
74
|
+
signature: typeof b.signature === "string" ? b.signature : "",
|
|
75
|
+
chars: typeof b.thinking === "string" ? b.thinking.length : 0,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
return { block: null, signature: "", chars: 0 };
|
|
79
|
+
}
|
|
80
|
+
export async function checkThinkingSignature(opts) {
|
|
81
|
+
const mode = thinkingModeFor(opts.model);
|
|
82
|
+
const empty = { signatureLength: 0, signaturePrefix: null, thinkingChars: 0 };
|
|
83
|
+
if (!mode)
|
|
84
|
+
return { state: "skipped", ...empty, reason: "model-has-no-thinking-mode" };
|
|
85
|
+
const url = `${opts.baseUrl.replace(/\/+$/, "")}/v1/messages`;
|
|
86
|
+
const headers = {
|
|
87
|
+
"Content-Type": "application/json",
|
|
88
|
+
"x-api-key": opts.apiKey,
|
|
89
|
+
"anthropic-version": "2023-06-01",
|
|
90
|
+
};
|
|
91
|
+
const messages = [{ role: "user", content: PROBE_PROMPT }];
|
|
92
|
+
// Non-streaming on purpose: streaming an adaptive model silently drops the
|
|
93
|
+
// thinking block, so a real Claude would look unsigned.
|
|
94
|
+
const body = {
|
|
95
|
+
model: opts.model,
|
|
96
|
+
max_tokens: MAX_TOKENS,
|
|
97
|
+
messages,
|
|
98
|
+
thinking: mode.kind === "extended"
|
|
99
|
+
? { type: "enabled", budget_tokens: THINKING_BUDGET_TOKENS }
|
|
100
|
+
: { type: "adaptive", display: "summarized" },
|
|
101
|
+
};
|
|
102
|
+
// Sibling of `thinking`, never nested inside it: nesting is a 400.
|
|
103
|
+
if (mode.kind === "adaptive")
|
|
104
|
+
body["output_config"] = { effort: "xhigh" };
|
|
105
|
+
const res = await opts.transport({
|
|
106
|
+
mode: "direct",
|
|
107
|
+
url,
|
|
108
|
+
headers,
|
|
109
|
+
reqBody: body,
|
|
110
|
+
timeoutMs: opts.timeoutMs,
|
|
111
|
+
});
|
|
112
|
+
if (res.status === null || res.status >= 400)
|
|
113
|
+
return {
|
|
114
|
+
state: "skipped",
|
|
115
|
+
...empty,
|
|
116
|
+
reason: `probe-failed:${res.status ?? "network"}`,
|
|
117
|
+
};
|
|
118
|
+
const found = readThinking(res.data);
|
|
119
|
+
if (!found.block)
|
|
120
|
+
return { state: "no-thinking", ...empty, reason: "no-thinking-block" };
|
|
121
|
+
const sig = found.signature;
|
|
122
|
+
const base = {
|
|
123
|
+
signatureLength: sig.length,
|
|
124
|
+
signaturePrefix: sig ? sig.slice(0, 32) : null,
|
|
125
|
+
thinkingChars: found.chars,
|
|
126
|
+
};
|
|
127
|
+
if (!sig)
|
|
128
|
+
return { state: "unsigned", ...base, reason: "no-signature-field" };
|
|
129
|
+
if (sig.length < SIGNATURE_MIN_LEN)
|
|
130
|
+
return { state: "unsigned", ...base, reason: "signature-too-short" };
|
|
131
|
+
if (!opts.strict)
|
|
132
|
+
return { state: "signed", ...base };
|
|
133
|
+
const replayVerified = await verifySignature({
|
|
134
|
+
transport: opts.transport,
|
|
135
|
+
url,
|
|
136
|
+
headers,
|
|
137
|
+
model: opts.model,
|
|
138
|
+
block: found.block,
|
|
139
|
+
timeoutMs: opts.timeoutMs,
|
|
140
|
+
});
|
|
141
|
+
// A rejection is real evidence (the endpoint checked and refused); an
|
|
142
|
+
// acceptance is not, so it never upgrades or downgrades the state on its own.
|
|
143
|
+
return {
|
|
144
|
+
state: replayVerified ? "signed" : "unsigned",
|
|
145
|
+
...base,
|
|
146
|
+
replayVerified,
|
|
147
|
+
...(replayVerified ? {} : { reason: "signature-rejected-on-replay" }),
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Hand the thinking block back to the endpoint. Against api.anthropic.com this
|
|
152
|
+
* would re-validate the signature; against a relay it does not (measured: a
|
|
153
|
+
* forged 308-byte signature returned 200 on both upstreams tested), so the
|
|
154
|
+
* result is reported as `replayVerified` evidence rather than a verdict.
|
|
155
|
+
*/
|
|
156
|
+
async function verifySignature(opts) {
|
|
157
|
+
const res = await opts.transport({
|
|
158
|
+
mode: "direct",
|
|
159
|
+
url: opts.url,
|
|
160
|
+
headers: opts.headers,
|
|
161
|
+
reqBody: {
|
|
162
|
+
model: opts.model,
|
|
163
|
+
max_tokens: 1,
|
|
164
|
+
messages: [
|
|
165
|
+
{ role: "user", content: PROBE_PROMPT },
|
|
166
|
+
{ role: "assistant", content: [opts.block] },
|
|
167
|
+
],
|
|
168
|
+
},
|
|
169
|
+
timeoutMs: opts.timeoutMs,
|
|
170
|
+
});
|
|
171
|
+
// A network failure proves nothing, so treat only an explicit rejection as
|
|
172
|
+
// a forged signature.
|
|
173
|
+
if (res.status === null)
|
|
174
|
+
return true;
|
|
175
|
+
return res.status < 400;
|
|
176
|
+
}
|
|
177
|
+
//# sourceMappingURL=thinking-signature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thinking-signature.js","sourceRoot":"","sources":["../../src/detectors/thinking-signature.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAIH;;;;GAIG;AACH,MAAM,YAAY,GAChB,kFAAkF,CAAC;AAErF,MAAM,sBAAsB,GAAG,IAAI,CAAC;AAEpC;;;GAGG;AACH,MAAM,UAAU,GAAG,KAAK,CAAC;AAEzB,0EAA0E;AAC1E,MAAM,iBAAiB,GAAG,EAAE,CAAC;AA2B7B,sFAAsF;AACtF,MAAM,eAAe,GAAG,CAAC,iBAAiB,EAAE,iBAAiB,CAAC,CAAC;AAE/D,4DAA4D;AAC5D,MAAM,eAAe,GAAG;IACtB,iBAAiB;IACjB,iBAAiB;IACjB,iBAAiB;IACjB,mBAAmB;IACnB,mBAAmB;IACnB,kBAAkB;CACnB,CAAC;AAEF,MAAM,SAAS,GAAG,CAAC,KAAa,EAAE,EAAE,CAClC,KAAK,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC;AAEnE,MAAM,UAAU,eAAe,CAC7B,KAAa;IAEb,MAAM,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;IAC3B,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QAAE,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C,CAAC;IACH,sEAAsE;IACtE,8EAA8E;IAC9E,OAAO;QACL,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU;QAC7C,GAAG,IAAI;QACP,cAAc;QACd,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,8BAA8B,EAAE,CAAC;KACtE,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,KAAK,UAAU,eAAe,CAAC,IAO9B;IACC,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC;QAC/B,IAAI,EAAE,QAAQ;QACd,GAAG,EAAE,IAAI,CAAC,GAAG;QACb,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,OAAO,EAAE;YACP,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,UAAU,EAAE,CAAC;YACb,QAAQ,EAAE;gBACR,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE;gBACvC,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;aAC7C;SACF;QACD,SAAS,EAAE,IAAI,CAAC,SAAS;KAC1B,CAAC,CAAC;IACH,2EAA2E;IAC3E,sBAAsB;IACtB,IAAI,GAAG,CAAC,MAAM,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IACrC,OAAO,GAAG,CAAC,MAAM,GAAG,GAAG,CAAC;AAC1B,CAAC"}
|
package/dist/runner.d.ts
CHANGED
|
@@ -8,5 +8,10 @@ export declare function runVerification(opts: {
|
|
|
8
8
|
mode: TransportMode;
|
|
9
9
|
timeoutMs?: number;
|
|
10
10
|
transport?: TransportFn;
|
|
11
|
+
/**
|
|
12
|
+
* Run the Anthropic thinking-signature check too. Opt-in: it costs one extra
|
|
13
|
+
* generation and only applies to Claude models that support thinking.
|
|
14
|
+
*/
|
|
15
|
+
checkSignature?: boolean;
|
|
11
16
|
}): Promise<VerifyResult>;
|
|
12
17
|
//# sourceMappingURL=runner.d.ts.map
|
package/dist/runner.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../src/runner.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../src/runner.ts"],"names":[],"mappings":"AAWA,OAAO,EAAkB,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/D,OAAO,KAAK,EAEV,aAAa,EACb,cAAc,EACd,YAAY,EACb,MAAM,SAAS,CAAC;AAqOjB,wBAAsB,eAAe,CAAC,IAAI,EAAE;IAC1C,QAAQ,EAAE,cAAc,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,aAAa,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,WAAW,CAAC;IACxB;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,GAAG,OAAO,CAAC,YAAY,CAAC,CA0FxB"}
|
package/dist/runner.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { checkThinkingSignature } from "./detectors/thinking-signature";
|
|
1
2
|
import { sleep } from "./internal/utils";
|
|
2
3
|
import { echoesNonce, makeNonce } from "./nonce";
|
|
3
4
|
import { runHandshake } from "./handshake";
|
|
4
5
|
import { PROBES } from "./probes";
|
|
5
|
-
import { PROVIDER_CONFIGS } from "./providers/config";
|
|
6
|
+
import { normalizeProbeBaseUrl, PROVIDER_CONFIGS, } from "./providers/config";
|
|
6
7
|
import { detectSignal, isTransientError } from "./signals";
|
|
7
8
|
import { probeTransport } from "./transport";
|
|
8
9
|
import { aggregateVerdict, probeReason } from "./verdict";
|
|
@@ -213,6 +214,17 @@ export async function runVerification(opts) {
|
|
|
213
214
|
timeoutMs,
|
|
214
215
|
transport,
|
|
215
216
|
})));
|
|
217
|
+
// Runs concurrently with nothing else pending, after the probes, so a
|
|
218
|
+
// signature failure can never mask a probe result.
|
|
219
|
+
const signature = opts.checkSignature && resolvedProvider === "anthropic"
|
|
220
|
+
? await checkThinkingSignature({
|
|
221
|
+
transport,
|
|
222
|
+
baseUrl: normalizeProbeBaseUrl(opts.baseUrl),
|
|
223
|
+
apiKey: opts.apiKey,
|
|
224
|
+
model: opts.model,
|
|
225
|
+
timeoutMs,
|
|
226
|
+
})
|
|
227
|
+
: undefined;
|
|
216
228
|
const detectedModel = results.find((r) => r.detectedModel)?.detectedModel ?? null;
|
|
217
229
|
const verdict = aggregateVerdict({
|
|
218
230
|
model: opts.model,
|
|
@@ -250,6 +262,7 @@ export async function runVerification(opts) {
|
|
|
250
262
|
detectedModel,
|
|
251
263
|
totalUsage: sumUsage(results.map((r) => r.usage)),
|
|
252
264
|
resolvedProvider,
|
|
265
|
+
...(signature ? { signature } : {}),
|
|
253
266
|
connectivityError: null,
|
|
254
267
|
};
|
|
255
268
|
}
|
package/dist/runner.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner.js","sourceRoot":"","sources":["../src/runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAiB,MAAM,UAAU,CAAC;AACjD,OAAO,
|
|
1
|
+
{"version":3,"file":"runner.js","sourceRoot":"","sources":["../src/runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,SAAS,EAA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AC,MAAM;YAChB,YAAY,EAAE,CAAC,CAAC,YAAY;YAC5B,UAAU,EAAE,CAAC,CAAC,UAAU;YACxB,KAAK,EAAE,CAAC,CAAC,KAAK;YACd,aAAa,EAAE,CAAC,CAAC,aAAa;YAC9B,MAAM,EAAE,CAAC,CAAC,MAAM;SACjB,CAAC,CAAC;QACH,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,YAAY,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM;QAClD,WAAW,EAAE,OAAO,CAAC,MAAM;QAC3B,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,OAAO,CAAC;QAClD,SAAS,EAAE,EAAE,CAAC,IAAI;QAClB,WAAW;QACX,aAAa;QACb,UAAU,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QACjD,gBAAgB;QAChB,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACnC,iBAAiB,EAAE,IAAI;KACxB,CAAC;AACJ,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { SignatureResult } from "./detectors/thinking-signature";
|
|
1
2
|
export type VerifyProvider = "anthropic" | "openai" | "gemini";
|
|
2
3
|
export type VerifyVerdict = "genuine" | "suspicious" | "unverified";
|
|
3
4
|
export type ProbeLabel = "emotional" | "creative" | "identity" | "model-name";
|
|
@@ -38,6 +39,8 @@ export type VerifyResult = {
|
|
|
38
39
|
detectedModel: string | null;
|
|
39
40
|
totalUsage: ProbeUsage | null;
|
|
40
41
|
resolvedProvider: VerifyProvider;
|
|
42
|
+
/** Present only when the signature check was requested and could run. */
|
|
43
|
+
signature?: SignatureResult;
|
|
41
44
|
connectivityError: "cors-needs-backend" | "unreachable" | "invalid-key" | "no-format" | null;
|
|
42
45
|
};
|
|
43
46
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE/D,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,YAAY,GAAG,YAAY,CAAC;AAEpE,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG,UAAU,GAAG,UAAU,GAAG,YAAY,CAAC;AAE9E,MAAM,MAAM,WAAW,GACnB,aAAa,GACb,MAAM,GACN,SAAS,GACT,YAAY,GACZ,UAAU,GACV,OAAO,GACP,IAAI,CAAC;AAET,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEhD,MAAM,MAAM,UAAU,GAAG;IACvB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,UAAU,CAAC;IAClB,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,WAAW,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,KAAK,EAAE,UAAU,GAAG,IAAI,CAAC;IACzB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unorouter/verify-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Authenticity and capability checks for AI API relays: is this endpoint really the Claude / GPT / Gemini model it claims?",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"type": "module",
|
|
@@ -18,7 +18,9 @@
|
|
|
18
18
|
"gemini"
|
|
19
19
|
],
|
|
20
20
|
"sideEffects": false,
|
|
21
|
-
"files": [
|
|
21
|
+
"files": [
|
|
22
|
+
"dist"
|
|
23
|
+
],
|
|
22
24
|
"exports": {
|
|
23
25
|
".": {
|
|
24
26
|
"types": "./dist/index.d.ts",
|