@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.
@@ -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
- id: guid2(),
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,11 +8515,20 @@ 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" });
8526
+ var REVIEW_VALUES_MAX = 16;
8527
+ var REVIEW_VALUE_MAX_CHARS = 1024;
8528
+ var ReviewValue = object({
8529
+ ruleId: string2().min(1).max(256),
8530
+ value: string2().min(1).max(REVIEW_VALUE_MAX_CHARS)
8531
+ }).meta({ id: "ReviewValue" });
8522
8532
  var EventMetadata = object({
8523
8533
  sessionId: string2().optional(),
8524
8534
  repo: string2().optional(),
@@ -8626,7 +8636,14 @@ var EventMetadata = object({
8626
8636
  scanIncomplete: _enum(["timeout", "unavailable"]).optional(),
8627
8637
  // The sighting tokens in `content`, one entry per distinct token and rule.
8628
8638
  // Set only on a forwarded capture; the locally stored copy holds the values.
8629
- sightings: array(CaptureSighting).optional()
8639
+ sightings: array(CaptureSighting).optional(),
8640
+ // The length of the text this capture was cut from, when its content holds only the first
8641
+ // part of it. Absent when the content is the whole text.
8642
+ contentTruncatedFrom: number2().int().nonnegative().optional(),
8643
+ // The raw value of each finding in this capture, for review by the deployment. Set only on
8644
+ // a forwarded capture from a repository the organization's capture settings name; the
8645
+ // locally stored copy never carries it.
8646
+ reviewValues: array(ReviewValue).max(REVIEW_VALUES_MAX).optional()
8630
8647
  }).meta({ id: "EventMetadata" });
8631
8648
  var Event = object({
8632
8649
  id: guid2(),
@@ -9617,7 +9634,7 @@ var McpTool = object({
9617
9634
  signature: string2(),
9618
9635
  description: string2(),
9619
9636
  write: boolean2(),
9620
- /** Non-null string when tool is dangerous / blocked; null otherwise. */
9637
+ /** What makes the tool dangerous; null when nothing does. */
9621
9638
  risk: string2().nullable()
9622
9639
  }).meta({ id: "McpTool" });
9623
9640
  var AssetFindingRef = object({
@@ -9664,8 +9681,9 @@ var ProjectSensitiveData = object({ items: array(SensitiveDataClass) }).meta({ i
9664
9681
  var ListProjectsResponse = object({ items: array(ProjectSummary) }).meta({ id: "ListProjectsResponse" });
9665
9682
  var InventoryStats = object({
9666
9683
  /**
9667
- * Assets with a flag, plus projects with a finding in the last
9668
- * `PROJECT_FINDINGS_WINDOW_DAYS` days (drives the attention header chip).
9684
+ * Assets with a flag or with an `ATTENTION_TRUST_LEVELS` effective trust,
9685
+ * plus projects with a finding in the last `PROJECT_FINDINGS_WINDOW_DAYS`
9686
+ * days (drives the attention header chip). An asset counts once.
9669
9687
  */
9670
9688
  attention: number2().int().nonnegative(),
9671
9689
  byType: object({
@@ -9955,6 +9973,7 @@ var EgressCredentialRef = discriminatedUnion("kind", [
9955
9973
  object({
9956
9974
  kind: literal("literal"),
9957
9975
  token: string2().regex(SIGHTING_TOKEN_ANCHORED),
9976
+ aliases: SightingAliases.optional(),
9958
9977
  ruleId: string2().min(1).max(256)
9959
9978
  }).strict(),
9960
9979
  object({ kind: literal("variable"), variableName: VariableName.min(1) }).strict()
@@ -10187,6 +10206,10 @@ var EgressIngestHit = object({
10187
10206
  */
10188
10207
  credentialRefs: EgressCredentialRefs.optional()
10189
10208
  }).meta({ id: "EgressIngestHit" });
10209
+ var SUPERSEDED_PROJECT_KEYS_MAX = 4;
10210
+ var SupersededProjectKeys = array(
10211
+ string2().regex(/^[0-9a-f]{64}$/, "a superseded key must be a 64-character lowercase hex digest")
10212
+ ).max(SUPERSEDED_PROJECT_KEYS_MAX);
10190
10213
  var EgressIngestRequest = object({
10191
10214
  /**
10192
10215
  * Hash digest of the local `projectKey`, never the plaintext.
@@ -10199,6 +10222,7 @@ var EgressIngestRequest = object({
10199
10222
  * that still has the plaintext to not send.
10200
10223
  */
10201
10224
  projectKey: string2().regex(/^[0-9a-f]{64}$/, "projectKey must be a 64-character lowercase hex digest"),
10225
+ supersededProjectKeys: SupersededProjectKeys.optional(),
10202
10226
  /** Display name only — never keys reconciliation. */
10203
10227
  project: string2(),
10204
10228
  reconcile: EgressReconcile,
@@ -10308,6 +10332,10 @@ var DeviceCommand = object({
10308
10332
  expiresAt: printable(64).min(1)
10309
10333
  }).strict();
10310
10334
  var DeviceCommandPollResponse = object({ command: DeviceCommand.nullable() });
10335
+ var SessionHoldResponse = object({
10336
+ held: boolean2(),
10337
+ reason: printable(500).optional()
10338
+ });
10311
10339
  var DeviceCommandFailureReason = _enum(["scan_failed", "no_projects", "expired"]);
10312
10340
  var DeviceCommandAckBody = discriminatedUnion("outcome", [
10313
10341
  object({
@@ -10325,7 +10353,8 @@ var sightingKeyMaterial = string2().regex(SIGHTING_KEY_MATERIAL, "must be the ba
10325
10353
  var sightingKeyVersion = number2().int().min(1);
10326
10354
  var SightingKeyVersion = object({
10327
10355
  keyVersion: sightingKeyVersion,
10328
- key: sightingKeyMaterial
10356
+ key: sightingKeyMaterial,
10357
+ acceptedUntil: iso_exports.datetime({ offset: true }).optional().catch(void 0)
10329
10358
  });
10330
10359
  var SightingKeyResponse = object({
10331
10360
  keyVersion: sightingKeyVersion,
@@ -10342,7 +10371,8 @@ var SightingKeyResponse = object({
10342
10371
  var StoredSightingKeys = SightingKeyResponse.and(
10343
10372
  object({
10344
10373
  fetchedAtMs: number2().int().nonnegative(),
10345
- endpointFingerprint: string2().regex(/^[0-9a-f]{64}$/)
10374
+ endpointFingerprint: string2().regex(/^[0-9a-f]{64}$/),
10375
+ previousFirstSeenAtMs: record(string2().regex(/^[1-9][0-9]*$/), number2().int().nonnegative()).optional()
10346
10376
  })
10347
10377
  );
10348
10378
  var CREDENTIAL_SIGHTINGS_BATCH_MAX = 500;
@@ -10357,6 +10387,7 @@ var SightingProject = object({
10357
10387
  }).strict().meta({ id: "SightingProject" });
10358
10388
  var CredentialSighting = object({
10359
10389
  token: string2().regex(SIGHTING_TOKEN_ANCHORED),
10390
+ aliases: SightingAliases.optional(),
10360
10391
  ruleId: printable(256).min(1),
10361
10392
  category: literal("secret"),
10362
10393
  variableName: VariableName.min(1).optional(),
@@ -10367,7 +10398,9 @@ var CredentialSighting = object({
10367
10398
  }).strict().meta({ id: "CredentialSighting" });
10368
10399
  var CredentialSightingsRequest = object({
10369
10400
  sightings: array(CredentialSighting).min(1).max(CREDENTIAL_SIGHTINGS_BATCH_MAX),
10370
- scanId: uuid2().optional()
10401
+ scanId: uuid2().optional(),
10402
+ /** The earlier digests of the one project every sighting in the request names. */
10403
+ supersededProjectKeys: SupersededProjectKeys.optional()
10371
10404
  }).strict().meta({ id: "CredentialSightingsRequest" });
10372
10405
  var CredentialSightingsAck = object({
10373
10406
  accepted: number2().int().nonnegative()
@@ -10494,6 +10527,22 @@ var Policy = object({
10494
10527
  var RedactFallback = BuiltinPolicyId.extract(["monitor", "warn", "block"]).meta({
10495
10528
  id: "RedactFallback"
10496
10529
  });
10530
+ var ModelPolicy = object({
10531
+ mode: literal("allowlist"),
10532
+ approved: array(string2().min(1).max(512)).max(1e3)
10533
+ }).meta({ id: "ModelPolicy" });
10534
+ var TOOL_OUTPUT_FORWARD_MIN_CHARS = 2;
10535
+ var TOOL_OUTPUT_FORWARD_MAX_CHARS = 65536;
10536
+ var CAPTURE_REPOS_MAX = 1e3;
10537
+ var CaptureRepos = array(string2().min(1).max(512)).max(CAPTURE_REPOS_MAX);
10538
+ var CaptureSettings = object({
10539
+ toolOutput: object({
10540
+ maxChars: number2().int().min(TOOL_OUTPUT_FORWARD_MIN_CHARS).max(TOOL_OUTPUT_FORWARD_MAX_CHARS),
10541
+ repos: CaptureRepos.optional()
10542
+ }).optional(),
10543
+ reviewValueRepos: CaptureRepos.optional(),
10544
+ sessionHold: boolean2().optional()
10545
+ }).meta({ id: "CaptureSettings" });
10497
10546
  var PolicyBundle = object({
10498
10547
  version: string2(),
10499
10548
  policies: array(Policy),
@@ -10544,6 +10593,9 @@ var PolicyBundle = object({
10544
10593
  // control plane), so no name resolution stands between the decision and the
10545
10594
  // comparison.
10546
10595
  prohibitedModels: array(string2()).optional(),
10596
+ // Optional so an older backend, and an older on-disk cache, still parses; absent leaves every
10597
+ // model approved.
10598
+ modelPolicy: ModelPolicy.optional(),
10547
10599
  // What a resolved `redact` becomes on a field the host cannot rewrite, as
10548
10600
  // the ORGANIZATION would have it. Merged raise-only against the device's own
10549
10601
  // `WorkspaceSettings.redactFallback` (see strongerRedactFallback below), so
@@ -10554,6 +10606,9 @@ var PolicyBundle = object({
10554
10606
  // absent leaves the device's own setting in force, which is the behaviour
10555
10607
  // that predates the field and the safe direction to default.
10556
10608
  redactFallback: RedactFallback.optional(),
10609
+ // Optional so an older backend, and an older on-disk cache, still parses; absent sends what
10610
+ // the machine sent before the field existed.
10611
+ capture: CaptureSettings.optional(),
10557
10612
  customKeywords: array(string2()),
10558
10613
  fetchedAt: iso_exports.datetime()
10559
10614
  }).meta({ id: "PolicyBundle" });
@@ -10561,7 +10616,9 @@ var POLICY_BUNDLE_SHAPE_ID = [
10561
10616
  ...Object.keys(PolicyBundle.shape),
10562
10617
  ...Object.keys(Policy.shape).map((key) => `policies.${key}`),
10563
10618
  ...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}`)
10619
+ ...Object.keys(ExceptionBundleEntry.shape).map((key) => `exceptions.${key}`),
10620
+ ...Object.keys(ModelPolicy.shape).map((key) => `modelPolicy.${key}`),
10621
+ ...Object.keys(CaptureSettings.shape).map((key) => `capture.${key}`)
10565
10622
  ].sort().join(",");
10566
10623
  var OBSERVE_ONLY_CATEGORIES = ["config"];
10567
10624
  var ENFORCEABLE_CATEGORIES = DetectionCategory.options.filter((c) => !OBSERVE_ONLY_CATEGORIES.includes(c));
@@ -10927,7 +10984,7 @@ var DetectedWebAccounts = object({
10927
10984
  var DetectedWebAccountsEnvelope = DetectedWebAccounts.extend({ accounts: array(unknown()) });
10928
10985
 
10929
10986
  // ../../packages/schema/src/zod/local.ts
10930
- var WORKSPACE_SETTINGS_SPEC_VERSION = 10;
10987
+ var WORKSPACE_SETTINGS_SPEC_VERSION = 11;
10931
10988
  var RunMode = _enum(["standalone", "attached"]);
10932
10989
  var ControlPlaneConnection = object({
10933
10990
  endpoint: string2().min(1),
@@ -11029,6 +11086,15 @@ var BodyRetention = object({
11029
11086
  // candidate set that is already bounded by "delivered, or never owed".
11030
11087
  retainDays: number2().int().min(1).max(3650).default(BODY_RETENTION_DEFAULT_DAYS)
11031
11088
  }).meta({ id: "BodyRetention" });
11089
+ var MAX_PROTECTED_PATH_ENTRIES = 256;
11090
+ var MAX_PROTECTED_PATH_ENTRY_CHARS = 1024;
11091
+ var ProtectedPathEntry = string2().trim().min(1).max(MAX_PROTECTED_PATH_ENTRY_CHARS);
11092
+ var ProtectedPaths = array(unknown()).transform(
11093
+ (entries) => entries.flatMap((entry) => {
11094
+ const parsed = ProtectedPathEntry.safeParse(entry);
11095
+ return parsed.success ? [parsed.data] : [];
11096
+ }).slice(0, MAX_PROTECTED_PATH_ENTRIES)
11097
+ );
11032
11098
  var WorkspaceSettings = object({
11033
11099
  specVersion: number2().int().positive().default(WORKSPACE_SETTINGS_SPEC_VERSION),
11034
11100
  runMode: RunMode.default("standalone"),
@@ -11119,7 +11185,18 @@ var WorkspaceSettings = object({
11119
11185
  bodyRetention: BodyRetention.default({
11120
11186
  enabled: false,
11121
11187
  retainDays: BODY_RETENTION_DEFAULT_DAYS
11122
- })
11188
+ }),
11189
+ // Folders and file name globs whose files a tool call may not touch
11190
+ // unflagged: a Read, Grep, Glob or Bash naming one becomes a finding under
11191
+ // the command-risk pack's policy. Absent means none are protected, and
11192
+ // protectedPathsOf is the one reader.
11193
+ //
11194
+ // A bad entry is dropped on its own (see ProtectedPaths); `.catch(undefined)`
11195
+ // reads a value that is not a list at all as no list. A settings.json that
11196
+ // fails this schema reads as the unonboarded defaults, and the next save
11197
+ // writes those back over it, so a malformed value must not cost every other
11198
+ // setting. Not a ManagedSettingKey.
11199
+ protectedPaths: ProtectedPaths.optional().catch(void 0)
11123
11200
  });
11124
11201
 
11125
11202
  // ../../packages/schema/src/zod/agent-scope.ts
@@ -11283,6 +11360,9 @@ var ConfigInventoryAck = object({
11283
11360
  accepted: number2().int().nonnegative()
11284
11361
  });
11285
11362
 
11363
+ // ../../packages/schema/src/zod/credential-status.ts
11364
+ var CredentialStatus = _enum(["rotation_overdue", "exposed"]).meta({ id: "CredentialStatus" });
11365
+
11286
11366
  // ../../packages/schema/src/zod/registry.ts
11287
11367
  var Namespace = string2().regex(/^[a-z][a-z0-9-]*$/);
11288
11368
  var PackId = string2().regex(/^[a-z][a-z0-9-]*$/);
@@ -12942,7 +13022,7 @@ var regexMatcher = new RegexMatcher2();
12942
13022
  var SHIELDED_SOURCE = `${POINTER_TOKEN_PATTERN.source}|${SIGHTING_TOKEN_PATTERN.source}`;
12943
13023
 
12944
13024
  // ../../packages/detections/src/posture/config-posture.ts
12945
- var RULE_VERSION = "1";
13025
+ var RULE_VERSION = "2";
12946
13026
  var KNOWN_TOOLS = /* @__PURE__ */ new Set([
12947
13027
  "prettier",
12948
13028
  "eslint",
@@ -12956,6 +13036,13 @@ var KNOWN_TOOLS = /* @__PURE__ */ new Set([
12956
13036
  "npm",
12957
13037
  "pnpm",
12958
13038
  "yarn",
13039
+ "bun",
13040
+ "bunx",
13041
+ "deno",
13042
+ "python3",
13043
+ "uv",
13044
+ "bash",
13045
+ "sh",
12959
13046
  "make",
12960
13047
  "git",
12961
13048
  "jq",
@@ -12982,7 +13069,7 @@ var CONFIG_POSTURE_RULES = [
12982
13069
  name: "Unknown hook \u2014 not attributable to a plugin or known tool",
12983
13070
  category: "config",
12984
13071
  // medium, not high: with a deliberately tiny allowlist this v1 heuristic
12985
- // fires on ordinary interpreter hooks (python3 x.py) and compound commands
13072
+ // fires on ordinary hooks it cannot attribute, such as compound commands
12986
13073
  // (cd … && tool); 'high' is reserved for egress, which is genuinely
12987
13074
  // dangerous. Revisit when the known-hooks registry replaces the allowlist.
12988
13075
  severity: "medium",
@@ -13075,6 +13162,7 @@ var POLYNOMIAL_PROBES = ["abc-", "a.", "a ", "a=", "x", "0", "a@", "a/", "ab"].m
13075
13162
  );
13076
13163
  var CPU_CORROBORATION_SHARE = 0.2;
13077
13164
  var CORROBORATION_FLOOR_MS = BUDGET_MS * CPU_CORROBORATION_SHARE;
13165
+ var MAX_GROWTH_RATIO = 3;
13078
13166
  function repeatTo(unit, length) {
13079
13167
  return unit.repeat(Math.ceil(length / unit.length)).slice(0, length);
13080
13168
  }
@@ -13111,6 +13199,8 @@ var GROWTH_CORPORA = [
13111
13199
  build: (length) => repeatTo(unit, length)
13112
13200
  }))
13113
13201
  ];
13202
+ var QUADRATIC_GROWTH = 4;
13203
+ var SAMPLED_GROWTH = MAX_GROWTH_RATIO ** 2 / QUADRATIC_GROWTH;
13114
13204
 
13115
13205
  // ../../packages/detections/src/variable-name.ts
13116
13206
  var VARIABLE_NAME_LOOKBEHIND = MAX_VARIABLE_NAME_LENGTH + 64;