@openai/codex-security 0.1.10 → 0.1.11

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.
Files changed (55) hide show
  1. package/README.md +27 -13
  2. package/_bundled_plugin/.codex-plugin/plugin.json +1 -1
  3. package/_bundled_plugin/.mcp.json +3 -1
  4. package/_bundled_plugin/mcp/server.mjs.br.part-000 +0 -0
  5. package/_bundled_plugin/mcp/server.mjs.br.part-001 +0 -0
  6. package/_bundled_plugin/scripts/deep_scan_config.py +21 -1
  7. package/_bundled_plugin/scripts/deep_scan_workbench.py +44 -14
  8. package/_bundled_plugin/scripts/finalize_scan_contract.py +15 -207
  9. package/_bundled_plugin/scripts/generate_in_scope_files.py +40 -16
  10. package/_bundled_plugin/scripts/generate_rank_input.py +38 -5
  11. package/_bundled_plugin/scripts/rank_preview.py +4 -0
  12. package/_bundled_plugin/scripts/report_projection.py +39 -1
  13. package/_bundled_plugin/scripts/workbench_cli.py +5 -0
  14. package/_bundled_plugin/scripts/workbench_db.py +283 -4
  15. package/_bundled_plugin/scripts/workbench_schema.py +15 -0
  16. package/_bundled_plugin/scripts/workbench_source_excerpt.py +1 -5
  17. package/_bundled_plugin/scripts/workbench_target.py +82 -0
  18. package/_bundled_plugin/skills/deep-security-scan/SKILL.md +5 -3
  19. package/dist/api.d.ts +1 -0
  20. package/dist/api.d.ts.map +1 -1
  21. package/dist/api.js +217 -92
  22. package/dist/api.js.map +1 -1
  23. package/dist/auth.d.ts +2 -3
  24. package/dist/auth.d.ts.map +1 -1
  25. package/dist/auth.js +59 -270
  26. package/dist/auth.js.map +1 -1
  27. package/dist/cli.d.ts.map +1 -1
  28. package/dist/cli.js +14 -4
  29. package/dist/cli.js.map +1 -1
  30. package/dist/contract.js +7 -5
  31. package/dist/contract.js.map +1 -1
  32. package/dist/cost.d.ts +1 -0
  33. package/dist/cost.d.ts.map +1 -1
  34. package/dist/cost.js +23 -1
  35. package/dist/cost.js.map +1 -1
  36. package/dist/knowledge-base.d.ts.map +1 -1
  37. package/dist/knowledge-base.js +2 -1
  38. package/dist/knowledge-base.js.map +1 -1
  39. package/dist/multiscan.d.ts.map +1 -1
  40. package/dist/multiscan.js +1 -0
  41. package/dist/multiscan.js.map +1 -1
  42. package/dist/runtime.d.ts +9 -6
  43. package/dist/runtime.d.ts.map +1 -1
  44. package/dist/runtime.js +127 -284
  45. package/dist/runtime.js.map +1 -1
  46. package/dist/scan-comparison.js +1 -1
  47. package/dist/scan-comparison.js.map +1 -1
  48. package/dist/targets.d.ts +1 -0
  49. package/dist/targets.d.ts.map +1 -1
  50. package/dist/targets.js +22 -0
  51. package/dist/targets.js.map +1 -1
  52. package/dist/version.d.ts +1 -1
  53. package/dist/version.js +1 -1
  54. package/dist/version.js.map +1 -1
  55. package/package.json +2 -2
package/dist/cli.js CHANGED
@@ -80,6 +80,7 @@ const VALUE_OPTIONS = new Set([
80
80
  "--subagents",
81
81
  "--stop-after-no-new",
82
82
  "--max-discovery-runs",
83
+ "--max-time-hours",
83
84
  "--max-attempts",
84
85
  "--export-format",
85
86
  "--output",
@@ -131,6 +132,12 @@ const DEEP_SCAN_OPTION_SCHEMAS = {
131
132
  .positive()
132
133
  .optional()
133
134
  .describe("Maximum deep-scan discovery runs."),
135
+ maxTimeHours: z
136
+ .number()
137
+ .positive()
138
+ .max(96)
139
+ .optional()
140
+ .describe("Maximum deep-scan discovery hours (default: 96; maximum: 96)."),
134
141
  };
135
142
  async function readPromptFiles(directory, scanPromptFile, postScanPromptFile) {
136
143
  const [scanPrompt, postScanPrompt] = await Promise.all([
@@ -154,7 +161,7 @@ const DEFAULT_DEPENDENCIES = {
154
161
  hasStoredChatGPTSignIn: async () => {
155
162
  const environment = Object.fromEntries(Object.entries(process.env).filter(([name]) => name.toUpperCase() !== "OPENAI_API_KEY" &&
156
163
  name.toUpperCase() !== "CODEX_API_KEY"));
157
- const command = resolveCodexCommand();
164
+ const command = resolveCodexCommand(environment);
158
165
  if (existsSync(codexSecurityCredentialHome(process.env))) {
159
166
  const dedicatedStatus = await accountStatus(command, {
160
167
  ...environment,
@@ -181,7 +188,7 @@ const DEFAULT_DEPENDENCIES = {
181
188
  writeSync(stream.fd, value);
182
189
  },
183
190
  forceExit: (signal) => process.kill(process.pid, signal),
184
- runCodex: (args, output, environment) => runCodexSkillCommand(args, output, resolveCodexCommand(), environment),
191
+ runCodex: (args, output, environment) => runCodexSkillCommand(args, output, resolveCodexCommand(environment), environment),
185
192
  exportFindings: async (arguments_, output) => {
186
193
  const environment = exportEnvironment();
187
194
  const python = await resolvePluginPython({
@@ -261,7 +268,7 @@ export async function runCodexSkillCommand(args, output, command = resolveCodexC
261
268
  if (configuredHome?.trim()) {
262
269
  environment["CODEX_HOME"] = resolve(expandHome(configuredHome));
263
270
  }
264
- const invocation = spawn(command.command, [...command.prefixArgs, ...args], {
271
+ const invocation = spawn(command.command, [...args], {
265
272
  env: environment,
266
273
  cwd: parse(process.execPath).root,
267
274
  stdio: output === undefined ? "inherit" : ["ignore", "pipe", "pipe"],
@@ -855,7 +862,8 @@ export async function main(argv = process.argv.slice(2), output = process.stdout
855
862
  (options.workers === undefined &&
856
863
  options.subagents === undefined &&
857
864
  options.stopAfterNoNew === undefined &&
858
- options.maxDiscoveryRuns === undefined), { message: "Deep scan settings require --mode deep." }),
865
+ options.maxDiscoveryRuns === undefined &&
866
+ options.maxTimeHours === undefined), { message: "Deep scan settings require --mode deep." }),
859
867
  examples: [
860
868
  { args: { repository: "." } },
861
869
  { args: { repository: "." }, options: { model: "gpt-5.6-terra" } },
@@ -898,6 +906,7 @@ export async function main(argv = process.argv.slice(2), output = process.stdout
898
906
  subagents: options.subagents,
899
907
  stopAfterNoNew: options.stopAfterNoNew,
900
908
  maxDiscoveryRuns: options.maxDiscoveryRuns,
909
+ maxTimeHours: options.maxTimeHours,
901
910
  model: options.model,
902
911
  effort: options.effort,
903
912
  provider: options.provider,
@@ -2134,6 +2143,7 @@ async function runScan(arguments_, errorOutput, dependencies, interactive = true
2134
2143
  subagents: arguments_.subagents,
2135
2144
  stopAfterNoNew: arguments_.stopAfterNoNew,
2136
2145
  maxDiscoveryRuns: arguments_.maxDiscoveryRuns,
2146
+ maxTimeHours: arguments_.maxTimeHours,
2137
2147
  outputDir: arguments_.outputDir,
2138
2148
  archiveExisting: arguments_.archiveExisting,
2139
2149
  parentScanId: arguments_.parentScanId,