Skip to content

Default Behavior Specification ​

This is the single authoritative document for ai.agent.* default behavior (#735). Code defaults live in packages/im/agent/src/config/zhin-agent-defaults.ts; see the generated config reference for field details.

Defaults by scenario ​

ScenarioTrust levelDefault behavior
Owner DMownerAll enabled tools; no shell while execSecurity: deny; with masterShell: isolated, an isolated bash only in the owner's DM; auto-continue on tool-budget exhaustion (autoContinue: master_dm, max 2); progress updates in private only
Group chatgroup_memberInbound queue groupMode: supersede (newer message replaces queued turns, max 5 queued); high-risk external content needs confirmation; outbound content redacted (outboundCheck: redact)
Trusted membertrusted_memberSame guardrails as group members plus trusted tools; non-IM ingress (CLI, HTTP) counts as trusted_member
Stranger DMgroup_memberTreated as a group member; no elevation
Unattended schedule—maxTokens 32000, maxToolCalls 15, timeoutMs 120000, execPreset: readonly

Core defaults ​

  • Loop: maxIterations 15, timeout 120000 ms
  • Exec: execSecurity deny, execApprovalMode auto; network only with execPreset: network
  • Sub-agents: subagentTurnMode off
  • Tool budget: extendBy 10, progressWindow 5, maxTotalIterations 40, maxWallClockMs 600000, failureStreakLimit 3, repeatLimit 2
  • Usage quota: all 0 (off), exemptOwner true
  • Compaction: thresholdRatio 0.7

Switch inventory and disposition ​

Dispositions: keep, preset (advanced, use defaults), merge-candidate, debug, internal (code only), deprecated.

SwitchDispositionNotes
personakeepCommon switch, kept
maxIterationskeepCommon switch, kept
timeoutkeepCommon switch, kept
chatModelkeepCommon switch, kept
visionModelkeepCommon switch, kept
contextTokenskeepCommon switch, kept
execSecuritykeepCommon switch, kept
execPresetkeepCommon switch, kept
execAllowlistkeepCommon switch, kept
execApprovalModekeepCommon switch, kept
disabledToolskeepCommon switch, kept
allowedToolskeepCommon switch, kept
inboundQueuekeepCommon switch, kept
toolBudgetkeepCommon switch, kept
injectionGuardkeepCommon switch, kept
usageQuotakeepCommon switch, kept
schedulekeepCommon switch, kept
masterShellkeepCommon switch, kept
compactionkeepCommon switch, kept
rateLimitkeepCommon switch, kept
preExecTimeoutpresetAdvanced tuning; defaults are recommended
maxToolspresetAdvanced tuning; defaults are recommended
contextTailMessageLimitpresetAdvanced tuning; defaults are recommended
toneAwarenesspresetAdvanced tuning; defaults are recommended
maxHistorySharepresetAdvanced tuning; defaults are recommended
maxParallelSubagentspresetAdvanced tuning; defaults are recommended
toolExecutionpresetAdvanced tuning; defaults are recommended
subagentAutoContinuepresetAdvanced tuning; defaults are recommended
subagentDirectImDeliverypresetAdvanced tuning; defaults are recommended
maxSubagentIterationspresetAdvanced tuning; defaults are recommended
subagentTurnModepresetAdvanced tuning; defaults are recommended
subagentToolspresetAdvanced tuning; defaults are recommended
subagentTurnWaitMspresetAdvanced tuning; defaults are recommended
modelSizeHintpresetAdvanced tuning; defaults are recommended
skillInstructionMaxCharspresetAdvanced tuning; defaults are recommended
modelHarnesspresetAdvanced tuning; defaults are recommended
providerResiliencepresetAdvanced tuning; defaults are recommended
providerTimerspresetAdvanced tuning; defaults are recommended
promptCachepresetAdvanced tuning; defaults are recommended
promptCacheRetentionpresetAdvanced tuning; defaults are recommended
promptCacheKeyPrefixpresetAdvanced tuning; defaults are recommended
deferredToolspresetAdvanced tuning; defaults are recommended
workerBaseToolspresetAdvanced tuning; defaults are recommended
outputSchemapresetAdvanced tuning; defaults are recommended
steeringModepresetAdvanced tuning; defaults are recommended
followUpModepresetAdvanced tuning; defaults are recommended
deferredAutoContinuepresetAdvanced tuning; defaults are recommended
deferredAutoContinueMaxDepthpresetAdvanced tuning; defaults are recommended
gitStatuspresetAdvanced tuning; defaults are recommended
contextPathspresetAdvanced tuning; defaults are recommended
systemPromptMaxCharspresetAdvanced tuning; defaults are recommended
thinkingPreviewpresetAdvanced tuning; defaults are recommended
thinkingPreviewMaxLengthpresetAdvanced tuning; defaults are recommended
subagentExecApprovalModemerge-candidateFuture merge into per-role overrides of execApprovalMode
workerExecApprovalModemerge-candidateFuture merge into per-role overrides of execApprovalMode
phaseTracedebugDiagnostics only
promptTracedebugDiagnostics only
promptTraceVerbosedebugDiagnostics only
onPhaseTraceinternalCode-only callback, not YAML-configurable
maxSkillsdeprecatedUnused at runtime; deprecated (#735), removed by --fix
policyDenialStopAfterdeprecatedUnused at runtime; deprecated (#735), removed by --fix
deferredToolMaxResultsdeprecatedUnused at runtime; deprecated (#735), removed by --fix
taskExecApprovalModedeprecatedUnused at runtime; deprecated (#735), removed by --fix

Deprecation path and compatibility ​

  1. Deprecated keys are still accepted and never block startup;
  2. A warning is logged once per deprecated key at startup;
  3. zhin config check reports ai.agent_<key>_deprecated;
  4. zhin config check --fix removes them;
  5. Types keep them for at least one minor release before removal.

Gate for new switches ​

Every new ai.agent.* switch must be added to the table above and justified in the PR template. pnpm check:agent-config-inventory (part of pnpm check:all) verifies the inventory is complete and that the non-deprecated switch count does not exceed the baseline.