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.
Approval Modes
Section titled “Approval Modes”Mode overview
Section titled “Mode overview”| 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.
Decision order
Section titled “Decision order”Each tool call goes through:
PreToolUsehook decision:denyrejects;askforces human;allowbypasses the policy layer.- Risk classification (including bash dangerous-command escalation).
- Policy layer:
autoallows;readallows; undersmart,modifyfirst asks the LLM reviewer. - When human review is needed:
manual/smartprompt; underautothe call returnspermission.hook_requires_interaction. - The
PermissionRequesthook can override the final decision. - Human confirmation:
yallows once; ordinary modifications acceptsfor the session;N/Escdenies.
Smart Approval details
Section titled “Smart Approval details”- Uses the same provider and credentials as the main task, with model
approvalModel(falling back tomodelwhen 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.
auto mode boundaries
Section titled “auto mode boundaries”- It skips only tool-call confirmations; workspace trust, project plugin confirmation, and hooks all run as usual.
- A
PreToolUsereturningdenyrejects; one returningasksafely rejects (permission.hook_requires_interaction). - Outside-workspace
read/write/editreturnpermission.outside_workspace_denied, suggesting--auto --allow-outside-workspace.
Session authorization
Section titled “Session authorization”s(allow_session) records a session-scoped grant only formodify-level tools;dangerousoffers no such option.- The grant persists across turns within the same session, and
/newresets the conversation without clearing it (the set is bound to the current application instance).
Related references
Section titled “Related references”Smart Approval
Section titled “Smart Approval”Trigger
Section titled “Trigger”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).
Review model
Section titled “Review model”- Uses the same provider and credentials as the main task; the model is
approvalModel, falling back tomodel. - One independent request per ordinary modification:
maxOutputTokens256 with a 30-second timeout. - The review system prompt marks the payload as untrusted data and requires a single JSON object (
decision+reason).
Decision protocol
Section titled “Decision protocol”| 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.
Strictness
Section titled “Strictness”| 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 |
Cost and visibility
Section titled “Cost and visibility”- 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.
Relationship to hooks
Section titled “Relationship to hooks”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.