Skip to content

feat(security): name the permission-bypass preset dangerous_skip explicitly - #266

Closed
raymondginger2018-sudo wants to merge 1 commit into
HKUDS:mainfrom
raymondginger2018-sudo:pr/dangerous-skip-preset
Closed

raymondginger2018-sudo wants to merge 1 commit into
HKUDS:mainfrom
raymondginger2018-sudo:pr/dangerous-skip-preset

Conversation

@raymondginger2018-sudo

Copy link
Copy Markdown
Contributor

Borrowed from Claude Code --allow-dangerously-skip-permissions: an escape hatch that skips every permission check should be NAMED dangerous, not sit silently under full_access. Adds ExecutionAccessPreset.DANGEROUS_SKIP with the same strength profile as FULL_ACCESS, so operators and audit logs can tell a deliberate "I know this is dangerous" choice apart from ordinary full access.

Lineage

Part of the 2026-08-19 "Claude Code lessons" branch. The sibling change (instruction-file glob excludes via DEEPCODE_INSTRUCTION_EXCLUDES) already landed on main in reworked form (core/harness/memory.py owns it, with tests), so this PR carries only the still-missing preset.

Verification

tests/domain/test_execution_security.py + tests/application/test_execution_security_policy.py + tests/contract/test_protocol_schema.py + tests/application/test_session_alignment.py + tests/application/test_turn_service.py = 71 passed.

Checks

  • Dedup: main has no "dangerous" preset (grep empty).
  • Dependency closure: none — StrEnum already imported.
  • Scope: additive enum member + one _PRESET_PROFILES entry; no default behavior change (no existing client passes the new value; the protocol-schema contract test passes unchanged).

…icitly

Borrowed from Claude Code --allow-dangerously-skip-permissions: the escape
hatch that skips every permission check should be named dangerous, so both
the operator and the audit log see the choice for what it is.
@Zongwei9888

Copy link
Copy Markdown
Collaborator

Thank you, @raymondginger2018-sudo. We're closing this one: as written, the new preset can't be saved, and it isn't the same as Full Access.

  • thread/permission/update accepts dangerous_skip, but the risk-acknowledgement check (app_server/dispatcher.py:1198) only applies to full_access, so the new preset skips the confirmation Full Access requires.
  • The write then fails: the threads.access_preset_override column only allows ask, read_only and full_access (core/persistence/migrations.py:1227), so the request ends in an IntegrityError (-32603).
  • Several places check is ExecutionAccessPreset.FULL_ACCESS (core/harness/policy.py:204-210, core/harness/tools/__init__.py:108-112), so dangerous_skip would keep the sensitive-path denylist and origin approval on: not the same strength as Full Access.
  • It is also missing from core/config.py:406, the protocol schema, Desktop and the TUI, and has no tests.

Full Access already asks every client for an explicit risk acknowledgement. If you think its name or warning should be clearer, please open an issue about the wording first; a rename would need a migration, the protocol schema, all three clients and tests in one change. Please also keep code comments in English.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants