Skip to content

Approval Modes

manual, smart, and auto decide when CodeN asks a human or an approval model; they do not change operating-system privileges. Smart Approval is an independent model review that falls back to a human on failure. auto skips only the ordinary call confirmations it controls and remains subject to project trust, Hooks, and outside-workspace rules.

Mode Trigger Behavior
manual default (no flags) every ordinary modification is confirmed by a human
smart --smart-approve ordinary modifications are reviewed by a separate LLM, escalating to human on uncertainty
auto --auto skips tool permission confirmations (inside the workspace)

--smart-approve and --auto are mutually exclusive; passing both reports a configuration error before the application is created.

Each tool call goes through:

  1. PreToolUse hook decision: deny rejects; ask forces human; allow bypasses the policy layer.
  2. Risk classification (including bash dangerous-command escalation).
  3. Policy layer: auto allows; read allows; under smart, modify first asks the LLM reviewer.
  4. When human review is needed: manual/smart prompt; under auto the call returns permission.hook_requires_interaction.
  5. The PermissionRequest hook can override the final decision.
  6. Human confirmation: y allows once; ordinary modifications accept s for the session; N/Esc denies.
  • Uses the same provider and credentials as the main task, with model approvalModel (falling back to model when unset).
  • Reviews only in-workspace ordinary modifications; outside-workspace and dangerous operations go straight to a human.
  • Review requests cap output at 256 tokens with a 30-second timeout; output must be a valid tool-free JSON object (decision + reason).
  • Any anomaly fails closed: timeout, truncation, invalid JSON, or model failure escalate to human review and never silently allow.
  • Strictness approvalStrictness: soft/medium (default)/hard, controlling how conservative the allow decision must be.
  • It skips only tool-call confirmations; workspace trust, project plugin confirmation, and hooks all run as usual.
  • A PreToolUse returning deny rejects; one returning ask safely rejects (permission.hook_requires_interaction).
  • Outside-workspace read/write/edit return permission.outside_workspace_denied, suggesting --auto --allow-outside-workspace.
  • s (allow_session) records a session-scoped grant only for modify-level tools; dangerous offers no such option.
  • The grant persists across turns within the same session, and /new resets the conversation without clearing it (the set is bound to the current application instance).
终端窗口
coden --smart-approve "your task"

Only in-workspace, modify-risk tool calls are reviewed (read is auto-allowed; commands escalated to dangerous go straight to a human; outside-workspace paths go straight to a human; --auto and --smart-approve are mutually exclusive).

  • Uses the same provider and credentials as the main task; the model is approvalModel, falling back to model.
  • One independent request per ordinary modification: maxOutputTokens 256 with a 30-second timeout.
  • The review system prompt marks the payload as untrusted data and requires a single JSON object (decision + reason).
Result Behavior
allow allowed directly (no human confirmation)
human_review escalated to human confirmation
invalid response timeout, truncation (length/max_tokens), tool calls included, non-JSON, illegal fields, empty reason → human review

Fail closed: no anomaly ever silently allows.

Value Policy
soft allow task-aligned, workspace-local, ordinary reversible operations; exhaustive proof is not required
medium (default) allow only when task alignment, limited impact, and a practical recovery path are all clear
hard allow only routine local operations whose target, complete material impact, and recovery path are very clear; escalate every substantive uncertainty
  • Each modification consumes the same provider quota as the main task; batches of modifications produce multiple review calls.
  • The UI shows the review: reviewing <tool>…, AI approved <tool>, AI requested human review — <reason>; when review is unavailable it asks for human approval.
  • Events: permission.review_started/review_completed/review_failed.

A PreToolUse deny beats an LLM allow; when a hook requests ask, the call goes straight to a human. LLM review is part of the policy layer and does not replace the PermissionRequest hook.