@akasecurity/ai-tc-codex 0.9.20 → 0.9.22
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 +587 -56
- package/scripts/backfill.js +1038 -255
- package/scripts/content-retention.js +217 -63
- package/scripts/filescan.js +1065 -271
- package/scripts/firstrun.js +869 -194
- package/scripts/history-sync.js +741 -105
- package/scripts/intro.js +91 -11
- package/scripts/onboard.js +587 -56
- package/scripts/post-tool-use.js +1121 -301
- package/scripts/pre-tool-use.js +1104 -236
- package/scripts/query.js +868 -193
- package/scripts/reconcile.js +888 -201
- package/scripts/remediate.js +1007 -226
- package/scripts/scan-worker.js +103 -13
- package/scripts/session-start.js +1058 -292
- package/scripts/start-light.js +103 -13
- package/scripts/stop.js +896 -206
- package/scripts/sync.js +1317 -282
- package/scripts/user-prompt-submit.js +1034 -238
- package/skills/setup/SKILL.md +1 -0
package/scripts/intro.js
CHANGED
|
@@ -8142,7 +8142,8 @@ var Span = object({
|
|
|
8142
8142
|
var MAX_VARIABLE_NAME_LENGTH = 128;
|
|
8143
8143
|
var VariableName = string2().max(MAX_VARIABLE_NAME_LENGTH);
|
|
8144
8144
|
var Finding = object({
|
|
8145
|
-
|
|
8145
|
+
// A random UUID or a content-addressed sha256 hex digest, depending on the writer.
|
|
8146
|
+
id: string2(),
|
|
8146
8147
|
eventId: guid2(),
|
|
8147
8148
|
ruleId: string2(),
|
|
8148
8149
|
category: DetectionCategory,
|
|
@@ -8570,11 +8571,20 @@ var EventKind = _enum(["prompt", "response", "code_change", "tool_use"]).meta({
|
|
|
8570
8571
|
var CAPTURE_EVENT_TYPES_SQL = EventKind.options.map((k) => `'${k}'`).join(",");
|
|
8571
8572
|
var SIGHTING_TOKEN_PATTERN = /\[\[aka:fp:v[1-9][0-9]{0,15}\.[A-Za-z0-9_-]{43}\]\]/;
|
|
8572
8573
|
var SIGHTING_TOKEN_ANCHORED = new RegExp(`^${SIGHTING_TOKEN_PATTERN.source}$`);
|
|
8574
|
+
var SIGHTING_ALIASES_MAX = 4;
|
|
8575
|
+
var SightingAliases = array(string2().regex(SIGHTING_TOKEN_ANCHORED)).min(1).max(SIGHTING_ALIASES_MAX);
|
|
8573
8576
|
var CaptureSighting = object({
|
|
8574
8577
|
token: string2().regex(SIGHTING_TOKEN_ANCHORED),
|
|
8578
|
+
aliases: SightingAliases.optional(),
|
|
8575
8579
|
ruleId: string2().min(1),
|
|
8576
8580
|
category: DetectionCategory
|
|
8577
8581
|
}).meta({ id: "CaptureSighting" });
|
|
8582
|
+
var REVIEW_VALUES_MAX = 16;
|
|
8583
|
+
var REVIEW_VALUE_MAX_CHARS = 1024;
|
|
8584
|
+
var ReviewValue = object({
|
|
8585
|
+
ruleId: string2().min(1).max(256),
|
|
8586
|
+
value: string2().min(1).max(REVIEW_VALUE_MAX_CHARS)
|
|
8587
|
+
}).meta({ id: "ReviewValue" });
|
|
8578
8588
|
var EventMetadata = object({
|
|
8579
8589
|
sessionId: string2().optional(),
|
|
8580
8590
|
repo: string2().optional(),
|
|
@@ -8682,7 +8692,14 @@ var EventMetadata = object({
|
|
|
8682
8692
|
scanIncomplete: _enum(["timeout", "unavailable"]).optional(),
|
|
8683
8693
|
// The sighting tokens in `content`, one entry per distinct token and rule.
|
|
8684
8694
|
// Set only on a forwarded capture; the locally stored copy holds the values.
|
|
8685
|
-
sightings: array(CaptureSighting).optional()
|
|
8695
|
+
sightings: array(CaptureSighting).optional(),
|
|
8696
|
+
// The length of the text this capture was cut from, when its content holds only the first
|
|
8697
|
+
// part of it. Absent when the content is the whole text.
|
|
8698
|
+
contentTruncatedFrom: number2().int().nonnegative().optional(),
|
|
8699
|
+
// The raw value of each finding in this capture, for review by the deployment. Set only on
|
|
8700
|
+
// a forwarded capture from a repository the organization's capture settings name; the
|
|
8701
|
+
// locally stored copy never carries it.
|
|
8702
|
+
reviewValues: array(ReviewValue).max(REVIEW_VALUES_MAX).optional()
|
|
8686
8703
|
}).meta({ id: "EventMetadata" });
|
|
8687
8704
|
var Event = object({
|
|
8688
8705
|
id: guid2(),
|
|
@@ -9673,7 +9690,7 @@ var McpTool = object({
|
|
|
9673
9690
|
signature: string2(),
|
|
9674
9691
|
description: string2(),
|
|
9675
9692
|
write: boolean2(),
|
|
9676
|
-
/**
|
|
9693
|
+
/** What makes the tool dangerous; null when nothing does. */
|
|
9677
9694
|
risk: string2().nullable()
|
|
9678
9695
|
}).meta({ id: "McpTool" });
|
|
9679
9696
|
var AssetFindingRef = object({
|
|
@@ -9720,8 +9737,9 @@ var ProjectSensitiveData = object({ items: array(SensitiveDataClass) }).meta({ i
|
|
|
9720
9737
|
var ListProjectsResponse = object({ items: array(ProjectSummary) }).meta({ id: "ListProjectsResponse" });
|
|
9721
9738
|
var InventoryStats = object({
|
|
9722
9739
|
/**
|
|
9723
|
-
* Assets with a flag
|
|
9724
|
-
*
|
|
9740
|
+
* Assets with a flag or with an `ATTENTION_TRUST_LEVELS` effective trust,
|
|
9741
|
+
* plus projects with a finding in the last `PROJECT_FINDINGS_WINDOW_DAYS`
|
|
9742
|
+
* days (drives the attention header chip). An asset counts once.
|
|
9725
9743
|
*/
|
|
9726
9744
|
attention: number2().int().nonnegative(),
|
|
9727
9745
|
byType: object({
|
|
@@ -10011,6 +10029,7 @@ var EgressCredentialRef = discriminatedUnion("kind", [
|
|
|
10011
10029
|
object({
|
|
10012
10030
|
kind: literal("literal"),
|
|
10013
10031
|
token: string2().regex(SIGHTING_TOKEN_ANCHORED),
|
|
10032
|
+
aliases: SightingAliases.optional(),
|
|
10014
10033
|
ruleId: string2().min(1).max(256)
|
|
10015
10034
|
}).strict(),
|
|
10016
10035
|
object({ kind: literal("variable"), variableName: VariableName.min(1) }).strict()
|
|
@@ -10243,6 +10262,10 @@ var EgressIngestHit = object({
|
|
|
10243
10262
|
*/
|
|
10244
10263
|
credentialRefs: EgressCredentialRefs.optional()
|
|
10245
10264
|
}).meta({ id: "EgressIngestHit" });
|
|
10265
|
+
var SUPERSEDED_PROJECT_KEYS_MAX = 4;
|
|
10266
|
+
var SupersededProjectKeys = array(
|
|
10267
|
+
string2().regex(/^[0-9a-f]{64}$/, "a superseded key must be a 64-character lowercase hex digest")
|
|
10268
|
+
).max(SUPERSEDED_PROJECT_KEYS_MAX);
|
|
10246
10269
|
var EgressIngestRequest = object({
|
|
10247
10270
|
/**
|
|
10248
10271
|
* Hash digest of the local `projectKey`, never the plaintext.
|
|
@@ -10255,6 +10278,7 @@ var EgressIngestRequest = object({
|
|
|
10255
10278
|
* that still has the plaintext to not send.
|
|
10256
10279
|
*/
|
|
10257
10280
|
projectKey: string2().regex(/^[0-9a-f]{64}$/, "projectKey must be a 64-character lowercase hex digest"),
|
|
10281
|
+
supersededProjectKeys: SupersededProjectKeys.optional(),
|
|
10258
10282
|
/** Display name only — never keys reconciliation. */
|
|
10259
10283
|
project: string2(),
|
|
10260
10284
|
reconcile: EgressReconcile,
|
|
@@ -10364,6 +10388,10 @@ var DeviceCommand = object({
|
|
|
10364
10388
|
expiresAt: printable(64).min(1)
|
|
10365
10389
|
}).strict();
|
|
10366
10390
|
var DeviceCommandPollResponse = object({ command: DeviceCommand.nullable() });
|
|
10391
|
+
var SessionHoldResponse = object({
|
|
10392
|
+
held: boolean2(),
|
|
10393
|
+
reason: printable(500).optional()
|
|
10394
|
+
});
|
|
10367
10395
|
var DeviceCommandFailureReason = _enum(["scan_failed", "no_projects", "expired"]);
|
|
10368
10396
|
var DeviceCommandAckBody = discriminatedUnion("outcome", [
|
|
10369
10397
|
object({
|
|
@@ -10381,7 +10409,8 @@ var sightingKeyMaterial = string2().regex(SIGHTING_KEY_MATERIAL, "must be the ba
|
|
|
10381
10409
|
var sightingKeyVersion = number2().int().min(1);
|
|
10382
10410
|
var SightingKeyVersion = object({
|
|
10383
10411
|
keyVersion: sightingKeyVersion,
|
|
10384
|
-
key: sightingKeyMaterial
|
|
10412
|
+
key: sightingKeyMaterial,
|
|
10413
|
+
acceptedUntil: iso_exports.datetime({ offset: true }).optional().catch(void 0)
|
|
10385
10414
|
});
|
|
10386
10415
|
var SightingKeyResponse = object({
|
|
10387
10416
|
keyVersion: sightingKeyVersion,
|
|
@@ -10398,7 +10427,8 @@ var SightingKeyResponse = object({
|
|
|
10398
10427
|
var StoredSightingKeys = SightingKeyResponse.and(
|
|
10399
10428
|
object({
|
|
10400
10429
|
fetchedAtMs: number2().int().nonnegative(),
|
|
10401
|
-
endpointFingerprint: string2().regex(/^[0-9a-f]{64}$/)
|
|
10430
|
+
endpointFingerprint: string2().regex(/^[0-9a-f]{64}$/),
|
|
10431
|
+
previousFirstSeenAtMs: record(string2().regex(/^[1-9][0-9]*$/), number2().int().nonnegative()).optional()
|
|
10402
10432
|
})
|
|
10403
10433
|
);
|
|
10404
10434
|
var CREDENTIAL_SIGHTINGS_BATCH_MAX = 500;
|
|
@@ -10413,6 +10443,7 @@ var SightingProject = object({
|
|
|
10413
10443
|
}).strict().meta({ id: "SightingProject" });
|
|
10414
10444
|
var CredentialSighting = object({
|
|
10415
10445
|
token: string2().regex(SIGHTING_TOKEN_ANCHORED),
|
|
10446
|
+
aliases: SightingAliases.optional(),
|
|
10416
10447
|
ruleId: printable(256).min(1),
|
|
10417
10448
|
category: literal("secret"),
|
|
10418
10449
|
variableName: VariableName.min(1).optional(),
|
|
@@ -10423,7 +10454,9 @@ var CredentialSighting = object({
|
|
|
10423
10454
|
}).strict().meta({ id: "CredentialSighting" });
|
|
10424
10455
|
var CredentialSightingsRequest = object({
|
|
10425
10456
|
sightings: array(CredentialSighting).min(1).max(CREDENTIAL_SIGHTINGS_BATCH_MAX),
|
|
10426
|
-
scanId: uuid2().optional()
|
|
10457
|
+
scanId: uuid2().optional(),
|
|
10458
|
+
/** The earlier digests of the one project every sighting in the request names. */
|
|
10459
|
+
supersededProjectKeys: SupersededProjectKeys.optional()
|
|
10427
10460
|
}).strict().meta({ id: "CredentialSightingsRequest" });
|
|
10428
10461
|
var CredentialSightingsAck = object({
|
|
10429
10462
|
accepted: number2().int().nonnegative()
|
|
@@ -10550,6 +10583,22 @@ var Policy = object({
|
|
|
10550
10583
|
var RedactFallback = BuiltinPolicyId.extract(["monitor", "warn", "block"]).meta({
|
|
10551
10584
|
id: "RedactFallback"
|
|
10552
10585
|
});
|
|
10586
|
+
var ModelPolicy = object({
|
|
10587
|
+
mode: literal("allowlist"),
|
|
10588
|
+
approved: array(string2().min(1).max(512)).max(1e3)
|
|
10589
|
+
}).meta({ id: "ModelPolicy" });
|
|
10590
|
+
var TOOL_OUTPUT_FORWARD_MIN_CHARS = 2;
|
|
10591
|
+
var TOOL_OUTPUT_FORWARD_MAX_CHARS = 65536;
|
|
10592
|
+
var CAPTURE_REPOS_MAX = 1e3;
|
|
10593
|
+
var CaptureRepos = array(string2().min(1).max(512)).max(CAPTURE_REPOS_MAX);
|
|
10594
|
+
var CaptureSettings = object({
|
|
10595
|
+
toolOutput: object({
|
|
10596
|
+
maxChars: number2().int().min(TOOL_OUTPUT_FORWARD_MIN_CHARS).max(TOOL_OUTPUT_FORWARD_MAX_CHARS),
|
|
10597
|
+
repos: CaptureRepos.optional()
|
|
10598
|
+
}).optional(),
|
|
10599
|
+
reviewValueRepos: CaptureRepos.optional(),
|
|
10600
|
+
sessionHold: boolean2().optional()
|
|
10601
|
+
}).meta({ id: "CaptureSettings" });
|
|
10553
10602
|
var PolicyBundle = object({
|
|
10554
10603
|
version: string2(),
|
|
10555
10604
|
policies: array(Policy),
|
|
@@ -10600,6 +10649,9 @@ var PolicyBundle = object({
|
|
|
10600
10649
|
// control plane), so no name resolution stands between the decision and the
|
|
10601
10650
|
// comparison.
|
|
10602
10651
|
prohibitedModels: array(string2()).optional(),
|
|
10652
|
+
// Optional so an older backend, and an older on-disk cache, still parses; absent leaves every
|
|
10653
|
+
// model approved.
|
|
10654
|
+
modelPolicy: ModelPolicy.optional(),
|
|
10603
10655
|
// What a resolved `redact` becomes on a field the host cannot rewrite, as
|
|
10604
10656
|
// the ORGANIZATION would have it. Merged raise-only against the device's own
|
|
10605
10657
|
// `WorkspaceSettings.redactFallback` (see strongerRedactFallback below), so
|
|
@@ -10610,6 +10662,9 @@ var PolicyBundle = object({
|
|
|
10610
10662
|
// absent leaves the device's own setting in force, which is the behaviour
|
|
10611
10663
|
// that predates the field and the safe direction to default.
|
|
10612
10664
|
redactFallback: RedactFallback.optional(),
|
|
10665
|
+
// Optional so an older backend, and an older on-disk cache, still parses; absent sends what
|
|
10666
|
+
// the machine sent before the field existed.
|
|
10667
|
+
capture: CaptureSettings.optional(),
|
|
10613
10668
|
customKeywords: array(string2()),
|
|
10614
10669
|
fetchedAt: iso_exports.datetime()
|
|
10615
10670
|
}).meta({ id: "PolicyBundle" });
|
|
@@ -10617,7 +10672,9 @@ var POLICY_BUNDLE_SHAPE_ID = [
|
|
|
10617
10672
|
...Object.keys(PolicyBundle.shape),
|
|
10618
10673
|
...Object.keys(Policy.shape).map((key) => `policies.${key}`),
|
|
10619
10674
|
...PolicyTarget.options.flatMap((member) => "shape" in member ? Object.keys(member.shape) : []).map((key) => `policies.target.${key}`),
|
|
10620
|
-
...Object.keys(ExceptionBundleEntry.shape).map((key) => `exceptions.${key}`)
|
|
10675
|
+
...Object.keys(ExceptionBundleEntry.shape).map((key) => `exceptions.${key}`),
|
|
10676
|
+
...Object.keys(ModelPolicy.shape).map((key) => `modelPolicy.${key}`),
|
|
10677
|
+
...Object.keys(CaptureSettings.shape).map((key) => `capture.${key}`)
|
|
10621
10678
|
].sort().join(",");
|
|
10622
10679
|
var OBSERVE_ONLY_CATEGORIES = ["config"];
|
|
10623
10680
|
var ENFORCEABLE_CATEGORIES = DetectionCategory.options.filter((c) => !OBSERVE_ONLY_CATEGORIES.includes(c));
|
|
@@ -10978,7 +11035,7 @@ var DetectedWebAccounts = object({
|
|
|
10978
11035
|
var DetectedWebAccountsEnvelope = DetectedWebAccounts.extend({ accounts: array(unknown()) });
|
|
10979
11036
|
|
|
10980
11037
|
// ../../packages/schema/src/zod/local.ts
|
|
10981
|
-
var WORKSPACE_SETTINGS_SPEC_VERSION =
|
|
11038
|
+
var WORKSPACE_SETTINGS_SPEC_VERSION = 11;
|
|
10982
11039
|
var RunMode = _enum(["standalone", "attached"]);
|
|
10983
11040
|
var ControlPlaneConnection = object({
|
|
10984
11041
|
endpoint: string2().min(1),
|
|
@@ -11080,6 +11137,15 @@ var BodyRetention = object({
|
|
|
11080
11137
|
// candidate set that is already bounded by "delivered, or never owed".
|
|
11081
11138
|
retainDays: number2().int().min(1).max(3650).default(BODY_RETENTION_DEFAULT_DAYS)
|
|
11082
11139
|
}).meta({ id: "BodyRetention" });
|
|
11140
|
+
var MAX_PROTECTED_PATH_ENTRIES = 256;
|
|
11141
|
+
var MAX_PROTECTED_PATH_ENTRY_CHARS = 1024;
|
|
11142
|
+
var ProtectedPathEntry = string2().trim().min(1).max(MAX_PROTECTED_PATH_ENTRY_CHARS);
|
|
11143
|
+
var ProtectedPaths = array(unknown()).transform(
|
|
11144
|
+
(entries) => entries.flatMap((entry) => {
|
|
11145
|
+
const parsed = ProtectedPathEntry.safeParse(entry);
|
|
11146
|
+
return parsed.success ? [parsed.data] : [];
|
|
11147
|
+
}).slice(0, MAX_PROTECTED_PATH_ENTRIES)
|
|
11148
|
+
);
|
|
11083
11149
|
var WorkspaceSettings = object({
|
|
11084
11150
|
specVersion: number2().int().positive().default(WORKSPACE_SETTINGS_SPEC_VERSION),
|
|
11085
11151
|
runMode: RunMode.default("standalone"),
|
|
@@ -11170,7 +11236,18 @@ var WorkspaceSettings = object({
|
|
|
11170
11236
|
bodyRetention: BodyRetention.default({
|
|
11171
11237
|
enabled: false,
|
|
11172
11238
|
retainDays: BODY_RETENTION_DEFAULT_DAYS
|
|
11173
|
-
})
|
|
11239
|
+
}),
|
|
11240
|
+
// Folders and file name globs whose files a tool call may not touch
|
|
11241
|
+
// unflagged: a Read, Grep, Glob or Bash naming one becomes a finding under
|
|
11242
|
+
// the command-risk pack's policy. Absent means none are protected, and
|
|
11243
|
+
// protectedPathsOf is the one reader.
|
|
11244
|
+
//
|
|
11245
|
+
// A bad entry is dropped on its own (see ProtectedPaths); `.catch(undefined)`
|
|
11246
|
+
// reads a value that is not a list at all as no list. A settings.json that
|
|
11247
|
+
// fails this schema reads as the unonboarded defaults, and the next save
|
|
11248
|
+
// writes those back over it, so a malformed value must not cost every other
|
|
11249
|
+
// setting. Not a ManagedSettingKey.
|
|
11250
|
+
protectedPaths: ProtectedPaths.optional().catch(void 0)
|
|
11174
11251
|
});
|
|
11175
11252
|
|
|
11176
11253
|
// ../../packages/schema/src/zod/agent-scope.ts
|
|
@@ -11334,6 +11411,9 @@ var ConfigInventoryAck = object({
|
|
|
11334
11411
|
accepted: number2().int().nonnegative()
|
|
11335
11412
|
});
|
|
11336
11413
|
|
|
11414
|
+
// ../../packages/schema/src/zod/credential-status.ts
|
|
11415
|
+
var CredentialStatus = _enum(["rotation_overdue", "exposed"]).meta({ id: "CredentialStatus" });
|
|
11416
|
+
|
|
11337
11417
|
// ../../packages/schema/src/zod/registry.ts
|
|
11338
11418
|
var Namespace = string2().regex(/^[a-z][a-z0-9-]*$/);
|
|
11339
11419
|
var PackId = string2().regex(/^[a-z][a-z0-9-]*$/);
|