Skip to content

Commit 35de835

Browse files
committed
Launch Codex in YOLO mode by default
1 parent 9a0e37d commit 35de835

11 files changed

Lines changed: 88 additions & 41 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
version:
1010
description: Package version to build and validate without publishing
1111
required: true
12-
default: "0.2.2"
12+
default: "0.2.3"
1313
type: string
1414

1515
permissions:

‎AGENTS.md‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,15 @@ Unix:
161161

162162
Do not unify these paths through a generic shell command string. The command
163163
configuration intentionally rejects arbitrary shell expressions.
164-
Optional Claude and AGY dangerous-mode switches append only the fixed upstream
165-
`--dangerously-skip-permissions` argument. Unix and Windows `cmd` launches keep
166-
it as a distinct process argument. The Windows PowerShell wrapper must encode
167-
each fixed argument as an independently single-quoted literal with embedded
168-
quotes escaped. Never accept executable arguments from the browser API.
164+
Every Codex profile appends only the fixed upstream `--yolo` argument; this
165+
applies to the primary terminal, **New**, restarts, and dedicated peer
166+
reviewers, including executable overrides. Version probes remain exactly
167+
`codex --version`. Optional Claude and AGY dangerous-mode switches append only
168+
the fixed upstream `--dangerously-skip-permissions` argument. Unix and Windows
169+
`cmd` launches keep fixed arguments distinct. The Windows PowerShell wrapper
170+
must encode each fixed argument as an independently single-quoted literal with
171+
embedded quotes escaped. Never accept executable arguments from the browser
172+
API.
169173

170174
Agent auto-detection is also a platform boundary:
171175

‎OPERATIONS.md‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,13 @@ only the inherited nesting markers `CODEX_THREAD_ID` and `CLAUDECODE` before
440440
version checks and PTY startup; authentication and provider environment
441441
variables remain untouched.
442442

443+
Every Codex profile receives one fixed `--yolo` process argument. This applies
444+
to the primary terminal, **New**, restarts, and dedicated `@cwt` reviewers,
445+
including trusted executable overrides. It disables Codex approval prompts and
446+
sandboxing. The bounded discovery probe remains exactly `codex --version`.
447+
There is currently no server or browser opt-out, so custom Codex wrappers must
448+
accept or forward `--yolo`.
449+
443450
To deliberately auto-approve every tool action for both optional profiles:
444451

445452
```powershell
@@ -743,9 +750,10 @@ entry or closing its peer thread. Each entry has its own lifecycle, output
743750
replay buffer, and connected-client count; each running entry also owns a full
744751
agent process.
745752

746-
When a dangerous-mode switch is active, the card warns that approvals are
747-
disabled and the agent may edit files and run commands without asking for
748-
confirmation.
753+
The Codex card always warns that approvals are disabled because the server
754+
launches Codex with `--yolo`. Claude and AGY cards show the same warning when
755+
their dangerous-mode switch is active. Such agents may edit files and run
756+
commands without asking for confirmation.
749757

750758
### Connect / Reconnect
751759

‎README.md‎

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,12 @@ authentication. Codex Web Terminal neither copies nor reads agent credentials.
324324
Each child inherits the server account's environment and existing CLI
325325
configuration.
326326

327+
Every Codex terminal is launched as `codex --yolo`, including the primary
328+
terminal, **New**, restarts, and dedicated `@cwt` reviewers. This fixed mode
329+
disables Codex approval prompts and sandboxing. It is not used for the
330+
read-only `codex --version` discovery probe. Run Codex Web Terminal only under
331+
an operating-system account and on workspaces whose full access is acceptable.
332+
327333
The browser shows missing or misconfigured agents together with an official
328334
manual command and verification command. Run the command in a trusted terminal
329335
on the **server host**, then choose **Refresh** or **Check again**. There is
@@ -671,10 +677,12 @@ Command values are treated as executable names or file paths, not as arbitrary
671677
shell expressions. A discovered `.cmd` entry point is always invoked through
672678
`cmd.exe /d /s /c` on Windows, which is required for the npm Codex package. On
673679
Unix, the resolved executable is launched directly without a shell wrapper.
674-
The two permission switches add one fixed argument to the selected process.
675-
On Unix and Windows `cmd` launches it remains a distinct process argument. The
676-
Windows PowerShell wrapper encodes it as a single-quoted literal with embedded
677-
quotes escaped. It cannot be selected or altered by a browser client.
680+
Codex always receives the fixed `--yolo` argument. The two optional permission
681+
switches add the fixed upstream `--dangerously-skip-permissions` argument to
682+
Claude or AGY. On Unix and Windows `cmd` launches each remains a distinct
683+
process argument. The Windows PowerShell wrapper encodes each as a
684+
single-quoted literal with embedded quotes escaped. These arguments cannot be
685+
selected or altered by a browser client.
678686

679687
With auto-detection enabled (the default), the primary executable name follows
680688
`--primary-agent`, and the server probes `codex`, `claude`, and `agy` plus
@@ -702,8 +710,12 @@ paths are useful for services with a restricted `PATH`:
702710
--agy-command "$env:LOCALAPPDATA\agy\bin\agy.exe"
703711
```
704712

713+
Codex starts as `codex --yolo` without an additional server switch. This
714+
disables both Codex approvals and sandboxing for the primary session, **New**,
715+
restarts, and `@cwt` reviewers.
716+
705717
Add the following switches only in a trusted, isolated environment when every
706-
tool action should run without a permission prompt:
718+
Claude or AGY tool action should run without a permission prompt:
707719

708720
```text
709721
--claude-dangerously-skip-permissions
@@ -1036,11 +1048,13 @@ strip scrolls horizontally when it overflows; it does not send `/new` or
10361048

10371049
This process has the same operating-system permissions and environment as the
10381050
user who starts it. Anyone with the authenticated URL can interact with the
1039-
selected agent, approve actions it presents, and potentially cause commands to
1040-
run in any directory readable by that operating-system account. The same token
1041-
authorizes filesystem-root discovery, directory browsing, manual absolute-path
1042-
resolution, Favorites/Recent access, and PTY launch. `--project` is only the
1043-
default working directory; it is not a sandbox or an authorization boundary.
1051+
selected agent and potentially cause commands to run in any directory readable
1052+
by that operating-system account. Codex sessions always use `--yolo`, so Codex
1053+
approval prompts and sandboxing are disabled; Claude and AGY can be configured
1054+
similarly. The same token authorizes filesystem-root discovery, directory
1055+
browsing, manual absolute-path resolution, Favorites/Recent access, and PTY
1056+
launch. `--project` is only the default working directory; it is not a sandbox
1057+
or an authorization boundary.
10441058

10451059
Security measures in this application:
10461060

@@ -1330,6 +1344,8 @@ when available.
13301344
- Dedicated peer tabs isolate conversational context from ordinary tabs, but
13311345
are not an operating-system security boundary. All configured CLIs run as
13321346
the same server account.
1347+
- Every Codex session receives `--yolo`; Codex approvals and sandboxing are
1348+
therefore disabled. There is currently no server or browser opt-out.
13331349
- Agent CLIs must use their tool runner to call the loopback peer helper.
13341350
Provider policy, sandboxing, or a declined tool call can leave a supervised
13351351
turn waiting; terminal output is never parsed to infer completion.

‎SECURITY.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ operating-system account running the server. Successful launches also update
1515
Recent. The terminal process inherits that account's permissions and
1616
environment.
1717

18+
Every Codex process is launched with `--yolo`, which disables Codex approvals
19+
and sandboxing. This applies to the primary terminal, new and restarted
20+
sessions, and dedicated `@cwt` reviewers. There is currently no server or
21+
browser opt-out. Treat possession of the bearer token as authority to cause
22+
unprompted Codex actions with the full permissions of the server account.
23+
1824
All `/api/filesystem/*`, `/api/workspaces*`, and session endpoints require the
1925
same bearer token. Directory IDs preserve native Windows UTF-16 or Unix path
2026
bytes as an opaque API transport value. They are neither secret nor encrypted,

‎server/Cargo.lock‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎server/Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "codex-web-terminal"
3-
version = "0.2.2"
3+
version = "0.2.3"
44
edition = "2024"
55
rust-version = "1.88"
66
description = "Run Codex, Claude, and AGY CLIs in native PTYs from a browser"

‎server/src/agents.rs‎

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -227,17 +227,20 @@ fn agent_command_override(config: &Config, agent: AgentKind) -> Option<String> {
227227

228228
fn dangerously_skip_permissions(config: &Config, agent: AgentKind) -> bool {
229229
match agent {
230-
AgentKind::Codex => false,
230+
AgentKind::Codex => true,
231231
AgentKind::Claude => config.claude_dangerously_skip_permissions,
232232
AgentKind::Agy => config.agy_dangerously_skip_permissions,
233233
}
234234
}
235235

236236
fn agent_arguments(config: &Config, agent: AgentKind) -> Vec<String> {
237-
dangerously_skip_permissions(config, agent)
238-
.then(|| "--dangerously-skip-permissions".to_owned())
239-
.into_iter()
240-
.collect()
237+
match agent {
238+
AgentKind::Codex => vec!["--yolo".to_owned()],
239+
AgentKind::Claude | AgentKind::Agy => dangerously_skip_permissions(config, agent)
240+
.then(|| "--dangerously-skip-permissions".to_owned())
241+
.into_iter()
242+
.collect(),
243+
}
241244
}
242245

243246
const fn default_command(agent: AgentKind) -> &'static str {
@@ -412,6 +415,7 @@ mod tests {
412415
.expect("Codex profile");
413416

414417
assert_eq!(codex.command, "trusted-codex-wrapper");
418+
assert_eq!(codex.arguments, ["--yolo"]);
415419
}
416420

417421
#[test]
@@ -422,7 +426,8 @@ mod tests {
422426

423427
let profiles = build_agent_profiles(&config);
424428

425-
assert!(profiles.primary.arguments.is_empty());
429+
assert_eq!(profiles.primary.arguments, ["--yolo"]);
430+
assert_eq!(profiles.new_session.arguments, ["--yolo"]);
426431
assert_eq!(
427432
profiles
428433
.additional
@@ -432,6 +437,15 @@ mod tests {
432437
.arguments,
433438
["--dangerously-skip-permissions"]
434439
);
440+
assert_eq!(
441+
profiles
442+
.additional
443+
.iter()
444+
.find(|profile| profile.agent == AgentKind::Agy)
445+
.expect("AGY profile")
446+
.arguments,
447+
["--dangerously-skip-permissions"]
448+
);
435449
}
436450

437451
#[test]
@@ -457,7 +471,7 @@ mod tests {
457471
shell: ShellKind::Powershell,
458472
},
459473
explicit_override: true,
460-
dangerously_skip_permissions: false,
474+
dangerously_skip_permissions: true,
461475
};
462476
let catalog = AgentCatalog {
463477
profiles: Arc::new(vec![profile]),
@@ -475,7 +489,7 @@ mod tests {
475489
assert_eq!(agent["state"], "ready");
476490
assert_eq!(agent["configuration"], "override");
477491
assert_eq!(agent["version"], "9.8.7");
478-
assert_eq!(agent["dangerouslySkipPermissions"], false);
492+
assert_eq!(agent["dangerouslySkipPermissions"], true);
479493
assert_eq!(agent["install"]["verifyCommand"], "codex --version");
480494
assert_eq!(agent["install"]["requiresServerAccess"], true);
481495
assert!(agent.get("path").is_none());

‎server/src/terminal.rs‎

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -897,14 +897,14 @@ mod tests {
897897
#[test]
898898
fn passes_fixed_arguments_to_an_executable_through_powershell() {
899899
let resolved = ResolvedCommand {
900-
path: PathBuf::from(r"C:\Program Files\Claude\claude.exe"),
900+
path: PathBuf::from(r"C:\Program Files\Codex\codex.exe"),
901901
is_batch_file: false,
902902
};
903903
let config = TerminalConfig {
904904
project_dir: PathBuf::from(r"C:\project"),
905905
command: "ignored".to_owned(),
906-
arguments: vec!["--dangerously-skip-permissions".to_owned()],
907-
agent: AgentKind::Claude,
906+
arguments: vec!["--yolo".to_owned()],
907+
agent: AgentKind::Codex,
908908
shell: ShellKind::Powershell,
909909
};
910910

@@ -914,8 +914,7 @@ mod tests {
914914
"-NoLogo".into(),
915915
"-NoProfile".into(),
916916
"-Command".into(),
917-
"& 'C:\\Program Files\\Claude\\claude.exe' '--dangerously-skip-permissions'; exit $LASTEXITCODE"
918-
.into(),
917+
"& 'C:\\Program Files\\Codex\\codex.exe' '--yolo'; exit $LASTEXITCODE".into(),
919918
];
920919

921920
assert_eq!(command.get_argv(), &expected);
@@ -1041,15 +1040,15 @@ mod unix_tests {
10411040
let config = TerminalConfig {
10421041
project_dir: PathBuf::from("/tmp/codex-web-project"),
10431042
command: "ignored".to_owned(),
1044-
arguments: vec!["--dangerously-skip-permissions".to_owned()],
1043+
arguments: vec!["--yolo".to_owned()],
10451044
agent: AgentKind::Codex,
10461045
shell: ShellKind::Powershell,
10471046
};
10481047

10491048
let command = pty_command(&config, &resolved);
10501049
let expected = vec![
10511050
resolved.path.clone().into_os_string(),
1052-
"--dangerously-skip-permissions".into(),
1051+
"--yolo".into(),
10531052
];
10541053

10551054
assert_eq!(
@@ -1068,7 +1067,7 @@ mod unix_tests {
10681067
let command_path = directory.path().join("fake-codex");
10691068
std::fs::write(
10701069
&command_path,
1071-
"#!/bin/sh\nif [ \"$1\" = \"--version\" ]; then\n echo 'codex-cli 1.0.0'\n exit 0\nfi\n[ \"$1\" = \"--dangerously-skip-permissions\" ]\n",
1070+
"#!/bin/sh\nif [ \"$1\" = \"--version\" ]; then\n [ -z \"$2\" ] || exit 9\n echo 'codex-cli 1.0.0'\n exit 0\nfi\n[ \"$1\" = \"--yolo\" ]\n",
10721071
)
10731072
.expect("write fake Codex command");
10741073

@@ -1081,7 +1080,7 @@ mod unix_tests {
10811080
let config = TerminalConfig {
10821081
project_dir: directory.path().to_path_buf(),
10831082
command: command_path.to_string_lossy().into_owned(),
1084-
arguments: vec!["--dangerously-skip-permissions".to_owned()],
1083+
arguments: vec!["--yolo".to_owned()],
10851084
agent: AgentKind::Codex,
10861085
shell: ShellKind::Powershell,
10871086
};

‎web/package-lock.json‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)