@tencent-ai/agent-sdk 0.3.169 → 0.3.171
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/cli/CHANGELOG.md +50 -18
- package/cli/builtin/workflows/deep-research.workflow.js +429 -0
- package/cli/dist/codebuddy-headless.js +208 -135
- package/cli/dist/web-ui/assets/{index-CiYuiLTV.js → index-i12Tc2lJ.js} +20 -20
- package/cli/dist/web-ui/docs/cn/cli/permission-modes.md +260 -0
- package/cli/dist/web-ui/docs/cn/cli/permissions.md +380 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/README.md +3 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.103.2.md +21 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.103.3.md +15 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.103.4.md +13 -0
- package/cli/dist/web-ui/docs/cn/cli/workflows.md +281 -0
- package/cli/dist/web-ui/docs/en/cli/permission-modes.md +260 -0
- package/cli/dist/web-ui/docs/en/cli/permissions.md +380 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/README.md +3 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.103.2.md +21 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.103.3.md +15 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.103.4.md +13 -0
- package/cli/dist/web-ui/docs/en/cli/workflows.md +281 -0
- package/cli/dist/web-ui/docs/search-index-en.json +1 -1
- package/cli/dist/web-ui/docs/search-index-zh.json +1 -1
- package/cli/dist/web-ui/docs/sidebar-en.json +1 -1
- package/cli/dist/web-ui/docs/sidebar-zh.json +1 -1
- package/cli/dist/web-ui/index.html +1 -1
- package/cli/dist/web-ui/sw.js +1 -1
- package/cli/package.json +2 -1
- package/cli/product.cloudhosted.json +5 -3
- package/cli/product.internal.json +27 -3
- package/cli/product.ioa.json +31 -3
- package/cli/product.json +46 -3
- package/cli/product.selfhosted.json +5 -3
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/types.d.ts +9 -1
- package/lib/types.d.ts.map +1 -1
- package/lib/utils/type-guards.d.ts.map +1 -1
- package/lib/utils/type-guards.js +1 -0
- package/lib/utils/type-guards.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
# Permission Rules (Permissions)
|
|
2
|
+
|
|
3
|
+
> Precisely constrain what CodeBuddy Code can do with fine-grained allow / ask / deny rules, Permission Modes, and layered settings. Rules can be committed to the repository and shared with the team, or overridden locally by developers.
|
|
4
|
+
|
|
5
|
+
## Permission System Overview
|
|
6
|
+
|
|
7
|
+
CodeBuddy Code uses a layered evaluation mechanism to balance capability and security. Before the main agent executes any tool call, it passes through the permission service (`tool-permission-service.ts::checkToolPermission`). Eight phases are evaluated in order:
|
|
8
|
+
|
|
9
|
+
| Phase | Check | Behavior on match |
|
|
10
|
+
| :---- | :---- | :---------------- |
|
|
11
|
+
| 1 | **Deny rules** | Reject immediately, with the highest priority |
|
|
12
|
+
| 2 | **Trusted Allow rules** (user / cli / flag / session / policy / project under a trusted directory / `--allowedTools`) | Allow immediately, and **can bypass command safety checks** |
|
|
13
|
+
| 3 | **Command safety check** (`checkCommandSafety`, interactive only) | Force confirmation for high-risk / dangerous commands |
|
|
14
|
+
| 4 | **Ask rules** | Force confirmation |
|
|
15
|
+
| 5 | **Bypass mode short-circuit** | Allow directly in `bypassPermissions` mode; downgrade to default when `disableBypassPermissionsMode` is enabled |
|
|
16
|
+
| 6 | **Untrusted Allow rules** (project / local outside trusted directories, plus command / sandbox sources) | Allow, but **cannot bypass command safety checks** |
|
|
17
|
+
| 7 | **Permission Mode strategy** (`tool-permission-strategy.ts`) | Decide whether approval is required based on the current [PermissionMode](permission-modes.md) |
|
|
18
|
+
| 8 | dontAsk / async agent fallback | Convert `ask` to `deny` in print / async agent scenarios to avoid deadlock |
|
|
19
|
+
|
|
20
|
+
> **Key point**: deny always takes precedence, and allow is split into two layers: "trusted" and "untrusted". Before the project root is listed as a trusted directory, allow rules in `.codebuddy/settings.json` **cannot bypass the command safety gate**. This differs from cc and is designed to prevent malicious repositories from bypassing local safety protections by pushing their own settings into team PRs.
|
|
21
|
+
|
|
22
|
+
Read-only tools (Read / Grep / Glob, etc.) do not prompt for approval by default inside trusted directories. Editing tools and Bash always go through the full phase chain. See `tool-permission-strategy.ts::ToolPermissionDefaultStrategy` and `permission-utils.ts::isArgsInTrustedDirectories` for details.
|
|
23
|
+
|
|
24
|
+
## Three Rule Behaviors
|
|
25
|
+
|
|
26
|
+
The three arrays under the `permissions` object correspond to three behaviors:
|
|
27
|
+
|
|
28
|
+
```json
|
|
29
|
+
{
|
|
30
|
+
"permissions": {
|
|
31
|
+
"allow": ["Bash(npm test)", "Read(/tmp/data/**)"],
|
|
32
|
+
"ask": ["WebFetch"],
|
|
33
|
+
"deny": ["Bash(rm -rf *)", "Edit(.git/**)"]
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
- **`allow`**: CodeBuddy can use it without asking for approval
|
|
39
|
+
- **`ask`**: Ask for approval every time it is used
|
|
40
|
+
- **`deny`**: Never allow it to be used
|
|
41
|
+
|
|
42
|
+
## Where to Manage Rules
|
|
43
|
+
|
|
44
|
+
### `/permissions` command
|
|
45
|
+
|
|
46
|
+
Enter `/permissions` in a session to open the permission management panel (implemented in `permissions-command-executor.ts`). You can view all current allow / ask / deny rules, which settings layer they come from, and temporarily add or remove them (written to the user, project, or project-local scope).
|
|
47
|
+
|
|
48
|
+
When **"Yes, don't ask again"** is selected in the dialog, CodeBuddy writes the most stable prefix for the current command into the `allow` array of the corresponding scope's settings.
|
|
49
|
+
|
|
50
|
+
### CLI Startup Arguments
|
|
51
|
+
|
|
52
|
+
| Argument | Purpose |
|
|
53
|
+
| :------- | :------ |
|
|
54
|
+
| `--allowedTools <tools...>` | Process-level temporary allow rules. Separated by spaces or commas. Example: `--allowedTools "Bash(git:*) Edit"` |
|
|
55
|
+
| `--disallowedTools <tools...>` | Process-level temporary deny rules. Same as above |
|
|
56
|
+
| `--add-dir <path>` | Add an extra directory to the trusted directory scope (affects whether Read requires confirmation) |
|
|
57
|
+
| `-y` / `--dangerously-skip-permissions` | Equivalent to `--permission-mode bypassPermissions` |
|
|
58
|
+
|
|
59
|
+
Definitions are in `cli-provider.ts:40-55`.
|
|
60
|
+
|
|
61
|
+
### Configuration Files
|
|
62
|
+
|
|
63
|
+
See [Settings Configuration](settings.md) for details. CodeBuddy merges these four scopes:
|
|
64
|
+
|
|
65
|
+
| Scope | Path |
|
|
66
|
+
| :---- | :--- |
|
|
67
|
+
| user | `~/.codebuddy/settings.json` |
|
|
68
|
+
| project | `<repo>/.codebuddy/settings.json` (committed to git) |
|
|
69
|
+
| project-local | `<repo>/.codebuddy/settings.local.json` (not committed to git, local override) |
|
|
70
|
+
| cliArg / flagSettings / session / policySettings | Process state, not persisted to disk |
|
|
71
|
+
|
|
72
|
+
See `tool-permission-service.ts:647-741` for the merge implementation.
|
|
73
|
+
|
|
74
|
+
## Rule Syntax
|
|
75
|
+
|
|
76
|
+
Rule form: `Tool` or `Tool(specifier)`.
|
|
77
|
+
|
|
78
|
+
### Match an Entire Tool
|
|
79
|
+
|
|
80
|
+
Remove the parentheses to match all calls to a tool:
|
|
81
|
+
|
|
82
|
+
| Rule | Meaning |
|
|
83
|
+
| :--- | :------ |
|
|
84
|
+
| `Bash` | All Bash commands |
|
|
85
|
+
| `WebFetch` | All web fetches |
|
|
86
|
+
| `Read` | All file reads |
|
|
87
|
+
| `Edit` | All file edits |
|
|
88
|
+
|
|
89
|
+
`*` can also be used as a standalone rule (`permission-utils.ts:194` treats it as a full-match wildcard).
|
|
90
|
+
|
|
91
|
+
### Add a Specifier for Fine-Grained Matching
|
|
92
|
+
|
|
93
|
+
Write arguments inside the parentheses:
|
|
94
|
+
|
|
95
|
+
| Rule | Matches |
|
|
96
|
+
| :--- | :------ |
|
|
97
|
+
| `Bash(npm run build)` | Exact match for `npm run build` |
|
|
98
|
+
| `Bash(npm:*)` or `Bash(npm *)` | All commands starting with `npm` |
|
|
99
|
+
| `Read(./.env)` | `.env` in the current directory |
|
|
100
|
+
| `Edit(/src/**/*.ts)` | `src/**/*.ts` under the project root |
|
|
101
|
+
| `Read(~/.zshrc)` | `.zshrc` in the user's home directory |
|
|
102
|
+
| `Read(//tmp/scratch.txt)` | Absolute filesystem path `/tmp/scratch.txt` |
|
|
103
|
+
| `WebFetch(domain:example.com)` | Fetch example.com |
|
|
104
|
+
| `mcp__puppeteer__navigate` | The navigate tool of the MCP puppeteer service |
|
|
105
|
+
| `Agent(Explore)` | The Explore subagent |
|
|
106
|
+
|
|
107
|
+
## Tool-Specific Rules
|
|
108
|
+
|
|
109
|
+
### Bash
|
|
110
|
+
|
|
111
|
+
Bash rules support three syntax forms (implemented in `permission-utils.ts::matchSingleCommandAgainstPattern`, lines `414-450`):
|
|
112
|
+
|
|
113
|
+
| Syntax | Meaning | Example |
|
|
114
|
+
| :----- | :------ | :------ |
|
|
115
|
+
| Exact match | The pattern is exactly equal to the command | `Bash(npm run build)` only matches `npm run build` |
|
|
116
|
+
| `:*` prefix | The pattern ends with `:*` → matches the first word / multi-word prefix of the command | `Bash(git:*)` matches `git status` / `git push origin main` |
|
|
117
|
+
| Wildcard | When the pattern contains `*`, use picomatch bash mode (**`*` can cross `/`**) | `Bash(npm run *)` matches `npm run build`; `Bash(ls *)` matches `ls -al /tmp/x` |
|
|
118
|
+
|
|
119
|
+
> Unlike minimatch, cbc deliberately enables `bash: true` for Bash wildcard mode so that `*` can cross `/`. Otherwise, `ls *` could not match `ls -al /xxx`, which is one of the most common pitfalls for users (see the comments in `permission-utils.ts:441-446`).
|
|
120
|
+
|
|
121
|
+
#### Compound Commands
|
|
122
|
+
|
|
123
|
+
CodeBuddy uses `CommandParserService` (priority: tree-sitter > shell-quote > regex fallback; see `permission-utils.ts:357-378`) to parse shell operators `&&` / `||` / `;` / `|`, and evaluates each subcommand independently:
|
|
124
|
+
|
|
125
|
+
- **deny / ask rules**: trigger if any subcommand matches (`matchCommandRule`, lines `305-334`)
|
|
126
|
+
- **allow rules**: require **all subcommands to match** before allowing (`isCommandAllowed`, lines `478-500`). This is a different trade-off from cc: a compound command with one matching and one non-matching subcommand will still ask for approval, preventing attackers from hiding dangerous commands next to allowed ones
|
|
127
|
+
|
|
128
|
+
Example:
|
|
129
|
+
|
|
130
|
+
```text
|
|
131
|
+
allow: ["Bash(git:*)"]
|
|
132
|
+
|
|
133
|
+
git status → allow
|
|
134
|
+
git status && rm * → ask (rm * is not in allow; every subcommand must match)
|
|
135
|
+
git status; rm * → ask (same as above)
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
#### Redirection
|
|
139
|
+
|
|
140
|
+
Commands containing `>` / `<` / `>>` / `<<` / `&>` require an **exact match** under allow rules (`permission-utils.ts:482-485`); wildcard rules do not apply.
|
|
141
|
+
|
|
142
|
+
### Read / Edit / Write
|
|
143
|
+
|
|
144
|
+
File rules use `minimatch` for glob matching and perform three layers of path normalization (`permission-utils.ts::matchFileRule` and `normalizePath`, lines `241-268`):
|
|
145
|
+
|
|
146
|
+
| pattern | Explanation | Example |
|
|
147
|
+
| :------ | :---------- | :------ |
|
|
148
|
+
| `//path` | Absolute filesystem path | `Read(//etc/hosts)` |
|
|
149
|
+
| `~/path` | Starting from the user's home directory | `Read(~/.zshrc)` |
|
|
150
|
+
| `/path` | Starting from the project root | `Edit(/src/**/*.ts)` |
|
|
151
|
+
| `path` or `./path` | Starting from the current working directory | `Read(.env)` |
|
|
152
|
+
|
|
153
|
+
Matching options: `dot: true` (allow dotfiles), `nocase: true` (case-insensitive), `matchBase: true` (bare filenames can match at any depth).
|
|
154
|
+
|
|
155
|
+
Notes:
|
|
156
|
+
|
|
157
|
+
- deny rules such as `Edit(.git/**)` block all attempts through Edit / Write / NotebookEdit, but **do not block** indirect paths through Bash such as `python -c 'open(".git/config", "w")...'`. OS-level protection depends on [Bash sandboxing](bash-sandboxing.md)
|
|
158
|
+
- Read rules are also intercepted and parsed for some Bash file-read commands (`cat`, `head`, `tail`, etc.; see the special handling for these commands inside `command-utils.ts::checkCommandSafety`)
|
|
159
|
+
|
|
160
|
+
### WebFetch
|
|
161
|
+
|
|
162
|
+
```text
|
|
163
|
+
WebFetch # any URL
|
|
164
|
+
WebFetch(domain:example.com) # only example.com and its subdomains
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
The matching implementation is in `permission-utils.ts::matchURLRule` (line `515`) and supports the `domain:` prefix for hostname matching.
|
|
168
|
+
|
|
169
|
+
### MCP Tools
|
|
170
|
+
|
|
171
|
+
MCP tools are named in the format `mcp__<server>__<tool>`. Rules support three granularities:
|
|
172
|
+
|
|
173
|
+
| Rule | Matches |
|
|
174
|
+
| :--- | :------ |
|
|
175
|
+
| `mcp__puppeteer` | All tools of the entire puppeteer server |
|
|
176
|
+
| `mcp__puppeteer__*` | Same as above (wildcard form) |
|
|
177
|
+
| `mcp__puppeteer__navigate` | Only the navigate tool |
|
|
178
|
+
|
|
179
|
+
Starting from `tool-permission-service.ts:152`, the code checks `tool.name.startsWith('mcp__')` and enters the MCP-specific branch.
|
|
180
|
+
|
|
181
|
+
### Agent (Subagent)
|
|
182
|
+
|
|
183
|
+
```json
|
|
184
|
+
{
|
|
185
|
+
"permissions": {
|
|
186
|
+
"deny": ["Agent(Explore)", "Agent(Plan)"]
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
You can also use a CLI flag:
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
codebuddy --disallowedTools "Agent(Explore) Agent(Plan)"
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
After being denied, that `subagent_type` will be rejected when the main agent invokes the Agent tool.
|
|
198
|
+
|
|
199
|
+
### Skill
|
|
200
|
+
|
|
201
|
+
```json
|
|
202
|
+
{
|
|
203
|
+
"permissions": {
|
|
204
|
+
"deny": ["Skill(dangerous-skill-name)"]
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
Skill rules **must** be exact matches (`permission-utils.ts::matchSkillRule`, lines `458-464`); wildcards are not supported.
|
|
210
|
+
|
|
211
|
+
## Trusted Directories
|
|
212
|
+
|
|
213
|
+
By default, CodeBuddy only considers the **current working directory** trusted. The Read tool is allowed inside trusted directories and asks outside them; Edit / Bash always go through full approval (unless an allow rule applies or a permissive mode is active).
|
|
214
|
+
|
|
215
|
+
Several ways to expand the trusted scope:
|
|
216
|
+
|
|
217
|
+
| Method | Persistence |
|
|
218
|
+
| :----- | :---------- |
|
|
219
|
+
| `--add-dir <path>` startup argument | Process-level |
|
|
220
|
+
| `/add-dir` command within a session | Session-level |
|
|
221
|
+
| `permissions.additionalDirectories` setting | Persistent |
|
|
222
|
+
| `permissions.trustedDirectories` setting | Persistent |
|
|
223
|
+
|
|
224
|
+
Implementation: `permission-utils.ts:561-583`. Trusted directory list = `workspace root + settings.trustedDirectories + session.options.addDir`.
|
|
225
|
+
|
|
226
|
+
> Both `--add-dir` and `permissions.additionalDirectories` only grant **file access**. They **do not** make CodeBuddy load `.codebuddy/` configuration from those directories (agents / hooks / settings, etc. still use the startup directory). This matches cc behavior.
|
|
227
|
+
|
|
228
|
+
### Project Directory Trust Switch
|
|
229
|
+
|
|
230
|
+
Whether you have "explicitly trusted" a repository directory also affects the trust level of allow rules (`tool-permission-service.ts:182`). When the directory is **not trusted**:
|
|
231
|
+
|
|
232
|
+
- `allow` rules in `<repo>/.codebuddy/settings.json` and `.codebuddy/settings.local.json` are classified into the **untrusted** layer (Phase 6), and **cannot** bypass command safety checks
|
|
233
|
+
- After the user confirms trust in the interactive UI (`directoryTrustService.isTrustDirectory`), project-level rules are promoted to the Phase 2 trusted layer
|
|
234
|
+
|
|
235
|
+
This is a cbc-specific security model designed to reduce lateral risk that can arise immediately after cloning and running a repository.
|
|
236
|
+
|
|
237
|
+
## Protected Files / Paths
|
|
238
|
+
|
|
239
|
+
In any mode, CodeBuddy adds extra protection for a set of critical paths (overlapping with the [PermissionMode documentation](permission-modes.md#protected-critical-files)):
|
|
240
|
+
|
|
241
|
+
- The repository itself: `.git`, `.gitconfig`, `.gitmodules`
|
|
242
|
+
- Shell configuration: `.bashrc` / `.zshrc` / `.envrc`, etc.
|
|
243
|
+
- Package management: `.npmrc` / `.yarnrc` / `bunfig.toml`, etc.
|
|
244
|
+
- IDE tools: `.vscode` / `.idea` / `.husky` / `.devcontainer`
|
|
245
|
+
- CodeBuddy itself: `.codebuddy` (except `.codebuddy/worktrees`)
|
|
246
|
+
- MCP / configuration: `.mcp.json` / `.codebuddy.json`
|
|
247
|
+
|
|
248
|
+
`bypassPermissions` mode still allows most of these through, but "catastrophic commands" such as `rm -rf /` / `rm -rf ~` are forced to ask through the `isDangerousCommand` fallback (`tool-permission-service.ts:244`).
|
|
249
|
+
|
|
250
|
+
## Extending Permissions with Hooks
|
|
251
|
+
|
|
252
|
+
The `PreToolUse` hook in the [Hooks system](hooks-guide.md) runs before permission approval prompts and can programmatically allow / deny / rewrite inputs.
|
|
253
|
+
|
|
254
|
+
```json
|
|
255
|
+
{
|
|
256
|
+
"hooks": {
|
|
257
|
+
"PreToolUse": [
|
|
258
|
+
{
|
|
259
|
+
"matcher": "Bash",
|
|
260
|
+
"hooks": [{ "type": "command", "command": "/path/to/bash-policy.sh" }]
|
|
261
|
+
}
|
|
262
|
+
]
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
Hook exit code semantics:
|
|
268
|
+
|
|
269
|
+
| Exit code | Behavior |
|
|
270
|
+
| :-------- | :------- |
|
|
271
|
+
| `0` + JSON decision | Execute according to `permissionDecision` (allow / ask / deny) in the JSON |
|
|
272
|
+
| `2` | Block (stderr content is passed back to the model) |
|
|
273
|
+
| Other non-0 | Non-blocking error (shown but allowed) |
|
|
274
|
+
|
|
275
|
+
Notes:
|
|
276
|
+
|
|
277
|
+
- **deny / ask rules always take effect before hooks**. A hook returning `"allow"` cannot bypass deny in settings. This matches cc behavior
|
|
278
|
+
- However, **blocking hooks** (exit code 2) can short-circuit allow rules before Phase 1, so you can "allow all Bash first, but use hooks to separately block a few specific commands"
|
|
279
|
+
|
|
280
|
+
## Working with Sandboxing
|
|
281
|
+
|
|
282
|
+
Permission rules and [Bash sandboxing](bash-sandboxing.md) are complementary layers:
|
|
283
|
+
|
|
284
|
+
- **Rule layer**: constrains whether CodeBuddy "wants to use" a tool or access a path
|
|
285
|
+
- **Sandbox layer**: constrains whether the Bash subprocess can "actually access" a resource at the OS layer
|
|
286
|
+
|
|
287
|
+
Typical defense-in-depth combinations:
|
|
288
|
+
|
|
289
|
+
- `deny` rules prevent CodeBuddy from actively attempting restricted tools
|
|
290
|
+
- The sandbox prevents all Bash subprocesses from reaching files / networks outside the allowlist — even if prompt injection makes CodeBuddy want to bypass it, it cannot
|
|
291
|
+
- WebFetch `domain:` allow rules and sandbox `allowedDomains` both apply, and the final boundary is the intersection
|
|
292
|
+
|
|
293
|
+
## Settings Priority
|
|
294
|
+
|
|
295
|
+
Permission rules inherit the general [Settings priority](settings.md):
|
|
296
|
+
|
|
297
|
+
```
|
|
298
|
+
flagSettings / cliArg / session > userSettings > policySettings >
|
|
299
|
+
projectSettings > localSettings > command/sandbox sources
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
However, the **evaluation order** is more important than settings priority:
|
|
303
|
+
|
|
304
|
+
- `deny` arrays are merged from all scopes (`PermissionUtils.mergeRulesFromAllSources`), and **a deny in any scope rejects**
|
|
305
|
+
- `allow` arrays are merged twice by "trusted / untrusted": user/cli/flag/session/policy are always included in the trusted merge; project/local are considered trusted only when the directory is trusted
|
|
306
|
+
- `disableBypassPermissionsMode` takes effect when it is `"disable"` in any of the four layers: `user / project / local / cliArg` (see `tool-permission-service.ts:670-673`) — this adds a project-level hard-disable channel compared with cc
|
|
307
|
+
|
|
308
|
+
## Example Configurations
|
|
309
|
+
|
|
310
|
+
### Minimized Trust: Only Allow npm Tests + Reading Project Files
|
|
311
|
+
|
|
312
|
+
```json
|
|
313
|
+
{
|
|
314
|
+
"permissions": {
|
|
315
|
+
"defaultMode": "default",
|
|
316
|
+
"allow": [
|
|
317
|
+
"Bash(npm test)",
|
|
318
|
+
"Bash(npm run lint)",
|
|
319
|
+
"Read(/src/**)",
|
|
320
|
+
"Read(/test/**)"
|
|
321
|
+
],
|
|
322
|
+
"deny": [
|
|
323
|
+
"Bash(rm:*)",
|
|
324
|
+
"Bash(curl:*)",
|
|
325
|
+
"Bash(wget:*)",
|
|
326
|
+
"Edit(.git/**)",
|
|
327
|
+
"Edit(/.codebuddy/**)"
|
|
328
|
+
]
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
### CI / Pipeline Scenario: Skip Approval + Strong Deny
|
|
334
|
+
|
|
335
|
+
```json
|
|
336
|
+
{
|
|
337
|
+
"permissions": {
|
|
338
|
+
"defaultMode": "bypassPermissions",
|
|
339
|
+
"deny": [
|
|
340
|
+
"Bash(rm -rf /:*)",
|
|
341
|
+
"Bash(sudo:*)",
|
|
342
|
+
"Bash(curl * -o /etc/*)",
|
|
343
|
+
"WebFetch(domain:internal-corp.example)"
|
|
344
|
+
]
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
### Team Shared + Personal Relaxation
|
|
350
|
+
|
|
351
|
+
`<repo>/.codebuddy/settings.json` (committed to git):
|
|
352
|
+
|
|
353
|
+
```json
|
|
354
|
+
{
|
|
355
|
+
"permissions": {
|
|
356
|
+
"deny": ["Bash(rm:*)", "Edit(.git/**)"]
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
`~/.codebuddy/settings.json` (user-level, private):
|
|
362
|
+
|
|
363
|
+
```json
|
|
364
|
+
{
|
|
365
|
+
"permissions": {
|
|
366
|
+
"defaultMode": "acceptEdits",
|
|
367
|
+
"allow": ["Bash(git:*)", "Bash(npm:*)"]
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
## Related Resources
|
|
373
|
+
|
|
374
|
+
- [Permission Modes](permission-modes.md): default / acceptEdits / plan / bypassPermissions / delegate and other modes
|
|
375
|
+
- [Settings Configuration](settings.md): complete configuration fields, scopes, and merge rules
|
|
376
|
+
- [Hooks system](hooks-guide.md): make programmatic permission decisions with hooks
|
|
377
|
+
- [Bash sandboxing](bash-sandboxing.md): OS-level isolation for Bash commands
|
|
378
|
+
- [CLI Reference](cli-reference.md): startup arguments such as `--allowedTools` / `--disallowedTools` / `--add-dir`
|
|
379
|
+
- [Security](security.md): overall security model and best practices
|
|
380
|
+
- [IAM Identity and Access](iam.md): organization-level identity authentication and permission control
|
|
@@ -17,6 +17,9 @@ Difference from CHANGELOG.md:
|
|
|
17
17
|
|
|
18
18
|
<!-- New versions are automatically added here -->
|
|
19
19
|
|
|
20
|
+
- [v2.103.4](./v2.103.4.md) - 2026-06-08
|
|
21
|
+
- [v2.103.3](./v2.103.3.md) - 2026-06-08
|
|
22
|
+
- [v2.103.2](./v2.103.2.md) - 2026-06-07
|
|
20
23
|
- [v2.103.1](./v2.103.1.md) - 2026-06-04
|
|
21
24
|
- [v2.103.0](./v2.103.0.md) - 2026-06-04
|
|
22
25
|
- [v2.102.0](./v2.102.0.md) - 2026-06-03
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# 🚀 CodeBuddy Code v2.103.2 Release
|
|
2
|
+
|
|
3
|
+
## 📦 Version Information
|
|
4
|
+
|
|
5
|
+
| Component | Version |
|
|
6
|
+
|------|------|
|
|
7
|
+
| CodeBuddy Code CLI | v2.103.2 |
|
|
8
|
+
| Agent SDK JS | v0.3.167 |
|
|
9
|
+
| Agent SDK Python | v0.3.166 |
|
|
10
|
+
|
|
11
|
+
## 🔧 Improvements
|
|
12
|
+
|
|
13
|
+
- **Plan Mode Visibility Convergence**: Sub-agents can now see the exit tool only when plan mode is explicitly locked. Sub-agents that simply inherit the main session's plan mode will no longer invoke it by mistake, avoiding pollution of the main session's approval popup.
|
|
14
|
+
- **Embedded Scenario Adaptation**: Added the `CODEBUDDY_DISABLE_PLAN_MODE` environment variable, allowing hosts to disable plan mode with one switch, adapting to embedded scenarios without an approval popup rendering area.
|
|
15
|
+
- **Stats Model Display Name Optimization**: Model aggregation statistics now display the model names configured by users, covering model rankings in Web UI and TUI, Token trend legends, and more.
|
|
16
|
+
- **Context Compaction Switch Compatibility**: Optimized compatibility logic for the compaction switch. When the new switch is explicitly disabled, it will no longer be incorrectly enabled by legacy configuration.
|
|
17
|
+
|
|
18
|
+
## 🐛 Bug Fixes
|
|
19
|
+
|
|
20
|
+
- **Context Compaction Recovery Stability**: Fixed recovery stability for `/compact` and automatic compaction in scenarios with extremely long context, pending approvals, and image results, reducing the probability of request interruption after compaction failures.
|
|
21
|
+
- **Monitoring Metrics Reporting Loss**: Fixed MeterProvider registration failure caused by multiple OpenTelemetry API instances, ensuring metrics data is reported normally.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# 🚀 CodeBuddy Code v2.103.3 Release
|
|
2
|
+
|
|
3
|
+
## 📦 Version Information
|
|
4
|
+
|
|
5
|
+
| Component | Version |
|
|
6
|
+
|------|------|
|
|
7
|
+
| CodeBuddy Code CLI | v2.103.3 |
|
|
8
|
+
| Agent SDK JS | v0.3.168 |
|
|
9
|
+
| Agent SDK Python | v0.3.167 |
|
|
10
|
+
|
|
11
|
+
## 🐛 Bug Fixes
|
|
12
|
+
|
|
13
|
+
- **Custom Model Authentication Error Recognition**: Invalid custom model API keys (401/403) are no longer misidentified as platform login expiration, avoiding "log in again" popups that interrupt sessions.
|
|
14
|
+
- **Session History Replay Stability**: When a session is reopened after being interrupted (such as force quit or crash), unfinished tool calls are now correctly rendered as "Canceled" instead of disappearing or showing non-localizable text. Pending questions that are still alive are no longer misidentified as orphan calls, preserving normal interaction capability.
|
|
15
|
+
- **OTel Metrics Stability**: Reverted the previous metrics fix to restore stable telemetry behavior and avoid mainline regressions.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# 🚀 CodeBuddy Code v2.103.4 Release
|
|
2
|
+
|
|
3
|
+
## 📦 Version Information
|
|
4
|
+
|
|
5
|
+
| Component | Version |
|
|
6
|
+
|------|------|
|
|
7
|
+
| CodeBuddy Code CLI | v2.103.4 |
|
|
8
|
+
| Agent SDK JS | v0.3.169 |
|
|
9
|
+
| Agent SDK Python | v0.3.168 |
|
|
10
|
+
|
|
11
|
+
## 🔧 Improvements
|
|
12
|
+
|
|
13
|
+
- **Model Optimization Assistance Switch**: Added the global `enableModelOptimization` setting, which controls whether to participate in model optimization. When enabled, requests carry the corresponding identifier. Custom models do not send this identifier, giving you clearer control over the scope of data usage.
|