agent-inspect 6.17.6 → 6.17.7
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/CHANGELOG.md +8 -0
- package/README.md +1 -1
- package/docs/API.md +1 -1
- package/docs/CLI.md +2 -2
- package/docs/GETTING-STARTED.md +2 -1
- package/docs/SAFE-TRACE-SHARING.md +5 -1
- package/package.json +1 -1
- package/packages/cli/dist/{chunk-GOHYSE7W.mjs → chunk-25LUDS4T.mjs} +30 -25
- package/packages/cli/dist/chunk-25LUDS4T.mjs.map +1 -0
- package/packages/cli/dist/index.cjs +72 -25
- package/packages/cli/dist/index.cjs.map +1 -1
- package/packages/cli/dist/index.mjs +47 -5
- package/packages/cli/dist/index.mjs.map +1 -1
- package/packages/cli/dist/{src-OYGG7QAZ.mjs → src-2FS6BLR7.mjs} +3 -3
- package/packages/cli/dist/{src-OYGG7QAZ.mjs.map → src-2FS6BLR7.mjs.map} +1 -1
- package/packages/core/dist/advanced.cjs +23 -22
- package/packages/core/dist/advanced.cjs.map +1 -1
- package/packages/core/dist/advanced.mjs +24 -23
- package/packages/core/dist/advanced.mjs.map +1 -1
- package/packages/core/dist/checks.cjs +5 -1
- package/packages/core/dist/checks.cjs.map +1 -1
- package/packages/core/dist/checks.mjs +1 -1
- package/packages/core/dist/{chunk-DIZPIPY2.mjs → chunk-LQC7IED3.mjs} +7 -3
- package/packages/core/dist/chunk-LQC7IED3.mjs.map +1 -0
- package/packages/cli/dist/chunk-GOHYSE7W.mjs.map +0 -1
- package/packages/core/dist/chunk-DIZPIPY2.mjs.map +0 -1
|
@@ -3020,29 +3020,30 @@ async function searchTraces(metas, options) {
|
|
|
3020
3020
|
}
|
|
3021
3021
|
function matchRunLevel(m, opts) {
|
|
3022
3022
|
if (opts.stepTypeFilter || opts.toolQuery) return [];
|
|
3023
|
-
|
|
3023
|
+
if (opts.statusFilter && m.status !== opts.statusFilter) return [];
|
|
3024
|
+
if (opts.nameQuery && !nameMatches(m.name ?? m.runId, opts.nameQuery)) {
|
|
3025
|
+
return [];
|
|
3026
|
+
}
|
|
3027
|
+
if (opts.durationFilter && !durationMatches(m.durationMs, opts.durationFilter)) {
|
|
3028
|
+
return [];
|
|
3029
|
+
}
|
|
3024
3030
|
const fields = [];
|
|
3025
|
-
if (opts.statusFilter
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
if (
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
matchReason: `run match: ${fields.join(", ")}`,
|
|
3042
|
-
matchedFields: fields,
|
|
3043
|
-
filePath: m.filePath
|
|
3044
|
-
});
|
|
3045
|
-
return out;
|
|
3031
|
+
if (opts.statusFilter) fields.push("run.status");
|
|
3032
|
+
if (opts.nameQuery) fields.push("run.name");
|
|
3033
|
+
if (opts.durationFilter) fields.push("run.durationMs");
|
|
3034
|
+
if (fields.length === 0) return [];
|
|
3035
|
+
return [
|
|
3036
|
+
{
|
|
3037
|
+
runId: m.runId,
|
|
3038
|
+
runName: m.name,
|
|
3039
|
+
runStatus: m.status,
|
|
3040
|
+
timestamp: m.startedAt,
|
|
3041
|
+
durationMs: m.durationMs,
|
|
3042
|
+
matchReason: `run match: ${fields.join(", ")}`,
|
|
3043
|
+
matchedFields: fields,
|
|
3044
|
+
filePath: m.filePath
|
|
3045
|
+
}
|
|
3046
|
+
];
|
|
3046
3047
|
}
|
|
3047
3048
|
function matchStepLevel(m, events, opts) {
|
|
3048
3049
|
const out = [];
|
|
@@ -8418,7 +8419,11 @@ var init_checks2 = __esm({
|
|
|
8418
8419
|
{ id: "openai-key", pattern: /sk-[A-Za-z0-9_-]{16,}/ },
|
|
8419
8420
|
{ id: "aws-access-key", pattern: /AKIA[0-9A-Z]{16}/ },
|
|
8420
8421
|
{ id: "github-token", pattern: /gh[opsu]_[A-Za-z0-9_]{20,}/ },
|
|
8421
|
-
|
|
8422
|
+
// Keep in sync with packages/redact/src/key-value-secret.ts (KEY_VALUE_SECRET_PATTERN_SOURCE).
|
|
8423
|
+
{
|
|
8424
|
+
id: "key-value-secret",
|
|
8425
|
+
pattern: /\b(?:api[_-]?key|internal[_-]?token|access[_-]?token|auth[_-]?token|password|secret|token)=([^\s"'\\]{8,})/i
|
|
8426
|
+
}
|
|
8422
8427
|
];
|
|
8423
8428
|
}
|
|
8424
8429
|
});
|
|
@@ -12581,7 +12586,7 @@ var init_src = __esm({
|
|
|
12581
12586
|
});
|
|
12582
12587
|
|
|
12583
12588
|
// package.json
|
|
12584
|
-
var version = "6.17.
|
|
12589
|
+
var version = "6.17.7";
|
|
12585
12590
|
|
|
12586
12591
|
// packages/cli/src/list.ts
|
|
12587
12592
|
init_advanced();
|
|
@@ -16528,6 +16533,17 @@ function isCredentialSensitiveKey2(key, sensitiveKeys) {
|
|
|
16528
16533
|
return false;
|
|
16529
16534
|
}
|
|
16530
16535
|
|
|
16536
|
+
// packages/redact/src/key-value-secret.ts
|
|
16537
|
+
var KEY_VALUE_SECRET_PATTERN_SOURCE = String.raw`\b(?:api[_-]?key|internal[_-]?token|access[_-]?token|auth[_-]?token|password|secret|token)=([^\s"'\\]{8,})`;
|
|
16538
|
+
var KEY_VALUE_SECRET_PATTERN = new RegExp(
|
|
16539
|
+
KEY_VALUE_SECRET_PATTERN_SOURCE,
|
|
16540
|
+
"i"
|
|
16541
|
+
);
|
|
16542
|
+
function valueContainsKeyValueSecret(value) {
|
|
16543
|
+
KEY_VALUE_SECRET_PATTERN.lastIndex = 0;
|
|
16544
|
+
return KEY_VALUE_SECRET_PATTERN.test(value);
|
|
16545
|
+
}
|
|
16546
|
+
|
|
16531
16547
|
// packages/redact/src/index.ts
|
|
16532
16548
|
var DEFAULT_REDACT_KEYS2 = [
|
|
16533
16549
|
"authorization",
|
|
@@ -16734,6 +16750,15 @@ var credentialDetectors = [
|
|
|
16734
16750
|
pattern: /-----BEGIN [A-Z ]*PRIVATE KEY-----[\s\S]*-----END [A-Z ]*PRIVATE KEY-----/,
|
|
16735
16751
|
severity: "error"
|
|
16736
16752
|
}),
|
|
16753
|
+
{
|
|
16754
|
+
id: "value.keyValueSecret",
|
|
16755
|
+
severity: "error",
|
|
16756
|
+
matchKind: "value",
|
|
16757
|
+
detect(input3) {
|
|
16758
|
+
if (typeof input3.value !== "string") return [];
|
|
16759
|
+
return valueContainsKeyValueSecret(input3.value) ? [{ action: "replace", severity: "error", matchKind: "value" }] : [];
|
|
16760
|
+
}
|
|
16761
|
+
},
|
|
16737
16762
|
{
|
|
16738
16763
|
id: "value.creditCard",
|
|
16739
16764
|
severity: "error",
|
|
@@ -18470,12 +18495,30 @@ function uniqueSelectIds(ids) {
|
|
|
18470
18495
|
}
|
|
18471
18496
|
return out;
|
|
18472
18497
|
}
|
|
18498
|
+
function resolveForbiddenToolOptions(options) {
|
|
18499
|
+
const merged = [...options.forbiddenTool ?? [], ...options.forbidTool ?? []];
|
|
18500
|
+
const seen = /* @__PURE__ */ new Set();
|
|
18501
|
+
const out = [];
|
|
18502
|
+
for (const name of merged) {
|
|
18503
|
+
if (seen.has(name)) continue;
|
|
18504
|
+
seen.add(name);
|
|
18505
|
+
out.push(name);
|
|
18506
|
+
}
|
|
18507
|
+
return out;
|
|
18508
|
+
}
|
|
18509
|
+
function withResolvedForbiddenTools(options) {
|
|
18510
|
+
return {
|
|
18511
|
+
...options,
|
|
18512
|
+
forbiddenTool: resolveForbiddenToolOptions(options),
|
|
18513
|
+
forbidTool: void 0
|
|
18514
|
+
};
|
|
18515
|
+
}
|
|
18473
18516
|
function cliShorthandSelectIds(options) {
|
|
18474
18517
|
const ids = [];
|
|
18475
18518
|
if (options.failOnObservation !== void 0 && options.failOnObservation.trim() !== "") {
|
|
18476
18519
|
ids.push("outcome.status");
|
|
18477
18520
|
}
|
|
18478
|
-
if ((options.requiredTool?.length ?? 0) > 0 || (options.forbiddenTool?.length ?? 0) > 0) {
|
|
18521
|
+
if ((options.requiredTool?.length ?? 0) > 0 || (options.forbiddenTool?.length ?? 0) > 0 || (options.forbidTool?.length ?? 0) > 0) {
|
|
18479
18522
|
ids.push("tool.usage");
|
|
18480
18523
|
}
|
|
18481
18524
|
if ((options.allowedModel?.length ?? 0) > 0 || options.maxTotalTokens !== void 0) {
|
|
@@ -19196,6 +19239,7 @@ function readErrorResult(error) {
|
|
|
19196
19239
|
);
|
|
19197
19240
|
}
|
|
19198
19241
|
async function checkCommand(target, options = {}, stdin = process.stdin) {
|
|
19242
|
+
options = withResolvedForbiddenTools(options);
|
|
19199
19243
|
let result;
|
|
19200
19244
|
let phase = "config";
|
|
19201
19245
|
let evidenceRead;
|
|
@@ -25224,6 +25268,9 @@ function createCliProgram() {
|
|
|
25224
25268
|
]).option("--forbidden-tool <name>", "forbid a tool name (repeatable)", (value, previous = []) => [
|
|
25225
25269
|
...previous,
|
|
25226
25270
|
value
|
|
25271
|
+
]).option("--forbid-tool <name>", "alias for --forbidden-tool (repeatable)", (value, previous = []) => [
|
|
25272
|
+
...previous,
|
|
25273
|
+
value
|
|
25227
25274
|
]).option("--allowed-model <model>", "allow an LLM model (repeatable)", (value, previous = []) => [
|
|
25228
25275
|
...previous,
|
|
25229
25276
|
value
|