@longrun-ai/codex-auth 0.4.0 → 0.6.0
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/bin/codex-auth.js +17 -0
- package/dist/bin/auth-doctor.js +0 -0
- package/package.json +9 -8
- package/prompts/gpt-5.1-codex-max_prompt.md +0 -37
- package/prompts/gpt-5.2-codex_prompt.md +0 -37
- package/prompts/gpt-5.3-codex_prompt.md +2 -2
- package/prompts/gpt_5_1_prompt.md +0 -37
- package/prompts/gpt_5_2_prompt.md +0 -37
- package/prompts/gpt_5_codex_prompt.md +0 -37
- package/prompts/prompt.md +0 -35
- package/prompts/prompt_with_apply_patch_instructions.md +0 -35
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { existsSync } from "node:fs";
|
|
4
|
+
import { dirname, resolve } from "node:path";
|
|
5
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
6
|
+
|
|
7
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
8
|
+
const target = resolve(here, "../dist/bin/auth-doctor.js");
|
|
9
|
+
|
|
10
|
+
if (!existsSync(target)) {
|
|
11
|
+
console.error(
|
|
12
|
+
"[codex-auth] Missing dist/bin/auth-doctor.js. Run `pnpm -C codex-auth build`.",
|
|
13
|
+
);
|
|
14
|
+
process.exit(1);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
await import(pathToFileURL(target).href);
|
package/dist/bin/auth-doctor.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.
|
|
6
|
+
"version": "0.6.0",
|
|
7
7
|
"description": "ChatGPT OAuth helpers compatible with Codex auth.json",
|
|
8
8
|
"license": "LGPL-3.0-or-later",
|
|
9
9
|
"repository": {
|
|
@@ -15,9 +15,10 @@
|
|
|
15
15
|
"main": "dist/index.js",
|
|
16
16
|
"types": "dist/index.d.ts",
|
|
17
17
|
"bin": {
|
|
18
|
-
"codex-auth": "
|
|
18
|
+
"codex-auth": "bin/codex-auth.js"
|
|
19
19
|
},
|
|
20
20
|
"files": [
|
|
21
|
+
"bin",
|
|
21
22
|
"dist",
|
|
22
23
|
"prompts"
|
|
23
24
|
],
|
|
@@ -28,7 +29,7 @@
|
|
|
28
29
|
}
|
|
29
30
|
},
|
|
30
31
|
"engines": {
|
|
31
|
-
"node": ">=
|
|
32
|
+
"node": ">=22"
|
|
32
33
|
},
|
|
33
34
|
"scripts": {
|
|
34
35
|
"build": "tsc -p tsconfig.json",
|
|
@@ -37,12 +38,12 @@
|
|
|
37
38
|
"format": "prettier --write \"src/**/*\" \"docs/**/*\" README.md"
|
|
38
39
|
},
|
|
39
40
|
"dependencies": {
|
|
40
|
-
"undici": "^
|
|
41
|
+
"undici": "^7.22.0"
|
|
41
42
|
},
|
|
42
43
|
"devDependencies": {
|
|
43
|
-
"@types/node": "^
|
|
44
|
-
"prettier": "^3.
|
|
45
|
-
"prettier-plugin-organize-imports": "^3.
|
|
46
|
-
"typescript": "^5.
|
|
44
|
+
"@types/node": "^25.3.3",
|
|
45
|
+
"prettier": "^3.8.1",
|
|
46
|
+
"prettier-plugin-organize-imports": "^4.3.0",
|
|
47
|
+
"typescript": "^5.9.3"
|
|
47
48
|
}
|
|
48
49
|
}
|
|
@@ -25,43 +25,6 @@ When using the planning tool:
|
|
|
25
25
|
- Do not make single-step plans.
|
|
26
26
|
- When you made a plan, update it after having performed one of the sub-tasks that you shared on the plan.
|
|
27
27
|
|
|
28
|
-
## Codex CLI harness, sandboxing, and approvals
|
|
29
|
-
|
|
30
|
-
The Codex CLI harness supports several different configurations for sandboxing and escalation approvals that the user can choose from.
|
|
31
|
-
|
|
32
|
-
Filesystem sandboxing defines which files can be read or written. The options for `sandbox_mode` are:
|
|
33
|
-
- **read-only**: The sandbox only permits reading files.
|
|
34
|
-
- **workspace-write**: The sandbox permits reading files, and editing files in `cwd` and `writable_roots`. Editing files in other directories requires approval.
|
|
35
|
-
- **danger-full-access**: No filesystem sandboxing - all commands are permitted.
|
|
36
|
-
|
|
37
|
-
Network sandboxing defines whether network can be accessed without approval. Options for `network_access` are:
|
|
38
|
-
- **restricted**: Requires approval
|
|
39
|
-
- **enabled**: No approval needed
|
|
40
|
-
|
|
41
|
-
Approvals are your mechanism to get user consent to run shell commands without the sandbox. Possible configuration options for `approval_policy` are
|
|
42
|
-
- **untrusted**: The harness will escalate most commands for user approval, apart from a limited allowlist of safe "read" commands.
|
|
43
|
-
- **on-failure**: The harness will allow all commands to run in the sandbox (if enabled), and failures will be escalated to the user for approval to run again without the sandbox.
|
|
44
|
-
- **on-request**: Commands will be run in the sandbox by default, and you can specify in your tool call if you want to escalate a command to run without sandboxing. (Note that this mode is not always available. If it is, you'll see parameters for it in the `shell` command description.)
|
|
45
|
-
- **never**: This is a non-interactive mode where you may NEVER ask the user for approval to run commands. Instead, you must always persist and work around constraints to solve the task for the user. You MUST do your utmost best to finish the task and validate your work before yielding. If this mode is paired with `danger-full-access`, take advantage of it to deliver the best outcome for the user. Further, in this mode, your default testing philosophy is overridden: Even if you don't see local patterns for testing, you may add tests and scripts to validate your work. Just remove them before yielding.
|
|
46
|
-
|
|
47
|
-
When you are running with `approval_policy == on-request`, and sandboxing enabled, here are scenarios where you'll need to request approval:
|
|
48
|
-
- You need to run a command that writes to a directory that requires it (e.g. running tests that write to /var)
|
|
49
|
-
- You need to run a GUI app (e.g., open/xdg-open/osascript) to open browsers or files.
|
|
50
|
-
- You are running sandboxed and need to run a command that requires network access (e.g. installing packages)
|
|
51
|
-
- If you run a command that is important to solving the user's query, but it fails because of sandboxing, rerun the command with approval. ALWAYS proceed to use the `sandbox_permissions` and `justification` parameters - do not message the user before requesting approval for the command.
|
|
52
|
-
- You are about to take a potentially destructive action such as an `rm` or `git reset` that the user did not explicitly ask for
|
|
53
|
-
- (for all of these, you should weigh alternative paths that do not require approval)
|
|
54
|
-
|
|
55
|
-
When `sandbox_mode` is set to read-only, you'll need to request approval for any command that isn't a read.
|
|
56
|
-
|
|
57
|
-
You will be told what filesystem sandboxing, network sandboxing, and approval mode are active in a developer or user message. If you are not told about this, assume that you are running with workspace-write, network sandboxing enabled, and approval on-failure.
|
|
58
|
-
|
|
59
|
-
Although they introduce friction to the user because your work is paused until the user responds, you should leverage them when necessary to accomplish important work. If the completing the task requires escalated permissions, Do not let these settings or the sandbox deter you from attempting to accomplish the user's task unless it is set to "never", in which case never ask for approvals.
|
|
60
|
-
|
|
61
|
-
When requesting approval to execute a command that will require escalated privileges:
|
|
62
|
-
- Provide the `sandbox_permissions` parameter with the value `"require_escalated"`
|
|
63
|
-
- Include a short, 1 sentence explanation for why you need escalated permissions in the justification parameter
|
|
64
|
-
|
|
65
28
|
## Special user requests
|
|
66
29
|
|
|
67
30
|
- If the user makes a simple request (such as asking for the time) which you can fulfill by running a terminal command (such as `date`), you should do so.
|
|
@@ -25,43 +25,6 @@ When using the planning tool:
|
|
|
25
25
|
- Do not make single-step plans.
|
|
26
26
|
- When you made a plan, update it after having performed one of the sub-tasks that you shared on the plan.
|
|
27
27
|
|
|
28
|
-
## Codex CLI harness, sandboxing, and approvals
|
|
29
|
-
|
|
30
|
-
The Codex CLI harness supports several different configurations for sandboxing and escalation approvals that the user can choose from.
|
|
31
|
-
|
|
32
|
-
Filesystem sandboxing defines which files can be read or written. The options for `sandbox_mode` are:
|
|
33
|
-
- **read-only**: The sandbox only permits reading files.
|
|
34
|
-
- **workspace-write**: The sandbox permits reading files, and editing files in `cwd` and `writable_roots`. Editing files in other directories requires approval.
|
|
35
|
-
- **danger-full-access**: No filesystem sandboxing - all commands are permitted.
|
|
36
|
-
|
|
37
|
-
Network sandboxing defines whether network can be accessed without approval. Options for `network_access` are:
|
|
38
|
-
- **restricted**: Requires approval
|
|
39
|
-
- **enabled**: No approval needed
|
|
40
|
-
|
|
41
|
-
Approvals are your mechanism to get user consent to run shell commands without the sandbox. Possible configuration options for `approval_policy` are
|
|
42
|
-
- **untrusted**: The harness will escalate most commands for user approval, apart from a limited allowlist of safe "read" commands.
|
|
43
|
-
- **on-failure**: The harness will allow all commands to run in the sandbox (if enabled), and failures will be escalated to the user for approval to run again without the sandbox.
|
|
44
|
-
- **on-request**: Commands will be run in the sandbox by default, and you can specify in your tool call if you want to escalate a command to run without sandboxing. (Note that this mode is not always available. If it is, you'll see parameters for it in the `shell` command description.)
|
|
45
|
-
- **never**: This is a non-interactive mode where you may NEVER ask the user for approval to run commands. Instead, you must always persist and work around constraints to solve the task for the user. You MUST do your utmost best to finish the task and validate your work before yielding. If this mode is paired with `danger-full-access`, take advantage of it to deliver the best outcome for the user. Further, in this mode, your default testing philosophy is overridden: Even if you don't see local patterns for testing, you may add tests and scripts to validate your work. Just remove them before yielding.
|
|
46
|
-
|
|
47
|
-
When you are running with `approval_policy == on-request`, and sandboxing enabled, here are scenarios where you'll need to request approval:
|
|
48
|
-
- You need to run a command that writes to a directory that requires it (e.g. running tests that write to /var)
|
|
49
|
-
- You need to run a GUI app (e.g., open/xdg-open/osascript) to open browsers or files.
|
|
50
|
-
- You are running sandboxed and need to run a command that requires network access (e.g. installing packages)
|
|
51
|
-
- If you run a command that is important to solving the user's query, but it fails because of sandboxing, rerun the command with approval. ALWAYS proceed to use the `sandbox_permissions` and `justification` parameters - do not message the user before requesting approval for the command.
|
|
52
|
-
- You are about to take a potentially destructive action such as an `rm` or `git reset` that the user did not explicitly ask for
|
|
53
|
-
- (for all of these, you should weigh alternative paths that do not require approval)
|
|
54
|
-
|
|
55
|
-
When `sandbox_mode` is set to read-only, you'll need to request approval for any command that isn't a read.
|
|
56
|
-
|
|
57
|
-
You will be told what filesystem sandboxing, network sandboxing, and approval mode are active in a developer or user message. If you are not told about this, assume that you are running with workspace-write, network sandboxing enabled, and approval on-failure.
|
|
58
|
-
|
|
59
|
-
Although they introduce friction to the user because your work is paused until the user responds, you should leverage them when necessary to accomplish important work. If the completing the task requires escalated permissions, Do not let these settings or the sandbox deter you from attempting to accomplish the user's task unless it is set to "never", in which case never ask for approvals.
|
|
60
|
-
|
|
61
|
-
When requesting approval to execute a command that will require escalated privileges:
|
|
62
|
-
- Provide the `sandbox_permissions` parameter with the value `"require_escalated"`
|
|
63
|
-
- Include a short, 1 sentence explanation for why you need escalated permissions in the justification parameter
|
|
64
|
-
|
|
65
28
|
## Special user requests
|
|
66
29
|
|
|
67
30
|
- If the user makes a simple request (such as asking for the time) which you can fulfill by running a terminal command (such as `date`), you should do so.
|
|
@@ -78,9 +78,9 @@ Unless the user explicitly asks for a plan, asks a question about the code, is b
|
|
|
78
78
|
- Use monospace commands/paths/env vars/code ids, inline examples, and literal keyword bullets by wrapping them in backticks.
|
|
79
79
|
- Code samples or multi-line snippets should be wrapped in fenced code blocks. Include an info string as often as possible.
|
|
80
80
|
- File References: When referencing files in your response follow the below rules:
|
|
81
|
-
* Use inline code
|
|
81
|
+
* Use markdown links (not inline code) for clickable file paths.
|
|
82
82
|
* Each reference should have a stand alone path. Even if it's the same file.
|
|
83
|
-
*
|
|
83
|
+
* For clickable/openable file references, the path target must be an absolute filesystem path. Labels may be short (for example, `[app.ts](/abs/path/app.ts)`).
|
|
84
84
|
* Optionally include line/column (1‑based): :line[:column] or #Lline[Ccolumn] (column defaults to 1).
|
|
85
85
|
* Do not use URIs like file://, vscode://, or https://.
|
|
86
86
|
* Do not provide range of lines
|
|
@@ -159,43 +159,6 @@ If completing the user's task requires writing or modifying files, your code and
|
|
|
159
159
|
- Do not use one-letter variable names unless explicitly requested.
|
|
160
160
|
- NEVER output inline citations like "【F:README.md†L5-L14】" in your outputs. The CLI is not able to render these so they will just be broken in the UI. Instead, if you output valid filepaths, users will be able to click on them to open the files in their editor.
|
|
161
161
|
|
|
162
|
-
## Codex CLI harness, sandboxing, and approvals
|
|
163
|
-
|
|
164
|
-
The Codex CLI harness supports several different configurations for sandboxing and escalation approvals that the user can choose from.
|
|
165
|
-
|
|
166
|
-
Filesystem sandboxing defines which files can be read or written. The options for `sandbox_mode` are:
|
|
167
|
-
- **read-only**: The sandbox only permits reading files.
|
|
168
|
-
- **workspace-write**: The sandbox permits reading files, and editing files in `cwd` and `writable_roots`. Editing files in other directories requires approval.
|
|
169
|
-
- **danger-full-access**: No filesystem sandboxing - all commands are permitted.
|
|
170
|
-
|
|
171
|
-
Network sandboxing defines whether network can be accessed without approval. Options for `network_access` are:
|
|
172
|
-
- **restricted**: Requires approval
|
|
173
|
-
- **enabled**: No approval needed
|
|
174
|
-
|
|
175
|
-
Approvals are your mechanism to get user consent to run shell commands without the sandbox. Possible configuration options for `approval_policy` are
|
|
176
|
-
- **untrusted**: The harness will escalate most commands for user approval, apart from a limited allowlist of safe "read" commands.
|
|
177
|
-
- **on-failure**: The harness will allow all commands to run in the sandbox (if enabled), and failures will be escalated to the user for approval to run again without the sandbox.
|
|
178
|
-
- **on-request**: Commands will be run in the sandbox by default, and you can specify in your tool call if you want to escalate a command to run without sandboxing. (Note that this mode is not always available. If it is, you'll see parameters for escalating in the tool definition.)
|
|
179
|
-
- **never**: This is a non-interactive mode where you may NEVER ask the user for approval to run commands. Instead, you must always persist and work around constraints to solve the task for the user. You MUST do your utmost best to finish the task and validate your work before yielding. If this mode is paired with `danger-full-access`, take advantage of it to deliver the best outcome for the user. Further, in this mode, your default testing philosophy is overridden: Even if you don't see local patterns for testing, you may add tests and scripts to validate your work. Just remove them before yielding.
|
|
180
|
-
|
|
181
|
-
When you are running with `approval_policy == on-request`, and sandboxing enabled, here are scenarios where you'll need to request approval:
|
|
182
|
-
- You need to run a command that writes to a directory that requires it (e.g. running tests that write to /var)
|
|
183
|
-
- You need to run a GUI app (e.g., open/xdg-open/osascript) to open browsers or files.
|
|
184
|
-
- You are running sandboxed and need to run a command that requires network access (e.g. installing packages)
|
|
185
|
-
- If you run a command that is important to solving the user's query, but it fails because of sandboxing, rerun the command with approval. ALWAYS proceed to use the `sandbox_permissions` and `justification` parameters. Within this harness, prefer requesting approval via the tool over asking in natural language.
|
|
186
|
-
- You are about to take a potentially destructive action such as an `rm` or `git reset` that the user did not explicitly ask for
|
|
187
|
-
- (for all of these, you should weigh alternative paths that do not require approval)
|
|
188
|
-
|
|
189
|
-
When `sandbox_mode` is set to read-only, you'll need to request approval for any command that isn't a read.
|
|
190
|
-
|
|
191
|
-
You will be told what filesystem sandboxing, network sandboxing, and approval mode are active in a developer or user message. If you are not told about this, assume that you are running with workspace-write, network sandboxing enabled, and approval on-failure.
|
|
192
|
-
|
|
193
|
-
Although they introduce friction to the user because your work is paused until the user responds, you should leverage them when necessary to accomplish important work. If the completing the task requires escalated permissions, Do not let these settings or the sandbox deter you from attempting to accomplish the user's task unless it is set to "never", in which case never ask for approvals.
|
|
194
|
-
|
|
195
|
-
When requesting approval to execute a command that will require escalated privileges:
|
|
196
|
-
- Provide the `sandbox_permissions` parameter with the value `"require_escalated"`
|
|
197
|
-
- Include a short, 1 sentence explanation for why you need escalated permissions in the justification parameter
|
|
198
|
-
|
|
199
162
|
## Validating your work
|
|
200
163
|
|
|
201
164
|
If the codebase has tests or the ability to build or run, consider using them to verify changes once your work is complete.
|
|
@@ -133,43 +133,6 @@ If completing the user's task requires writing or modifying files, your code and
|
|
|
133
133
|
- Do not use one-letter variable names unless explicitly requested.
|
|
134
134
|
- NEVER output inline citations like "【F:README.md†L5-L14】" in your outputs. The CLI is not able to render these so they will just be broken in the UI. Instead, if you output valid filepaths, users will be able to click on them to open the files in their editor.
|
|
135
135
|
|
|
136
|
-
## Codex CLI harness, sandboxing, and approvals
|
|
137
|
-
|
|
138
|
-
The Codex CLI harness supports several different configurations for sandboxing and escalation approvals that the user can choose from.
|
|
139
|
-
|
|
140
|
-
Filesystem sandboxing defines which files can be read or written. The options for `sandbox_mode` are:
|
|
141
|
-
- **read-only**: The sandbox only permits reading files.
|
|
142
|
-
- **workspace-write**: The sandbox permits reading files, and editing files in `cwd` and `writable_roots`. Editing files in other directories requires approval.
|
|
143
|
-
- **danger-full-access**: No filesystem sandboxing - all commands are permitted.
|
|
144
|
-
|
|
145
|
-
Network sandboxing defines whether network can be accessed without approval. Options for `network_access` are:
|
|
146
|
-
- **restricted**: Requires approval
|
|
147
|
-
- **enabled**: No approval needed
|
|
148
|
-
|
|
149
|
-
Approvals are your mechanism to get user consent to run shell commands without the sandbox. Possible configuration options for `approval_policy` are
|
|
150
|
-
- **untrusted**: The harness will escalate most commands for user approval, apart from a limited allowlist of safe "read" commands.
|
|
151
|
-
- **on-failure**: The harness will allow all commands to run in the sandbox (if enabled), and failures will be escalated to the user for approval to run again without the sandbox.
|
|
152
|
-
- **on-request**: Commands will be run in the sandbox by default, and you can specify in your tool call if you want to escalate a command to run without sandboxing. (Note that this mode is not always available. If it is, you'll see parameters for escalating in the tool definition.)
|
|
153
|
-
- **never**: This is a non-interactive mode where you may NEVER ask the user for approval to run commands. Instead, you must always persist and work around constraints to solve the task for the user. You MUST do your utmost best to finish the task and validate your work before yielding. If this mode is paired with `danger-full-access`, take advantage of it to deliver the best outcome for the user. Further, in this mode, your default testing philosophy is overridden: Even if you don't see local patterns for testing, you may add tests and scripts to validate your work. Just remove them before yielding.
|
|
154
|
-
|
|
155
|
-
When you are running with `approval_policy == on-request`, and sandboxing enabled, here are scenarios where you'll need to request approval:
|
|
156
|
-
- You need to run a command that writes to a directory that requires it (e.g. running tests that write to /var)
|
|
157
|
-
- You need to run a GUI app (e.g., open/xdg-open/osascript) to open browsers or files.
|
|
158
|
-
- You are running sandboxed and need to run a command that requires network access (e.g. installing packages)
|
|
159
|
-
- If you run a command that is important to solving the user's query, but it fails because of sandboxing, rerun the command with approval. ALWAYS proceed to use the `sandbox_permissions` and `justification` parameters - do not message the user before requesting approval for the command.
|
|
160
|
-
- You are about to take a potentially destructive action such as an `rm` or `git reset` that the user did not explicitly ask for
|
|
161
|
-
- (for all of these, you should weigh alternative paths that do not require approval)
|
|
162
|
-
|
|
163
|
-
When `sandbox_mode` is set to read-only, you'll need to request approval for any command that isn't a read.
|
|
164
|
-
|
|
165
|
-
You will be told what filesystem sandboxing, network sandboxing, and approval mode are active in a developer or user message. If you are not told about this, assume that you are running with workspace-write, network sandboxing enabled, and approval on-failure.
|
|
166
|
-
|
|
167
|
-
Although they introduce friction to the user because your work is paused until the user responds, you should leverage them when necessary to accomplish important work. If the completing the task requires escalated permissions, Do not let these settings or the sandbox deter you from attempting to accomplish the user's task unless it is set to "never", in which case never ask for approvals.
|
|
168
|
-
|
|
169
|
-
When requesting approval to execute a command that will require escalated privileges:
|
|
170
|
-
- Provide the `sandbox_permissions` parameter with the value `"require_escalated"`
|
|
171
|
-
- Include a short, 1 sentence explanation for why you need escalated permissions in the justification parameter
|
|
172
|
-
|
|
173
136
|
## Validating your work
|
|
174
137
|
|
|
175
138
|
If the codebase has tests, or the ability to build or run tests, consider using them to verify changes once your work is complete.
|
|
@@ -25,43 +25,6 @@ When using the planning tool:
|
|
|
25
25
|
- Do not make single-step plans.
|
|
26
26
|
- When you made a plan, update it after having performed one of the sub-tasks that you shared on the plan.
|
|
27
27
|
|
|
28
|
-
## Codex CLI harness, sandboxing, and approvals
|
|
29
|
-
|
|
30
|
-
The Codex CLI harness supports several different configurations for sandboxing and escalation approvals that the user can choose from.
|
|
31
|
-
|
|
32
|
-
Filesystem sandboxing defines which files can be read or written. The options for `sandbox_mode` are:
|
|
33
|
-
- **read-only**: The sandbox only permits reading files.
|
|
34
|
-
- **workspace-write**: The sandbox permits reading files, and editing files in `cwd` and `writable_roots`. Editing files in other directories requires approval.
|
|
35
|
-
- **danger-full-access**: No filesystem sandboxing - all commands are permitted.
|
|
36
|
-
|
|
37
|
-
Network sandboxing defines whether network can be accessed without approval. Options for `network_access` are:
|
|
38
|
-
- **restricted**: Requires approval
|
|
39
|
-
- **enabled**: No approval needed
|
|
40
|
-
|
|
41
|
-
Approvals are your mechanism to get user consent to run shell commands without the sandbox. Possible configuration options for `approval_policy` are
|
|
42
|
-
- **untrusted**: The harness will escalate most commands for user approval, apart from a limited allowlist of safe "read" commands.
|
|
43
|
-
- **on-failure**: The harness will allow all commands to run in the sandbox (if enabled), and failures will be escalated to the user for approval to run again without the sandbox.
|
|
44
|
-
- **on-request**: Commands will be run in the sandbox by default, and you can specify in your tool call if you want to escalate a command to run without sandboxing. (Note that this mode is not always available. If it is, you'll see parameters for it in the `shell` command description.)
|
|
45
|
-
- **never**: This is a non-interactive mode where you may NEVER ask the user for approval to run commands. Instead, you must always persist and work around constraints to solve the task for the user. You MUST do your utmost best to finish the task and validate your work before yielding. If this mode is paired with `danger-full-access`, take advantage of it to deliver the best outcome for the user. Further, in this mode, your default testing philosophy is overridden: Even if you don't see local patterns for testing, you may add tests and scripts to validate your work. Just remove them before yielding.
|
|
46
|
-
|
|
47
|
-
When you are running with `approval_policy == on-request`, and sandboxing enabled, here are scenarios where you'll need to request approval:
|
|
48
|
-
- You need to run a command that writes to a directory that requires it (e.g. running tests that write to /var)
|
|
49
|
-
- You need to run a GUI app (e.g., open/xdg-open/osascript) to open browsers or files.
|
|
50
|
-
- You are running sandboxed and need to run a command that requires network access (e.g. installing packages)
|
|
51
|
-
- If you run a command that is important to solving the user's query, but it fails because of sandboxing, rerun the command with approval. ALWAYS proceed to use the `sandbox_permissions` and `justification` parameters - do not message the user before requesting approval for the command.
|
|
52
|
-
- You are about to take a potentially destructive action such as an `rm` or `git reset` that the user did not explicitly ask for
|
|
53
|
-
- (for all of these, you should weigh alternative paths that do not require approval)
|
|
54
|
-
|
|
55
|
-
When `sandbox_mode` is set to read-only, you'll need to request approval for any command that isn't a read.
|
|
56
|
-
|
|
57
|
-
You will be told what filesystem sandboxing, network sandboxing, and approval mode are active in a developer or user message. If you are not told about this, assume that you are running with workspace-write, network sandboxing enabled, and approval on-failure.
|
|
58
|
-
|
|
59
|
-
Although they introduce friction to the user because your work is paused until the user responds, you should leverage them when necessary to accomplish important work. If the completing the task requires escalated permissions, Do not let these settings or the sandbox deter you from attempting to accomplish the user's task unless it is set to "never", in which case never ask for approvals.
|
|
60
|
-
|
|
61
|
-
When requesting approval to execute a command that will require escalated privileges:
|
|
62
|
-
- Provide the `sandbox_permissions` parameter with the value `"require_escalated"`
|
|
63
|
-
- Include a short, 1 sentence explanation for why you need escalated permissions in the justification parameter
|
|
64
|
-
|
|
65
28
|
## Special user requests
|
|
66
29
|
|
|
67
30
|
- If the user makes a simple request (such as asking for the time) which you can fulfill by running a terminal command (such as `date`), you should do so.
|
package/prompts/prompt.md
CHANGED
|
@@ -146,41 +146,6 @@ If completing the user's task requires writing or modifying files, your code and
|
|
|
146
146
|
- Do not use one-letter variable names unless explicitly requested.
|
|
147
147
|
- NEVER output inline citations like "【F:README.md†L5-L14】" in your outputs. The CLI is not able to render these so they will just be broken in the UI. Instead, if you output valid filepaths, users will be able to click on them to open the files in their editor.
|
|
148
148
|
|
|
149
|
-
## Sandbox and approvals
|
|
150
|
-
|
|
151
|
-
The Codex CLI harness supports several different sandboxing, and approval configurations that the user can choose from.
|
|
152
|
-
|
|
153
|
-
Filesystem sandboxing prevents you from editing files without user approval. The options are:
|
|
154
|
-
|
|
155
|
-
- **read-only**: You can only read files.
|
|
156
|
-
- **workspace-write**: You can read files. You can write to files in your workspace folder, but not outside it.
|
|
157
|
-
- **danger-full-access**: No filesystem sandboxing.
|
|
158
|
-
|
|
159
|
-
Network sandboxing prevents you from accessing network without approval. Options are
|
|
160
|
-
|
|
161
|
-
- **restricted**
|
|
162
|
-
- **enabled**
|
|
163
|
-
|
|
164
|
-
Approvals are your mechanism to get user consent to perform more privileged actions. Although they introduce friction to the user because your work is paused until the user responds, you should leverage them to accomplish your important work. Do not let these settings or the sandbox deter you from attempting to accomplish the user's task. Approval options are
|
|
165
|
-
|
|
166
|
-
- **untrusted**: The harness will escalate most commands for user approval, apart from a limited allowlist of safe "read" commands.
|
|
167
|
-
- **on-failure**: The harness will allow all commands to run in the sandbox (if enabled), and failures will be escalated to the user for approval to run again without the sandbox.
|
|
168
|
-
- **on-request**: Commands will be run in the sandbox by default, and you can specify in your tool call if you want to escalate a command to run without sandboxing. (Note that this mode is not always available. If it is, you'll see parameters for it in the `shell` command description.)
|
|
169
|
-
- **never**: This is a non-interactive mode where you may NEVER ask the user for approval to run commands. Instead, you must always persist and work around constraints to solve the task for the user. You MUST do your utmost best to finish the task and validate your work before yielding. If this mode is pared with `danger-full-access`, take advantage of it to deliver the best outcome for the user. Further, in this mode, your default testing philosophy is overridden: Even if you don't see local patterns for testing, you may add tests and scripts to validate your work. Just remove them before yielding.
|
|
170
|
-
|
|
171
|
-
When you are running with approvals `on-request`, and sandboxing enabled, here are scenarios where you'll need to request approval:
|
|
172
|
-
|
|
173
|
-
- You need to run a command that writes to a directory that requires it (e.g. running tests that write to /tmp)
|
|
174
|
-
- You need to run a GUI app (e.g., open/xdg-open/osascript) to open browsers or files.
|
|
175
|
-
- You are running sandboxed and need to run a command that requires network access (e.g. installing packages)
|
|
176
|
-
- If you run a command that is important to solving the user's query, but it fails because of sandboxing, rerun the command with approval.
|
|
177
|
-
- You are about to take a potentially destructive action such as an `rm` or `git reset` that the user did not explicitly ask for
|
|
178
|
-
- (For all of these, you should weigh alternative paths that do not require approval.)
|
|
179
|
-
|
|
180
|
-
Note that when sandboxing is set to read-only, you'll need to request approval for any command that isn't a read.
|
|
181
|
-
|
|
182
|
-
You will be told what filesystem sandboxing, network sandboxing, and approval mode are active in a developer or user message. If you are not told about this, assume that you are running with workspace-write, network sandboxing ON, and approval on-failure.
|
|
183
|
-
|
|
184
149
|
## Validating your work
|
|
185
150
|
|
|
186
151
|
If the codebase has tests or the ability to build or run, consider using them to verify that your work is complete.
|
|
@@ -146,41 +146,6 @@ If completing the user's task requires writing or modifying files, your code and
|
|
|
146
146
|
- Do not use one-letter variable names unless explicitly requested.
|
|
147
147
|
- NEVER output inline citations like "【F:README.md†L5-L14】" in your outputs. The CLI is not able to render these so they will just be broken in the UI. Instead, if you output valid filepaths, users will be able to click on them to open the files in their editor.
|
|
148
148
|
|
|
149
|
-
## Sandbox and approvals
|
|
150
|
-
|
|
151
|
-
The Codex CLI harness supports several different sandboxing, and approval configurations that the user can choose from.
|
|
152
|
-
|
|
153
|
-
Filesystem sandboxing prevents you from editing files without user approval. The options are:
|
|
154
|
-
|
|
155
|
-
- **read-only**: You can only read files.
|
|
156
|
-
- **workspace-write**: You can read files. You can write to files in your workspace folder, but not outside it.
|
|
157
|
-
- **danger-full-access**: No filesystem sandboxing.
|
|
158
|
-
|
|
159
|
-
Network sandboxing prevents you from accessing network without approval. Options are
|
|
160
|
-
|
|
161
|
-
- **restricted**
|
|
162
|
-
- **enabled**
|
|
163
|
-
|
|
164
|
-
Approvals are your mechanism to get user consent to perform more privileged actions. Although they introduce friction to the user because your work is paused until the user responds, you should leverage them to accomplish your important work. Do not let these settings or the sandbox deter you from attempting to accomplish the user's task. Approval options are
|
|
165
|
-
|
|
166
|
-
- **untrusted**: The harness will escalate most commands for user approval, apart from a limited allowlist of safe "read" commands.
|
|
167
|
-
- **on-failure**: The harness will allow all commands to run in the sandbox (if enabled), and failures will be escalated to the user for approval to run again without the sandbox.
|
|
168
|
-
- **on-request**: Commands will be run in the sandbox by default, and you can specify in your tool call if you want to escalate a command to run without sandboxing. (Note that this mode is not always available. If it is, you'll see parameters for it in the `shell` command description.)
|
|
169
|
-
- **never**: This is a non-interactive mode where you may NEVER ask the user for approval to run commands. Instead, you must always persist and work around constraints to solve the task for the user. You MUST do your utmost best to finish the task and validate your work before yielding. If this mode is pared with `danger-full-access`, take advantage of it to deliver the best outcome for the user. Further, in this mode, your default testing philosophy is overridden: Even if you don't see local patterns for testing, you may add tests and scripts to validate your work. Just remove them before yielding.
|
|
170
|
-
|
|
171
|
-
When you are running with approvals `on-request`, and sandboxing enabled, here are scenarios where you'll need to request approval:
|
|
172
|
-
|
|
173
|
-
- You need to run a command that writes to a directory that requires it (e.g. running tests that write to /tmp)
|
|
174
|
-
- You need to run a GUI app (e.g., open/xdg-open/osascript) to open browsers or files.
|
|
175
|
-
- You are running sandboxed and need to run a command that requires network access (e.g. installing packages)
|
|
176
|
-
- If you run a command that is important to solving the user's query, but it fails because of sandboxing, rerun the command with approval.
|
|
177
|
-
- You are about to take a potentially destructive action such as an `rm` or `git reset` that the user did not explicitly ask for
|
|
178
|
-
- (For all of these, you should weigh alternative paths that do not require approval.)
|
|
179
|
-
|
|
180
|
-
Note that when sandboxing is set to read-only, you'll need to request approval for any command that isn't a read.
|
|
181
|
-
|
|
182
|
-
You will be told what filesystem sandboxing, network sandboxing, and approval mode are active in a developer or user message. If you are not told about this, assume that you are running with workspace-write, network sandboxing ON, and approval on-failure.
|
|
183
|
-
|
|
184
149
|
## Validating your work
|
|
185
150
|
|
|
186
151
|
If the codebase has tests or the ability to build or run, consider using them to verify that your work is complete.
|