@akasecurity/ai-tc-codex 0.9.16 → 0.9.17
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/.codex-plugin/plugin.json +1 -1
- package/package.json +6 -6
- package/scripts/apply-suppressions.js +739 -1263
- package/scripts/backfill.js +1040 -1291
- package/scripts/content-retention.js +781 -2074
- package/scripts/filescan.js +1266 -497
- package/scripts/firstrun.js +1277 -1701
- package/scripts/history-sync.js +777 -2107
- package/scripts/intro.js +141 -2190
- package/scripts/onboard.js +2806 -1186
- package/scripts/post-tool-use.js +1512 -1728
- package/scripts/pre-tool-use.js +1094 -1319
- package/scripts/query.js +1277 -1701
- package/scripts/reconcile.js +897 -1288
- package/scripts/remediate.js +1081 -1341
- package/scripts/scan-worker.js +147 -14
- package/scripts/session-start.js +1895 -827
- package/scripts/start-light.js +176 -1360
- package/scripts/stop.js +322 -1113
- package/scripts/sync.js +1818 -1029
- package/scripts/user-prompt-submit.js +1295 -1489
package/scripts/scan-worker.js
CHANGED
|
@@ -21046,7 +21046,7 @@ anthropic.model("claude-haiku-4-5", {
|
|
|
21046
21046
|
name: "Claude Haiku 4.5",
|
|
21047
21047
|
ctx: 2e5,
|
|
21048
21048
|
maxOut: 64e3,
|
|
21049
|
-
// Reviewed: fast/cheap tier,
|
|
21049
|
+
// Reviewed: fast/cheap general-purpose tier, not a reasoning or code model.
|
|
21050
21050
|
capability: null,
|
|
21051
21051
|
price: anthropicPrice(1, 5, 0.1),
|
|
21052
21052
|
// The vendor documents `claude-haiku-4-5-20251001` as the versioned id and
|
|
@@ -21177,6 +21177,11 @@ openai.model("gpt-4o", {
|
|
|
21177
21177
|
price: tokenPrice(2.5, 10, { cacheRead: 1.25 }),
|
|
21178
21178
|
on: [...OPENAI_RESELLERS]
|
|
21179
21179
|
});
|
|
21180
|
+
openai.model("gpt-4o-2024-05-13", {
|
|
21181
|
+
name: "GPT-4o (2024-05-13)",
|
|
21182
|
+
price: tokenPrice(5, 15),
|
|
21183
|
+
on: [...OPENAI_RESELLERS]
|
|
21184
|
+
});
|
|
21180
21185
|
openai.model("gpt-4o-mini", {
|
|
21181
21186
|
name: "GPT-4o mini",
|
|
21182
21187
|
price: tokenPrice(0.15, 0.6, { cacheRead: 0.075 }),
|
|
@@ -21196,6 +21201,24 @@ openai.model("o3", {
|
|
|
21196
21201
|
price: tokenPrice(2, 8, { cacheRead: 0.5 }),
|
|
21197
21202
|
on: [...OPENAI_RESELLERS]
|
|
21198
21203
|
});
|
|
21204
|
+
openai.model("text-embedding-3-small", {
|
|
21205
|
+
name: "text-embedding-3-small",
|
|
21206
|
+
capability: "embedding",
|
|
21207
|
+
price: tokenPrice(0.02, 0),
|
|
21208
|
+
on: [...OPENAI_RESELLERS]
|
|
21209
|
+
});
|
|
21210
|
+
openai.model("text-embedding-3-large", {
|
|
21211
|
+
name: "text-embedding-3-large",
|
|
21212
|
+
capability: "embedding",
|
|
21213
|
+
price: tokenPrice(0.13, 0),
|
|
21214
|
+
on: [...OPENAI_RESELLERS]
|
|
21215
|
+
});
|
|
21216
|
+
openai.model("text-embedding-ada-002", {
|
|
21217
|
+
name: "text-embedding-ada-002",
|
|
21218
|
+
capability: "embedding",
|
|
21219
|
+
price: tokenPrice(0.1, 0),
|
|
21220
|
+
on: [...OPENAI_RESELLERS]
|
|
21221
|
+
});
|
|
21199
21222
|
openai.model("gpt-oss-120b", {
|
|
21200
21223
|
name: "GPT-OSS 120B",
|
|
21201
21224
|
openWeights: true,
|
|
@@ -21482,10 +21505,21 @@ var MODEL_ENTRIES = Object.freeze([
|
|
|
21482
21505
|
...alibaba.models(),
|
|
21483
21506
|
...amazon.models()
|
|
21484
21507
|
]);
|
|
21508
|
+
var LONG_CONTEXT_THRESHOLDS = Object.freeze(
|
|
21509
|
+
[
|
|
21510
|
+
...new Set(
|
|
21511
|
+
MODEL_ENTRIES.flatMap(
|
|
21512
|
+
(entry) => [...entry.platforms.values()].flatMap(
|
|
21513
|
+
(offering) => offering.price?.longContext ? [offering.price.longContext.thresholdInputTokens] : []
|
|
21514
|
+
)
|
|
21515
|
+
)
|
|
21516
|
+
)
|
|
21517
|
+
].sort((a, b) => a - b)
|
|
21518
|
+
);
|
|
21485
21519
|
var MODEL_INDEX = buildModelIndex(MODEL_ENTRIES);
|
|
21486
21520
|
|
|
21487
21521
|
// ../../packages/schema/src/model/governance.ts
|
|
21488
|
-
var ModelCapability = external_exports.enum(["reasoning", "code"]);
|
|
21522
|
+
var ModelCapability = external_exports.enum(["reasoning", "code", "embedding"]);
|
|
21489
21523
|
var DataRetention = external_exports.enum([
|
|
21490
21524
|
"zero_retention",
|
|
21491
21525
|
"no_storage",
|
|
@@ -22246,6 +22280,11 @@ var CaptureAttributes = external_exports.object({
|
|
|
22246
22280
|
// here too. The full statement is on EventMetadata.redactDegradedTo; it is
|
|
22247
22281
|
// repeated rather than referenced because a store reader opens this file.
|
|
22248
22282
|
redact_degraded_to: ActionTaken.optional(),
|
|
22283
|
+
// Why a capture has no content and no findings: its field was refused
|
|
22284
|
+
// because its bounded scan did not finish (see EventMetadata.scanIncomplete,
|
|
22285
|
+
// whose value this is). Absent on every capture that was scanned, so a
|
|
22286
|
+
// reader can tell a refused row from an empty clean one.
|
|
22287
|
+
scan_incomplete: external_exports.enum(["timeout", "unavailable"]).optional(),
|
|
22249
22288
|
// The scope key this capture was stamped with: the canonical repository
|
|
22250
22289
|
// (`host/owner/repo`) of the path the capture names (a relative path is read
|
|
22251
22290
|
// against its working directory), else of its own working directory, or a
|
|
@@ -22423,8 +22462,9 @@ var SessionTokenReport = external_exports.object({
|
|
|
22423
22462
|
totalTokens: external_exports.number().int().nonnegative(),
|
|
22424
22463
|
// Σ of the PRICED rollups only; null when no rollup had a known price.
|
|
22425
22464
|
estimatedCostUsd: external_exports.number().nullable(),
|
|
22426
|
-
// True whenever any
|
|
22427
|
-
//
|
|
22465
|
+
// True whenever any call priced to null (an unknown provider/model, or a call
|
|
22466
|
+
// over a long-context threshold whose rate is unpublished), so the total
|
|
22467
|
+
// understates real spend — the UI renders `≥ $X` instead of a falsely
|
|
22428
22468
|
// precise figure rather than silently dropping the unpriced calls.
|
|
22429
22469
|
costIsPartial: external_exports.boolean()
|
|
22430
22470
|
});
|
|
@@ -23270,7 +23310,15 @@ var StorePostureSnapshot = external_exports.object({
|
|
|
23270
23310
|
policyCounts: StorePosturePolicyCounts,
|
|
23271
23311
|
// OPTIONAL, not nullable: a reporter that predates this member keeps
|
|
23272
23312
|
// getting its 200 without a payload change.
|
|
23273
|
-
plugin: StorePosturePlugin.optional()
|
|
23313
|
+
plugin: StorePosturePlugin.optional(),
|
|
23314
|
+
// OPTIONAL, and sent only by a scoped attachment, always as `scoped`. A
|
|
23315
|
+
// machine attachment omits it, so its body is byte for byte the one it
|
|
23316
|
+
// sent before this member existed. Absent therefore means machine-wide OR
|
|
23317
|
+
// a reporter older than this member, never "scoped". Both values parse, so
|
|
23318
|
+
// a sender that one day spells `machine` breaks no receiver; any other
|
|
23319
|
+
// value fails the whole snapshot, which is why the reporter sends a
|
|
23320
|
+
// constant and never the raw mode.
|
|
23321
|
+
attachmentMode: AttachmentMode.optional()
|
|
23274
23322
|
}).meta({ id: "StorePostureSnapshot" });
|
|
23275
23323
|
var CAPTURE_VERSION_PREFIX = "capture/";
|
|
23276
23324
|
var RecordAuditEventRequest = AuditEventInput.extend({
|
|
@@ -23547,7 +23595,19 @@ var EventMetadata = external_exports.object({
|
|
|
23547
23595
|
// Both are pinned as behaviour in @akasecurity/plugin-sdk's runtime suite.
|
|
23548
23596
|
// Closing either means moving the reason onto the finding row, which
|
|
23549
23597
|
// already carries its own action.
|
|
23550
|
-
redactDegradedTo: ActionTaken.optional()
|
|
23598
|
+
redactDegradedTo: ActionTaken.optional(),
|
|
23599
|
+
// Set when this capture's field was REFUSED rather than scanned: a hook
|
|
23600
|
+
// bounds the scan of a large field (see `LargeInputScanOptions` in
|
|
23601
|
+
// @akasecurity/plugin-sdk), and a scan that did not finish blocks the
|
|
23602
|
+
// field instead of letting it through unscanned.
|
|
23603
|
+
//
|
|
23604
|
+
// - 'timeout': the bounded scan ran out of time.
|
|
23605
|
+
// - 'unavailable': no worker could run it.
|
|
23606
|
+
//
|
|
23607
|
+
// A refused row stores '' as its content and has no findings, which is
|
|
23608
|
+
// exactly what a clean, empty capture looks like — this marker is the only
|
|
23609
|
+
// thing that tells the two apart. Absent on every capture that was scanned.
|
|
23610
|
+
scanIncomplete: external_exports.enum(["timeout", "unavailable"]).optional()
|
|
23551
23611
|
}).meta({ id: "EventMetadata" });
|
|
23552
23612
|
var Event = external_exports.object({
|
|
23553
23613
|
id: external_exports.guid(),
|
|
@@ -23717,7 +23777,7 @@ var Rule = external_exports.strictObject({
|
|
|
23717
23777
|
postValidators: external_exports.array(PostValidatorRef).optional(),
|
|
23718
23778
|
requiresNearby: RequiresNearby.optional(),
|
|
23719
23779
|
examples: external_exports.array(external_exports.string()).optional(),
|
|
23720
|
-
// Whether the matched text is itself sensitive
|
|
23780
|
+
// Whether the matched text is itself sensitive (see RuleEvidence).
|
|
23721
23781
|
evidence: RuleEvidence.optional()
|
|
23722
23782
|
}).meta({ id: "Rule" });
|
|
23723
23783
|
var Author = external_exports.object({
|
|
@@ -23809,7 +23869,13 @@ var DetectionRule = external_exports.object({
|
|
|
23809
23869
|
// Representative matching strings the rule author shipped with the rule. The
|
|
23810
23870
|
// cheapest honest answer to "show me what this rule catches" — every bundled
|
|
23811
23871
|
// rule has them, and they are already in the stored snapshot.
|
|
23812
|
-
examples: external_exports.array(external_exports.string()).optional()
|
|
23872
|
+
examples: external_exports.array(external_exports.string()).optional(),
|
|
23873
|
+
// The rule's DECLARED evidence, as stored. Absent defers to the engine's
|
|
23874
|
+
// classification (ruleEvidence in @akasecurity/detections): a bundled
|
|
23875
|
+
// code-flaw rule reads as 'code' and anything else as 'value', and a rule
|
|
23876
|
+
// in a value category (secret/pii/financial/phi) is always 'value',
|
|
23877
|
+
// whatever it declares.
|
|
23878
|
+
evidence: RuleEvidence.optional()
|
|
23813
23879
|
}).meta({ id: "DetectionRule" });
|
|
23814
23880
|
var DetectionUpdate = external_exports.object({
|
|
23815
23881
|
available: external_exports.boolean(),
|
|
@@ -24075,11 +24141,14 @@ var PolicyBundle = external_exports.object({
|
|
|
24075
24141
|
ruleVersions: external_exports.record(external_exports.string(), external_exports.string()).optional(),
|
|
24076
24142
|
// Model ids (the raw `model` string a harness reports, e.g.
|
|
24077
24143
|
// `claude-opus-4-1`) the tenant has PROHIBITED. The plugin refuses to switch
|
|
24078
|
-
// a session onto one (PreModelSwitch)
|
|
24079
|
-
//
|
|
24080
|
-
//
|
|
24081
|
-
//
|
|
24082
|
-
//
|
|
24144
|
+
// a session onto one (PreModelSwitch), refuses a turn that would run on one
|
|
24145
|
+
// (UserPromptSubmit) and refuses a subagent spawn onto one (PreToolUse),
|
|
24146
|
+
// wherever the organization governs the event: everywhere on a
|
|
24147
|
+
// machine-wide attachment, and only in enrolled repositories on a scoped
|
|
24148
|
+
// one (the plugin runtime's `governanceApplies`).
|
|
24149
|
+
// Optional so an older backend — and an older on-disk cache — still
|
|
24150
|
+
// parses; consumers read `?? []`, which is the unenforced behaviour that
|
|
24151
|
+
// predates this field and the safe direction to default.
|
|
24083
24152
|
//
|
|
24084
24153
|
// Ids, not display names: the governance decision is keyed on the exact
|
|
24085
24154
|
// string the harness reports (`model_status_override.versionId` in the
|
|
@@ -24419,6 +24488,8 @@ var AttachmentScopeEntry = external_exports.object({
|
|
|
24419
24488
|
});
|
|
24420
24489
|
var AttachmentScope = external_exports.object({
|
|
24421
24490
|
endpoint: external_exports.string().min(1),
|
|
24491
|
+
tenantName: PluginWhoami.shape.tenantName.optional(),
|
|
24492
|
+
userEmail: PluginWhoami.shape.userEmail.optional(),
|
|
24422
24493
|
entries: external_exports.array(AttachmentScopeEntry)
|
|
24423
24494
|
});
|
|
24424
24495
|
var AttachmentScopeEnvelope = AttachmentScope.extend({ entries: external_exports.array(external_exports.unknown()) });
|
|
@@ -24627,6 +24698,27 @@ var ManagedSettings = external_exports.object({
|
|
|
24627
24698
|
};
|
|
24628
24699
|
}).meta({ id: "ManagedSettings" });
|
|
24629
24700
|
|
|
24701
|
+
// ../../packages/schema/src/zod/mod-policy-snapshot.ts
|
|
24702
|
+
var MOD_POLICY_SNAPSHOT_VERSION = 1;
|
|
24703
|
+
var MOD_POLICY_SNAPSHOT_MAX_BYTES = 4 * 1024 * 1024;
|
|
24704
|
+
var ModPolicySnapshot = external_exports.object({
|
|
24705
|
+
version: external_exports.literal(MOD_POLICY_SNAPSHOT_VERSION),
|
|
24706
|
+
generatedAt: external_exports.iso.datetime(),
|
|
24707
|
+
// The complete effective ruleset, as the hook's runtime scans with it: the
|
|
24708
|
+
// user's enabled installed packs (user-modified and custom packs included).
|
|
24709
|
+
// Absent means the store holds no authoritative snapshot, and the reader
|
|
24710
|
+
// scans with the packs it ships — the hook's own fallback.
|
|
24711
|
+
rules: external_exports.array(Rule).optional(),
|
|
24712
|
+
// Rule-targeted actions (first enabled policy per rule wins).
|
|
24713
|
+
ruleActions: external_exports.record(external_exports.string(), ActionTaken),
|
|
24714
|
+
// The resolved action per detection category.
|
|
24715
|
+
categoryActions: external_exports.record(external_exports.string(), ActionTaken),
|
|
24716
|
+
// Rules with an active exception grant. Honouring a grant means matching a
|
|
24717
|
+
// keyed fingerprint of the value and consuming a use, which only the hook can
|
|
24718
|
+
// do, so the mod leaves a finding of one of these rules for the hook to decide.
|
|
24719
|
+
exceptionRuleIds: external_exports.array(external_exports.string())
|
|
24720
|
+
}).meta({ id: "ModPolicySnapshot" });
|
|
24721
|
+
|
|
24630
24722
|
// ../../packages/schema/src/zod/project-files.ts
|
|
24631
24723
|
var ProjectFileInput = external_exports.object({
|
|
24632
24724
|
path: external_exports.string().min(1),
|
|
@@ -24941,7 +25033,16 @@ var AttachInput = external_exports.object({
|
|
|
24941
25033
|
// 200 matches the tenantName bound beside it in control-plane.ts; nothing
|
|
24942
25034
|
// renders a longer one usefully.
|
|
24943
25035
|
label: printable(200).optional(),
|
|
24944
|
-
accessKey: external_exports.string()
|
|
25036
|
+
accessKey: external_exports.string(),
|
|
25037
|
+
// How much of this machine the attachment is for: everything, or only the
|
|
25038
|
+
// repositories its user enrolls. Optional, so an input without it still
|
|
25039
|
+
// parses; what an absent mode means is for whatever reads it to decide, not
|
|
25040
|
+
// this shape. This member validates the VALUE rather than leaving that to the
|
|
25041
|
+
// call site, a deliberate exception to this module's shape-only rule: a shape
|
|
25042
|
+
// rejection names the field, so a value that is not a mode is refused as a bad
|
|
25043
|
+
// `mode` rather than stripped or passed on. The dashboard's attach action reads
|
|
25044
|
+
// it as the mode to attach in.
|
|
25045
|
+
mode: AttachmentMode.optional()
|
|
24945
25046
|
});
|
|
24946
25047
|
|
|
24947
25048
|
// ../../packages/schema/src/zod/triage.ts
|
|
@@ -25369,6 +25470,38 @@ function worstProbeMs(rule, now = wallClock, corroborate) {
|
|
|
25369
25470
|
}
|
|
25370
25471
|
var CPU_CORROBORATION_SHARE = 0.2;
|
|
25371
25472
|
var CORROBORATION_FLOOR_MS = BUDGET_MS * CPU_CORROBORATION_SHARE;
|
|
25473
|
+
function repeatTo(unit, length) {
|
|
25474
|
+
return unit.repeat(Math.ceil(length / unit.length)).slice(0, length);
|
|
25475
|
+
}
|
|
25476
|
+
function joinTo(length, open2, close, item) {
|
|
25477
|
+
const parts = [];
|
|
25478
|
+
let size = open2.length;
|
|
25479
|
+
for (let i = 0; size < length; i++) {
|
|
25480
|
+
const next = (i === 0 ? "" : ",") + item(i);
|
|
25481
|
+
parts.push(next);
|
|
25482
|
+
size += next.length;
|
|
25483
|
+
}
|
|
25484
|
+
return (open2 + parts.join("") + close).slice(0, length);
|
|
25485
|
+
}
|
|
25486
|
+
var SQL_WORDS = ["select", "insert", "update", "delete", "drop", "where"];
|
|
25487
|
+
var GROWTH_CORPORA = [
|
|
25488
|
+
{
|
|
25489
|
+
name: "one-line JSON dictionary",
|
|
25490
|
+
build: (length) => joinTo(length, "{", "}", (i) => `"id-${String(i)}":"label ${String(i)}"`)
|
|
25491
|
+
},
|
|
25492
|
+
{
|
|
25493
|
+
name: "JSON array of quoted SQL keywords",
|
|
25494
|
+
build: (length) => joinTo(length, "[", "]", (i) => `"${SQL_WORDS[i % SQL_WORDS.length] ?? ""} ${String(i)}"`)
|
|
25495
|
+
},
|
|
25496
|
+
{ name: "single-quoted keyword run ('where)", build: (length) => repeatTo("'where", length) },
|
|
25497
|
+
{ name: "double-quote run", build: (length) => repeatTo('"', length) },
|
|
25498
|
+
{ name: "space run", build: (length) => repeatTo(" ", length) },
|
|
25499
|
+
{ name: "newline run", build: (length) => repeatTo("\n", length) },
|
|
25500
|
+
...["abc-", "a.", "a ", "a=", "x", "0", "a@", "a/", "ab"].map((unit) => ({
|
|
25501
|
+
name: `unit run ${JSON.stringify(unit)}`,
|
|
25502
|
+
build: (length) => repeatTo(unit, length)
|
|
25503
|
+
}))
|
|
25504
|
+
];
|
|
25372
25505
|
function checkRuleTiming(rule, corroborate) {
|
|
25373
25506
|
const { ms, probe, corroboratedMs } = worstProbeMs(rule, wallClock, corroborate);
|
|
25374
25507
|
const work = corroboratedMs ?? 0;
|