@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/start-light.js
CHANGED
|
@@ -8086,7 +8086,8 @@ var Span = object({
|
|
|
8086
8086
|
var MAX_VARIABLE_NAME_LENGTH = 128;
|
|
8087
8087
|
var VariableName = string2().max(MAX_VARIABLE_NAME_LENGTH);
|
|
8088
8088
|
var Finding = object({
|
|
8089
|
-
|
|
8089
|
+
// A random UUID or a content-addressed sha256 hex digest, depending on the writer.
|
|
8090
|
+
id: string2(),
|
|
8090
8091
|
eventId: guid2(),
|
|
8091
8092
|
ruleId: string2(),
|
|
8092
8093
|
category: DetectionCategory,
|
|
@@ -8514,8 +8515,11 @@ var EventKind = _enum(["prompt", "response", "code_change", "tool_use"]).meta({
|
|
|
8514
8515
|
var CAPTURE_EVENT_TYPES_SQL = EventKind.options.map((k) => `'${k}'`).join(",");
|
|
8515
8516
|
var SIGHTING_TOKEN_PATTERN = /\[\[aka:fp:v[1-9][0-9]{0,15}\.[A-Za-z0-9_-]{43}\]\]/;
|
|
8516
8517
|
var SIGHTING_TOKEN_ANCHORED = new RegExp(`^${SIGHTING_TOKEN_PATTERN.source}$`);
|
|
8518
|
+
var SIGHTING_ALIASES_MAX = 4;
|
|
8519
|
+
var SightingAliases = array(string2().regex(SIGHTING_TOKEN_ANCHORED)).min(1).max(SIGHTING_ALIASES_MAX);
|
|
8517
8520
|
var CaptureSighting = object({
|
|
8518
8521
|
token: string2().regex(SIGHTING_TOKEN_ANCHORED),
|
|
8522
|
+
aliases: SightingAliases.optional(),
|
|
8519
8523
|
ruleId: string2().min(1),
|
|
8520
8524
|
category: DetectionCategory
|
|
8521
8525
|
}).meta({ id: "CaptureSighting" });
|
|
@@ -9955,6 +9959,7 @@ var EgressCredentialRef = discriminatedUnion("kind", [
|
|
|
9955
9959
|
object({
|
|
9956
9960
|
kind: literal("literal"),
|
|
9957
9961
|
token: string2().regex(SIGHTING_TOKEN_ANCHORED),
|
|
9962
|
+
aliases: SightingAliases.optional(),
|
|
9958
9963
|
ruleId: string2().min(1).max(256)
|
|
9959
9964
|
}).strict(),
|
|
9960
9965
|
object({ kind: literal("variable"), variableName: VariableName.min(1) }).strict()
|
|
@@ -10325,7 +10330,8 @@ var sightingKeyMaterial = string2().regex(SIGHTING_KEY_MATERIAL, "must be the ba
|
|
|
10325
10330
|
var sightingKeyVersion = number2().int().min(1);
|
|
10326
10331
|
var SightingKeyVersion = object({
|
|
10327
10332
|
keyVersion: sightingKeyVersion,
|
|
10328
|
-
key: sightingKeyMaterial
|
|
10333
|
+
key: sightingKeyMaterial,
|
|
10334
|
+
acceptedUntil: iso_exports.datetime({ offset: true }).optional().catch(void 0)
|
|
10329
10335
|
});
|
|
10330
10336
|
var SightingKeyResponse = object({
|
|
10331
10337
|
keyVersion: sightingKeyVersion,
|
|
@@ -10342,7 +10348,8 @@ var SightingKeyResponse = object({
|
|
|
10342
10348
|
var StoredSightingKeys = SightingKeyResponse.and(
|
|
10343
10349
|
object({
|
|
10344
10350
|
fetchedAtMs: number2().int().nonnegative(),
|
|
10345
|
-
endpointFingerprint: string2().regex(/^[0-9a-f]{64}$/)
|
|
10351
|
+
endpointFingerprint: string2().regex(/^[0-9a-f]{64}$/),
|
|
10352
|
+
previousFirstSeenAtMs: record(string2().regex(/^[1-9][0-9]*$/), number2().int().nonnegative()).optional()
|
|
10346
10353
|
})
|
|
10347
10354
|
);
|
|
10348
10355
|
var CREDENTIAL_SIGHTINGS_BATCH_MAX = 500;
|
|
@@ -10357,6 +10364,7 @@ var SightingProject = object({
|
|
|
10357
10364
|
}).strict().meta({ id: "SightingProject" });
|
|
10358
10365
|
var CredentialSighting = object({
|
|
10359
10366
|
token: string2().regex(SIGHTING_TOKEN_ANCHORED),
|
|
10367
|
+
aliases: SightingAliases.optional(),
|
|
10360
10368
|
ruleId: printable(256).min(1),
|
|
10361
10369
|
category: literal("secret"),
|
|
10362
10370
|
variableName: VariableName.min(1).optional(),
|
|
@@ -10494,6 +10502,10 @@ var Policy = object({
|
|
|
10494
10502
|
var RedactFallback = BuiltinPolicyId.extract(["monitor", "warn", "block"]).meta({
|
|
10495
10503
|
id: "RedactFallback"
|
|
10496
10504
|
});
|
|
10505
|
+
var ModelPolicy = object({
|
|
10506
|
+
mode: literal("allowlist"),
|
|
10507
|
+
approved: array(string2().min(1).max(512)).max(1e3)
|
|
10508
|
+
}).meta({ id: "ModelPolicy" });
|
|
10497
10509
|
var PolicyBundle = object({
|
|
10498
10510
|
version: string2(),
|
|
10499
10511
|
policies: array(Policy),
|
|
@@ -10544,6 +10556,9 @@ var PolicyBundle = object({
|
|
|
10544
10556
|
// control plane), so no name resolution stands between the decision and the
|
|
10545
10557
|
// comparison.
|
|
10546
10558
|
prohibitedModels: array(string2()).optional(),
|
|
10559
|
+
// Optional so an older backend, and an older on-disk cache, still parses; absent leaves every
|
|
10560
|
+
// model approved.
|
|
10561
|
+
modelPolicy: ModelPolicy.optional(),
|
|
10547
10562
|
// What a resolved `redact` becomes on a field the host cannot rewrite, as
|
|
10548
10563
|
// the ORGANIZATION would have it. Merged raise-only against the device's own
|
|
10549
10564
|
// `WorkspaceSettings.redactFallback` (see strongerRedactFallback below), so
|
|
@@ -10561,7 +10576,8 @@ var POLICY_BUNDLE_SHAPE_ID = [
|
|
|
10561
10576
|
...Object.keys(PolicyBundle.shape),
|
|
10562
10577
|
...Object.keys(Policy.shape).map((key) => `policies.${key}`),
|
|
10563
10578
|
...PolicyTarget.options.flatMap((member) => "shape" in member ? Object.keys(member.shape) : []).map((key) => `policies.target.${key}`),
|
|
10564
|
-
...Object.keys(ExceptionBundleEntry.shape).map((key) => `exceptions.${key}`)
|
|
10579
|
+
...Object.keys(ExceptionBundleEntry.shape).map((key) => `exceptions.${key}`),
|
|
10580
|
+
...Object.keys(ModelPolicy.shape).map((key) => `modelPolicy.${key}`)
|
|
10565
10581
|
].sort().join(",");
|
|
10566
10582
|
var OBSERVE_ONLY_CATEGORIES = ["config"];
|
|
10567
10583
|
var ENFORCEABLE_CATEGORIES = DetectionCategory.options.filter((c) => !OBSERVE_ONLY_CATEGORIES.includes(c));
|
|
@@ -10927,7 +10943,7 @@ var DetectedWebAccounts = object({
|
|
|
10927
10943
|
var DetectedWebAccountsEnvelope = DetectedWebAccounts.extend({ accounts: array(unknown()) });
|
|
10928
10944
|
|
|
10929
10945
|
// ../../packages/schema/src/zod/local.ts
|
|
10930
|
-
var WORKSPACE_SETTINGS_SPEC_VERSION =
|
|
10946
|
+
var WORKSPACE_SETTINGS_SPEC_VERSION = 11;
|
|
10931
10947
|
var RunMode = _enum(["standalone", "attached"]);
|
|
10932
10948
|
var ControlPlaneConnection = object({
|
|
10933
10949
|
endpoint: string2().min(1),
|
|
@@ -11029,6 +11045,15 @@ var BodyRetention = object({
|
|
|
11029
11045
|
// candidate set that is already bounded by "delivered, or never owed".
|
|
11030
11046
|
retainDays: number2().int().min(1).max(3650).default(BODY_RETENTION_DEFAULT_DAYS)
|
|
11031
11047
|
}).meta({ id: "BodyRetention" });
|
|
11048
|
+
var MAX_PROTECTED_PATH_ENTRIES = 256;
|
|
11049
|
+
var MAX_PROTECTED_PATH_ENTRY_CHARS = 1024;
|
|
11050
|
+
var ProtectedPathEntry = string2().trim().min(1).max(MAX_PROTECTED_PATH_ENTRY_CHARS);
|
|
11051
|
+
var ProtectedPaths = array(unknown()).transform(
|
|
11052
|
+
(entries) => entries.flatMap((entry) => {
|
|
11053
|
+
const parsed = ProtectedPathEntry.safeParse(entry);
|
|
11054
|
+
return parsed.success ? [parsed.data] : [];
|
|
11055
|
+
}).slice(0, MAX_PROTECTED_PATH_ENTRIES)
|
|
11056
|
+
);
|
|
11032
11057
|
var WorkspaceSettings = object({
|
|
11033
11058
|
specVersion: number2().int().positive().default(WORKSPACE_SETTINGS_SPEC_VERSION),
|
|
11034
11059
|
runMode: RunMode.default("standalone"),
|
|
@@ -11119,7 +11144,18 @@ var WorkspaceSettings = object({
|
|
|
11119
11144
|
bodyRetention: BodyRetention.default({
|
|
11120
11145
|
enabled: false,
|
|
11121
11146
|
retainDays: BODY_RETENTION_DEFAULT_DAYS
|
|
11122
|
-
})
|
|
11147
|
+
}),
|
|
11148
|
+
// Folders and file name globs whose files a tool call may not touch
|
|
11149
|
+
// unflagged: a Read, Grep, Glob or Bash naming one becomes a finding under
|
|
11150
|
+
// the command-risk pack's policy. Absent means none are protected, and
|
|
11151
|
+
// protectedPathsOf is the one reader.
|
|
11152
|
+
//
|
|
11153
|
+
// A bad entry is dropped on its own (see ProtectedPaths); `.catch(undefined)`
|
|
11154
|
+
// reads a value that is not a list at all as no list. A settings.json that
|
|
11155
|
+
// fails this schema reads as the unonboarded defaults, and the next save
|
|
11156
|
+
// writes those back over it, so a malformed value must not cost every other
|
|
11157
|
+
// setting. Not a ManagedSettingKey.
|
|
11158
|
+
protectedPaths: ProtectedPaths.optional().catch(void 0)
|
|
11123
11159
|
});
|
|
11124
11160
|
|
|
11125
11161
|
// ../../packages/schema/src/zod/agent-scope.ts
|
|
@@ -11283,6 +11319,9 @@ var ConfigInventoryAck = object({
|
|
|
11283
11319
|
accepted: number2().int().nonnegative()
|
|
11284
11320
|
});
|
|
11285
11321
|
|
|
11322
|
+
// ../../packages/schema/src/zod/credential-status.ts
|
|
11323
|
+
var CredentialStatus = _enum(["rotation_overdue", "exposed"]).meta({ id: "CredentialStatus" });
|
|
11324
|
+
|
|
11286
11325
|
// ../../packages/schema/src/zod/registry.ts
|
|
11287
11326
|
var Namespace = string2().regex(/^[a-z][a-z0-9-]*$/);
|
|
11288
11327
|
var PackId = string2().regex(/^[a-z][a-z0-9-]*$/);
|
|
@@ -12942,7 +12981,7 @@ var regexMatcher = new RegexMatcher2();
|
|
|
12942
12981
|
var SHIELDED_SOURCE = `${POINTER_TOKEN_PATTERN.source}|${SIGHTING_TOKEN_PATTERN.source}`;
|
|
12943
12982
|
|
|
12944
12983
|
// ../../packages/detections/src/posture/config-posture.ts
|
|
12945
|
-
var RULE_VERSION = "
|
|
12984
|
+
var RULE_VERSION = "2";
|
|
12946
12985
|
var KNOWN_TOOLS = /* @__PURE__ */ new Set([
|
|
12947
12986
|
"prettier",
|
|
12948
12987
|
"eslint",
|
|
@@ -12956,6 +12995,13 @@ var KNOWN_TOOLS = /* @__PURE__ */ new Set([
|
|
|
12956
12995
|
"npm",
|
|
12957
12996
|
"pnpm",
|
|
12958
12997
|
"yarn",
|
|
12998
|
+
"bun",
|
|
12999
|
+
"bunx",
|
|
13000
|
+
"deno",
|
|
13001
|
+
"python3",
|
|
13002
|
+
"uv",
|
|
13003
|
+
"bash",
|
|
13004
|
+
"sh",
|
|
12959
13005
|
"make",
|
|
12960
13006
|
"git",
|
|
12961
13007
|
"jq",
|
|
@@ -12982,7 +13028,7 @@ var CONFIG_POSTURE_RULES = [
|
|
|
12982
13028
|
name: "Unknown hook \u2014 not attributable to a plugin or known tool",
|
|
12983
13029
|
category: "config",
|
|
12984
13030
|
// medium, not high: with a deliberately tiny allowlist this v1 heuristic
|
|
12985
|
-
// fires on ordinary
|
|
13031
|
+
// fires on ordinary hooks it cannot attribute, such as compound commands
|
|
12986
13032
|
// (cd … && tool); 'high' is reserved for egress, which is genuinely
|
|
12987
13033
|
// dangerous. Revisit when the known-hooks registry replaces the allowlist.
|
|
12988
13034
|
severity: "medium",
|
|
@@ -13075,6 +13121,7 @@ var POLYNOMIAL_PROBES = ["abc-", "a.", "a ", "a=", "x", "0", "a@", "a/", "ab"].m
|
|
|
13075
13121
|
);
|
|
13076
13122
|
var CPU_CORROBORATION_SHARE = 0.2;
|
|
13077
13123
|
var CORROBORATION_FLOOR_MS = BUDGET_MS * CPU_CORROBORATION_SHARE;
|
|
13124
|
+
var MAX_GROWTH_RATIO = 3;
|
|
13078
13125
|
function repeatTo(unit, length) {
|
|
13079
13126
|
return unit.repeat(Math.ceil(length / unit.length)).slice(0, length);
|
|
13080
13127
|
}
|
|
@@ -13111,6 +13158,8 @@ var GROWTH_CORPORA = [
|
|
|
13111
13158
|
build: (length) => repeatTo(unit, length)
|
|
13112
13159
|
}))
|
|
13113
13160
|
];
|
|
13161
|
+
var QUADRATIC_GROWTH = 4;
|
|
13162
|
+
var SAMPLED_GROWTH = MAX_GROWTH_RATIO ** 2 / QUADRATIC_GROWTH;
|
|
13114
13163
|
|
|
13115
13164
|
// ../../packages/detections/src/variable-name.ts
|
|
13116
13165
|
var VARIABLE_NAME_LOOKBEHIND = MAX_VARIABLE_NAME_LENGTH + 64;
|