Skip to content

TC CFG 005

github-actions[bot] edited this page Nov 21, 2026 · 4 revisions

TC-CFG-005: shared config turns off approvals

Severity high for effective bypasses; medium for settings-file intent signals
Harnesses Claude Code, Codex, Gemini CLI
Files .claude/settings.json, .codex/config.toml, .gemini/settings.json (any depth, repository scope)
Rule rules/TC-CFG-005.yaml

What it detects

A mode that removes the approval step, committed to a file every contributor's agent loads.

Setting Severity
Claude Code: permissions.defaultMode "bypassPermissions" high
Claude Code: permissions.defaultMode "bypassPermissions" and skipDangerousModePermissionPrompt: true in the same file high, one bypass finding with skip in its evidence
Claude Code: skipDangerousModePermissionPrompt: true without bypassPermissions medium
Codex: sandbox_mode = "danger-full-access" high
Codex: approval_policy = "never" high
Codex: either of the above in a [profiles.<name>] table high
Gemini CLI: general.defaultApprovalMode "yolo" medium
Gemini CLI: tools.autoAccept: true, or the older flat autoAccept: true medium
Any of the above under a test-fixture directory (see below) low

A matching file whose path has a whole segment fixtures, __fixtures__, testdata, test-fixtures, test_fixtures, tests, or test above the config directory (config.fixture_path) is reported at low. The match is case-sensitive and does not apply to a substring (myfixtures/, fixtures-api/, testing-guide/). A repository-root .claude/settings.json, .codex/config.toml, or .gemini/settings.json is never demoted, even when a fixtures/ directory exists elsewhere in the tree.

With bypassPermissions, Claude Code runs every tool call without a prompt. skipDangerousModePermissionPrompt is not read from a Claude Code project settings file. It is therefore medium: it signals bypass intent but does not turn approvals off there. When both values are in one file, the normal high-severity bypass finding is reported once, on permissions, with the skip setting retained in its evidence.

danger-full-access runs Codex commands with no sandbox, so the approval policy no longer protects anything outside the workspace; approval_policy = "never" runs every command without asking. A profile is evaluated exactly like the top level. Codex does not apply profile or profiles from a project config, but the file is still shared and its profiles are copied into user configs, so the rule does not rely on that.

Gemini CLI's configuration reference says yolo can only be enabled with --yolo or --approval-mode=yolo. general.defaultApprovalMode does not accept yolo, so that value in a settings file is medium: an intent signal, not an effective shared-file bypass. autoAccept and tools.autoAccept set to true are reported at medium as well.

A Codex config with both danger-full-access and approval_policy = "never" is two findings, one per setting.

Case. Each value is compared the way its harness reads it, and keys are case-sensitive in all three:

Harness Value Case
Claude Code defaultMode exact: a zod enum after mapping the alias manual to default, so BypassPermissions is not the mode
Codex sandbox_mode, approval_policy exact: serde enums with fixed names (danger-full-access, never)
Gemini CLI defaultApprovalMode exact: a string switch, and YOLO is rejected as an invalid mode
Gemini CLI autoAccept, tools.autoAccept true, or a string "true" in any case: the settings loader converts boolean strings case-insensitively

Not reported:

  • User-scope settings. negativos/malformed-fields.json includes a user Codex sandbox_mode of danger-full-access and a user Gemini autoAccept, and that negative stays as it is, so the rule still requires repository scope.
  • .claude/settings.local.json, which is personal and not shared.
  • Other modes: acceptEdits, plan, default, workspace-write, read-only, on-request, auto_edit.
  • skipDangerousModePermissionPrompt: false, and autoAccept: false.
  • A value in another case where the harness compares exactly: BypassPermissions, Danger-Full-Access, NEVER, YOLO.
  • Mentions of the mode inside other values, such as an allow rule Bash(grep -rn bypassPermissions docs/).

Codex loads a project .codex/ layer only in a trusted project. The rule reports the file whatever the trust state, because the next person to trust the project gets the mode.

Examples

Reported, high:

{
  "permissions": {
    "defaultMode": "bypassPermissions",
    "allow": ["Bash(go test ./...)"]
  }
}
sandbox_mode = "workspace-write"

[profiles.ci]
approval_policy = "never"

Reported, medium:

{"permissions": {"defaultMode": "acceptEdits"}, "skipDangerousModePermissionPrompt": true}
{"general": {"defaultApprovalMode": "yolo"}}

Reported, low, because the file sits under a test-fixture directory:

# evals/fixtures/case-a/.claude/settings.json
{"permissions": {"defaultMode": "bypassPermissions"}}

Still reported high: services/fixtures-api/.codex/config.toml and myfixtures/app/.codex/config.toml (the segment only contains the word), and a repository-root .claude/settings.json next to a fixtures/ directory.

Not reported:

{"permissions": {"defaultMode": "acceptEdits", "allow": ["Bash(npm run test:*)"]}}
sandbox_mode = "workspace-write"
approval_policy = "on-request"

How to fix

Remove the mode from the shared file. In Claude Code, delete bypassPermissions and skipDangerousModePermissionPrompt, and use acceptEdits or the default mode with a narrow permissions.allow list. In Codex, use sandbox_mode = "workspace-write" and an approval policy other than never, in profiles too. In Gemini CLI, remove the yolo approval mode and autoAccept. Someone who wants the mode for a session can pass it on their own command line (--permission-mode bypassPermissions, --sandbox danger-full-access, --yolo) or in their user config, where it affects only them.

References

Clone this wiki locally