@akasecurity/ai-tc-codex 0.9.20 → 0.9.21
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 +5 -5
- package/scripts/apply-suppressions.js +307 -44
- package/scripts/backfill.js +545 -159
- package/scripts/content-retention.js +120 -30
- package/scripts/filescan.js +586 -194
- package/scripts/firstrun.js +443 -135
- package/scripts/history-sync.js +382 -67
- package/scripts/intro.js +45 -6
- package/scripts/onboard.js +307 -44
- package/scripts/post-tool-use.js +563 -167
- package/scripts/pre-tool-use.js +564 -168
- package/scripts/query.js +443 -135
- package/scripts/reconcile.js +458 -138
- package/scripts/remediate.js +540 -156
- package/scripts/scan-worker.js +57 -8
- package/scripts/session-start.js +610 -211
- package/scripts/start-light.js +57 -8
- package/scripts/stop.js +466 -143
- package/scripts/sync.js +832 -199
- package/scripts/user-prompt-submit.js +567 -168
- package/skills/setup/SKILL.md +1 -0
package/scripts/scan-worker.js
CHANGED
|
@@ -8089,7 +8089,8 @@ var Span = object({
|
|
|
8089
8089
|
var MAX_VARIABLE_NAME_LENGTH = 128;
|
|
8090
8090
|
var VariableName = string2().max(MAX_VARIABLE_NAME_LENGTH);
|
|
8091
8091
|
var Finding = object({
|
|
8092
|
-
|
|
8092
|
+
// A random UUID or a content-addressed sha256 hex digest, depending on the writer.
|
|
8093
|
+
id: string2(),
|
|
8093
8094
|
eventId: guid2(),
|
|
8094
8095
|
ruleId: string2(),
|
|
8095
8096
|
category: DetectionCategory,
|
|
@@ -8517,8 +8518,11 @@ var EventKind = _enum(["prompt", "response", "code_change", "tool_use"]).meta({
|
|
|
8517
8518
|
var CAPTURE_EVENT_TYPES_SQL = EventKind.options.map((k) => `'${k}'`).join(",");
|
|
8518
8519
|
var SIGHTING_TOKEN_PATTERN = /\[\[aka:fp:v[1-9][0-9]{0,15}\.[A-Za-z0-9_-]{43}\]\]/;
|
|
8519
8520
|
var SIGHTING_TOKEN_ANCHORED = new RegExp(`^${SIGHTING_TOKEN_PATTERN.source}$`);
|
|
8521
|
+
var SIGHTING_ALIASES_MAX = 4;
|
|
8522
|
+
var SightingAliases = array(string2().regex(SIGHTING_TOKEN_ANCHORED)).min(1).max(SIGHTING_ALIASES_MAX);
|
|
8520
8523
|
var CaptureSighting = object({
|
|
8521
8524
|
token: string2().regex(SIGHTING_TOKEN_ANCHORED),
|
|
8525
|
+
aliases: SightingAliases.optional(),
|
|
8522
8526
|
ruleId: string2().min(1),
|
|
8523
8527
|
category: DetectionCategory
|
|
8524
8528
|
}).meta({ id: "CaptureSighting" });
|
|
@@ -9958,6 +9962,7 @@ var EgressCredentialRef = discriminatedUnion("kind", [
|
|
|
9958
9962
|
object({
|
|
9959
9963
|
kind: literal("literal"),
|
|
9960
9964
|
token: string2().regex(SIGHTING_TOKEN_ANCHORED),
|
|
9965
|
+
aliases: SightingAliases.optional(),
|
|
9961
9966
|
ruleId: string2().min(1).max(256)
|
|
9962
9967
|
}).strict(),
|
|
9963
9968
|
object({ kind: literal("variable"), variableName: VariableName.min(1) }).strict()
|
|
@@ -10328,7 +10333,8 @@ var sightingKeyMaterial = string2().regex(SIGHTING_KEY_MATERIAL, "must be the ba
|
|
|
10328
10333
|
var sightingKeyVersion = number2().int().min(1);
|
|
10329
10334
|
var SightingKeyVersion = object({
|
|
10330
10335
|
keyVersion: sightingKeyVersion,
|
|
10331
|
-
key: sightingKeyMaterial
|
|
10336
|
+
key: sightingKeyMaterial,
|
|
10337
|
+
acceptedUntil: iso_exports.datetime({ offset: true }).optional().catch(void 0)
|
|
10332
10338
|
});
|
|
10333
10339
|
var SightingKeyResponse = object({
|
|
10334
10340
|
keyVersion: sightingKeyVersion,
|
|
@@ -10345,7 +10351,8 @@ var SightingKeyResponse = object({
|
|
|
10345
10351
|
var StoredSightingKeys = SightingKeyResponse.and(
|
|
10346
10352
|
object({
|
|
10347
10353
|
fetchedAtMs: number2().int().nonnegative(),
|
|
10348
|
-
endpointFingerprint: string2().regex(/^[0-9a-f]{64}$/)
|
|
10354
|
+
endpointFingerprint: string2().regex(/^[0-9a-f]{64}$/),
|
|
10355
|
+
previousFirstSeenAtMs: record(string2().regex(/^[1-9][0-9]*$/), number2().int().nonnegative()).optional()
|
|
10349
10356
|
})
|
|
10350
10357
|
);
|
|
10351
10358
|
var CREDENTIAL_SIGHTINGS_BATCH_MAX = 500;
|
|
@@ -10360,6 +10367,7 @@ var SightingProject = object({
|
|
|
10360
10367
|
}).strict().meta({ id: "SightingProject" });
|
|
10361
10368
|
var CredentialSighting = object({
|
|
10362
10369
|
token: string2().regex(SIGHTING_TOKEN_ANCHORED),
|
|
10370
|
+
aliases: SightingAliases.optional(),
|
|
10363
10371
|
ruleId: printable(256).min(1),
|
|
10364
10372
|
category: literal("secret"),
|
|
10365
10373
|
variableName: VariableName.min(1).optional(),
|
|
@@ -10497,6 +10505,10 @@ var Policy = object({
|
|
|
10497
10505
|
var RedactFallback = BuiltinPolicyId.extract(["monitor", "warn", "block"]).meta({
|
|
10498
10506
|
id: "RedactFallback"
|
|
10499
10507
|
});
|
|
10508
|
+
var ModelPolicy = object({
|
|
10509
|
+
mode: literal("allowlist"),
|
|
10510
|
+
approved: array(string2().min(1).max(512)).max(1e3)
|
|
10511
|
+
}).meta({ id: "ModelPolicy" });
|
|
10500
10512
|
var PolicyBundle = object({
|
|
10501
10513
|
version: string2(),
|
|
10502
10514
|
policies: array(Policy),
|
|
@@ -10547,6 +10559,9 @@ var PolicyBundle = object({
|
|
|
10547
10559
|
// control plane), so no name resolution stands between the decision and the
|
|
10548
10560
|
// comparison.
|
|
10549
10561
|
prohibitedModels: array(string2()).optional(),
|
|
10562
|
+
// Optional so an older backend, and an older on-disk cache, still parses; absent leaves every
|
|
10563
|
+
// model approved.
|
|
10564
|
+
modelPolicy: ModelPolicy.optional(),
|
|
10550
10565
|
// What a resolved `redact` becomes on a field the host cannot rewrite, as
|
|
10551
10566
|
// the ORGANIZATION would have it. Merged raise-only against the device's own
|
|
10552
10567
|
// `WorkspaceSettings.redactFallback` (see strongerRedactFallback below), so
|
|
@@ -10564,7 +10579,8 @@ var POLICY_BUNDLE_SHAPE_ID = [
|
|
|
10564
10579
|
...Object.keys(PolicyBundle.shape),
|
|
10565
10580
|
...Object.keys(Policy.shape).map((key) => `policies.${key}`),
|
|
10566
10581
|
...PolicyTarget.options.flatMap((member) => "shape" in member ? Object.keys(member.shape) : []).map((key) => `policies.target.${key}`),
|
|
10567
|
-
...Object.keys(ExceptionBundleEntry.shape).map((key) => `exceptions.${key}`)
|
|
10582
|
+
...Object.keys(ExceptionBundleEntry.shape).map((key) => `exceptions.${key}`),
|
|
10583
|
+
...Object.keys(ModelPolicy.shape).map((key) => `modelPolicy.${key}`)
|
|
10568
10584
|
].sort().join(",");
|
|
10569
10585
|
var OBSERVE_ONLY_CATEGORIES = ["config"];
|
|
10570
10586
|
var ENFORCEABLE_CATEGORIES = DetectionCategory.options.filter((c) => !OBSERVE_ONLY_CATEGORIES.includes(c));
|
|
@@ -10925,7 +10941,7 @@ var DetectedWebAccounts = object({
|
|
|
10925
10941
|
var DetectedWebAccountsEnvelope = DetectedWebAccounts.extend({ accounts: array(unknown()) });
|
|
10926
10942
|
|
|
10927
10943
|
// ../../packages/schema/src/zod/local.ts
|
|
10928
|
-
var WORKSPACE_SETTINGS_SPEC_VERSION =
|
|
10944
|
+
var WORKSPACE_SETTINGS_SPEC_VERSION = 11;
|
|
10929
10945
|
var RunMode = _enum(["standalone", "attached"]);
|
|
10930
10946
|
var ControlPlaneConnection = object({
|
|
10931
10947
|
endpoint: string2().min(1),
|
|
@@ -11027,6 +11043,15 @@ var BodyRetention = object({
|
|
|
11027
11043
|
// candidate set that is already bounded by "delivered, or never owed".
|
|
11028
11044
|
retainDays: number2().int().min(1).max(3650).default(BODY_RETENTION_DEFAULT_DAYS)
|
|
11029
11045
|
}).meta({ id: "BodyRetention" });
|
|
11046
|
+
var MAX_PROTECTED_PATH_ENTRIES = 256;
|
|
11047
|
+
var MAX_PROTECTED_PATH_ENTRY_CHARS = 1024;
|
|
11048
|
+
var ProtectedPathEntry = string2().trim().min(1).max(MAX_PROTECTED_PATH_ENTRY_CHARS);
|
|
11049
|
+
var ProtectedPaths = array(unknown()).transform(
|
|
11050
|
+
(entries) => entries.flatMap((entry) => {
|
|
11051
|
+
const parsed = ProtectedPathEntry.safeParse(entry);
|
|
11052
|
+
return parsed.success ? [parsed.data] : [];
|
|
11053
|
+
}).slice(0, MAX_PROTECTED_PATH_ENTRIES)
|
|
11054
|
+
);
|
|
11030
11055
|
var WorkspaceSettings = object({
|
|
11031
11056
|
specVersion: number2().int().positive().default(WORKSPACE_SETTINGS_SPEC_VERSION),
|
|
11032
11057
|
runMode: RunMode.default("standalone"),
|
|
@@ -11117,7 +11142,18 @@ var WorkspaceSettings = object({
|
|
|
11117
11142
|
bodyRetention: BodyRetention.default({
|
|
11118
11143
|
enabled: false,
|
|
11119
11144
|
retainDays: BODY_RETENTION_DEFAULT_DAYS
|
|
11120
|
-
})
|
|
11145
|
+
}),
|
|
11146
|
+
// Folders and file name globs whose files a tool call may not touch
|
|
11147
|
+
// unflagged: a Read, Grep, Glob or Bash naming one becomes a finding under
|
|
11148
|
+
// the command-risk pack's policy. Absent means none are protected, and
|
|
11149
|
+
// protectedPathsOf is the one reader.
|
|
11150
|
+
//
|
|
11151
|
+
// A bad entry is dropped on its own (see ProtectedPaths); `.catch(undefined)`
|
|
11152
|
+
// reads a value that is not a list at all as no list. A settings.json that
|
|
11153
|
+
// fails this schema reads as the unonboarded defaults, and the next save
|
|
11154
|
+
// writes those back over it, so a malformed value must not cost every other
|
|
11155
|
+
// setting. Not a ManagedSettingKey.
|
|
11156
|
+
protectedPaths: ProtectedPaths.optional().catch(void 0)
|
|
11121
11157
|
});
|
|
11122
11158
|
|
|
11123
11159
|
// ../../packages/schema/src/zod/agent-scope.ts
|
|
@@ -11281,6 +11317,9 @@ var ConfigInventoryAck = object({
|
|
|
11281
11317
|
accepted: number2().int().nonnegative()
|
|
11282
11318
|
});
|
|
11283
11319
|
|
|
11320
|
+
// ../../packages/schema/src/zod/credential-status.ts
|
|
11321
|
+
var CredentialStatus = _enum(["rotation_overdue", "exposed"]).meta({ id: "CredentialStatus" });
|
|
11322
|
+
|
|
11284
11323
|
// ../../packages/schema/src/zod/registry.ts
|
|
11285
11324
|
var Namespace = string2().regex(/^[a-z][a-z0-9-]*$/);
|
|
11286
11325
|
var PackId = string2().regex(/^[a-z][a-z0-9-]*$/);
|
|
@@ -13621,7 +13660,7 @@ function scanText(text, ruleset2, context) {
|
|
|
13621
13660
|
var SHIELDED_SOURCE = `${POINTER_TOKEN_PATTERN.source}|${SIGHTING_TOKEN_PATTERN.source}`;
|
|
13622
13661
|
|
|
13623
13662
|
// ../../packages/detections/src/posture/config-posture.ts
|
|
13624
|
-
var RULE_VERSION = "
|
|
13663
|
+
var RULE_VERSION = "2";
|
|
13625
13664
|
var KNOWN_TOOLS = /* @__PURE__ */ new Set([
|
|
13626
13665
|
"prettier",
|
|
13627
13666
|
"eslint",
|
|
@@ -13635,6 +13674,13 @@ var KNOWN_TOOLS = /* @__PURE__ */ new Set([
|
|
|
13635
13674
|
"npm",
|
|
13636
13675
|
"pnpm",
|
|
13637
13676
|
"yarn",
|
|
13677
|
+
"bun",
|
|
13678
|
+
"bunx",
|
|
13679
|
+
"deno",
|
|
13680
|
+
"python3",
|
|
13681
|
+
"uv",
|
|
13682
|
+
"bash",
|
|
13683
|
+
"sh",
|
|
13638
13684
|
"make",
|
|
13639
13685
|
"git",
|
|
13640
13686
|
"jq",
|
|
@@ -13661,7 +13707,7 @@ var CONFIG_POSTURE_RULES = [
|
|
|
13661
13707
|
name: "Unknown hook \u2014 not attributable to a plugin or known tool",
|
|
13662
13708
|
category: "config",
|
|
13663
13709
|
// medium, not high: with a deliberately tiny allowlist this v1 heuristic
|
|
13664
|
-
// fires on ordinary
|
|
13710
|
+
// fires on ordinary hooks it cannot attribute, such as compound commands
|
|
13665
13711
|
// (cd … && tool); 'high' is reserved for egress, which is genuinely
|
|
13666
13712
|
// dangerous. Revisit when the known-hooks registry replaces the allowlist.
|
|
13667
13713
|
severity: "medium",
|
|
@@ -13835,6 +13881,7 @@ function worstProbeMs(rule, now = wallClock, corroborate) {
|
|
|
13835
13881
|
}
|
|
13836
13882
|
var CPU_CORROBORATION_SHARE = 0.2;
|
|
13837
13883
|
var CORROBORATION_FLOOR_MS = BUDGET_MS * CPU_CORROBORATION_SHARE;
|
|
13884
|
+
var MAX_GROWTH_RATIO = 3;
|
|
13838
13885
|
function repeatTo(unit, length) {
|
|
13839
13886
|
return unit.repeat(Math.ceil(length / unit.length)).slice(0, length);
|
|
13840
13887
|
}
|
|
@@ -13871,6 +13918,8 @@ var GROWTH_CORPORA = [
|
|
|
13871
13918
|
build: (length) => repeatTo(unit, length)
|
|
13872
13919
|
}))
|
|
13873
13920
|
];
|
|
13921
|
+
var QUADRATIC_GROWTH = 4;
|
|
13922
|
+
var SAMPLED_GROWTH = MAX_GROWTH_RATIO ** 2 / QUADRATIC_GROWTH;
|
|
13874
13923
|
function checkRuleTiming(rule, corroborate) {
|
|
13875
13924
|
const { ms, probe, corroboratedMs } = worstProbeMs(rule, wallClock, corroborate);
|
|
13876
13925
|
const work = corroboratedMs ?? 0;
|