@xuda.io/ai_module 1.1.5643 → 1.1.5644

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 (2) hide show
  1. package/index.mjs +22 -2
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -253,7 +253,19 @@ const get_openai_codex_exec_args = function (codex_model, opts = {}) {
253
253
  // end-user prompts can't run Codex with full host access. The studio/vibe flow
254
254
  // passes nothing and keeps the global setting.
255
255
  const sandbox = opts.sandbox || _conf.openai_codex_sandbox;
256
- const bypass_approvals_and_sandbox = opts.sandbox ? false : typeof _conf.openai_codex_bypass_approvals_and_sandbox === 'undefined' ? true : _conf.openai_codex_bypass_approvals_and_sandbox;
256
+ // Precedence: an explicit per-call sandbox always confines the run; opts.bypass_sandbox is
257
+ // the one deliberate escape hatch (the customer-VPS vibe build, which runs on the
258
+ // customer's OWN box and needs to install and restart things there); otherwise the config
259
+ // decides. The config default is now false, so a new call site that forgets to say
260
+ // anything gets a CONFINED run instead of full host access, which is how the mentor Codex
261
+ // tool ended up unsandboxed.
262
+ const bypass_approvals_and_sandbox = opts.sandbox
263
+ ? false
264
+ : opts.bypass_sandbox === true
265
+ ? true
266
+ : typeof _conf.openai_codex_bypass_approvals_and_sandbox === 'undefined'
267
+ ? true
268
+ : _conf.openai_codex_bypass_approvals_and_sandbox;
257
269
 
258
270
  if (codex_model) {
259
271
  // codex_model is a catalog code (user pick or cheapest default); the Codex CLI
@@ -1386,6 +1398,9 @@ export const execute_codex_request = async function (req_or_ip, prompt_arg, atta
1386
1398
  // Optional per-call hardening (used by the AI site generator for untrusted
1387
1399
  // prompts): a confined sandbox + a hard wall-clock timeout on the codex run.
1388
1400
  const sandbox = is_req_call ? req_or_ip.sandbox : undefined;
1401
+ // Explicit opt-out of the confined default, for runs that legitimately need full access
1402
+ // on a box the customer owns. Never set this for anything running on Xuda infrastructure.
1403
+ const bypass_sandbox = is_req_call ? req_or_ip.bypass_sandbox === true : false;
1389
1404
  const codex_timeout = is_req_call ? req_or_ip.codex_timeout : undefined;
1390
1405
  // Optional: a scoped MCP server exposed to codex (the in-app vibe's Xuda
1391
1406
  // platform actions). { url, bearer_env_var, bearer_value } — the bearer is
@@ -1594,7 +1609,7 @@ ${prompt}`;
1594
1609
  }
1595
1610
 
1596
1611
  const openai_codex_command = get_openai_codex_cli_command();
1597
- let codex_args = get_openai_codex_exec_args(codex_model, { sandbox });
1612
+ let codex_args = get_openai_codex_exec_args(codex_model, { sandbox, bypass_sandbox });
1598
1613
  if (agent_mcp && agent_mcp.url) {
1599
1614
  // Register the Xuda MCP server for this run. Global `-c` overrides must
1600
1615
  // precede the `exec` subcommand (args[0]), so prepend them. The bearer
@@ -7037,6 +7052,11 @@ ${conversation_history || `User (dashboard): ${prompt}`}
7037
7052
  prompt: codex_prompt,
7038
7053
  attachments,
7039
7054
  stream: false,
7055
+ // Deliberate: this build runs on the CUSTOMER'S OWN VPS over SSH and has to install
7056
+ // packages, write outside a workspace and restart services there, so it keeps full
7057
+ // access. Stated explicitly now that the global default is confined, so the choice
7058
+ // is visible instead of inherited. Nothing on Xuda infrastructure may set this.
7059
+ bypass_sandbox: true,
7040
7060
  ...(agent_key ? { agent_mcp: { url: 'http://localhost:3012/mcp', bearer_env_var: 'XUDA_AGENT_KEY', bearer_value: agent_key } } : {}),
7041
7061
  },
7042
7062
  job_id,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.5643",
3
+ "version": "1.1.5644",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",