Skip to content

GthConfig

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/config/types.d.ts:102

This is a processed Gaunt Sloth config ready to be passed down into components.

Default values can be found in DEFAULT_CONFIG

optional a2aAgents?: Record<string, unknown>

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/config/types.d.ts:358

A2A (Agent-to-Agent) protocol agents configuration. Enables delegation of tasks to external AI agents. Each agent becomes available as a tool named a2a_agent_<agentId>. This feature is experimental and may change.

https://a2a-protocol.org/


optional acp?: object

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/config/types.d.ts:417

EXT-117 — the ACP (Agent Client Protocol) surface, i.e. a session an editor such as Zed opens.

mode is the command an ACP session is resolved under, and it defaults to code: an editor asks for an agent that can do the job, and a read-only one is a worse default than an occasional prompt. Set acp: { mode: 'chat' } for a read-only editor agent.

The deliberate consequence, because it is what makes this overridable without a second parallel config surface: the mode names an EXISTING command, so an ACP session is configured by that command’s own block. At the default the session takes its filesystem, approvals, builtInTools and mode prompt from GthConfig.commands.code — the same settings gth code runs under — and at chat from commands.chat. There is no ACP-only copy of those knobs to keep in step.

Defaulted at the read site (not in DEFAULT_CONFIG) to avoid churning the effective-config snapshot, à la injectModelContext.

optional mode?: "chat" | "code"


optional agent?: object

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/config/types.d.ts:117

Selects the agent backend.

lean — the plain LangChain agent (GthLangChainAgent), given gsloth’s full toolset (filesystem + hardened dev/shell + the gth_checklist planning tool) — is the only backend, and what runs when the key is omitted. Every command resolves the same one, so the key selects nothing today; it exists so a config can name what it runs on, and so a second backend has a name to arrive under.

The retired deep value is a hard config error, not a coercion — see RETIRED_AGENT_BACKENDS in config/schema.ts for why substituting a different agent for the one a config named is the wrong kindness.

optional backend?: "lean"


optional aiignore?: object

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/config/types.d.ts:360

optional enabled?: boolean

optional patterns?: string[]


optional allowDirs?: string[]

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/config/types.d.ts:488

Transient (runtime-only) extra filesystem roots the agent may read/write for THIS run, in addition to the cwd sandbox. Populated by gth exec --allow-dir <path> (repeatable); never persisted to a config file.

Currently inert. The permission layer that widened the sandbox belonged to the deepagents backend; the filesystem toolkit the lean agent uses is rooted at the cwd and has no notion of extra roots. The field, the flag and the config merge policy are kept so a config and a script that already declare roots keep working when widening returns, and gth exec says plainly that the flag does nothing rather than announcing a widening that never happens — a warning about a guardrail that was not actually removed teaches the user to distrust the warnings.


optional allowedTools?: string[]

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/config/types.d.ts:229

Restrict the agent to this allow-list of tool names, applied after every tool source (filesystem, built-in, custom, MCP, A2A, and tools) is resolved. This is the only knob that can gate MCP and A2A tools, which have no per-source override of their own.

  • omitted/undefined: no filtering, all resolved tools remain available.
  • non-empty array: keep only tools whose name is in the list.
  • empty array []: disable every tool. MCP servers are not even contacted (no OAuth), which is useful for agents that only need to reason over the prompt (e.g. the review agent).

Can be overridden per command via commands.<command>.allowedTools.


optional approvals?: ApprovalsConfig

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/config/types.d.ts:214

CFG-27 — the tool-approval ladder: one of the five rungs (manual · write · assisted · auto · bypass), written either as the bare rung name or as an object carrying the rater’s identity profile and the declared allow/deny lists. Each rung fully determines behaviour — there are no severity thresholds, no strictness levels and no independent rater switch.

Settable at the root or per command (commands.<command>.approvals). §9.1 — a per-command value overrides only the fields it NAMES. mode, rater and raterTimeoutMs replace the root’s; deny and escalate CONCATENATE across every scope, so a per-command rung can never discard the root’s prohibitions; allow is REPLACED when the command states its own and inherited when it does not, so a scope may narrow what runs unprompted and may never widen what is prohibited (§3.1: a too-broad allow entry runs unrated, a missed deny entry does not). Absent = assisted, resolved by resolveApprovals.


optional askWriteMode?: boolean

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/config/types.d.ts:494

Transient (runtime-only) flag set by gth ask --write: opt ask into the same “do-the-job” filesystem + dev tools that exec/code get, so a question can act (read/write files, run commands) rather than only chat. Never persisted to a config file.


optional binaryFormats?: false | BinaryFormatConfig[]

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/config/types.d.ts:141

Binary format support configuration. Disabled by default unless explicitly configured.


optional builtInTools?: BuiltInToolsSetting

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/config/types.d.ts:198

Selects and configures the built-in tools the agent loads. Either a string[] of tool names (each enabled) or a registry keyed by tool name whose values enable (true), force-disable (false), or configure (BuiltInToolConfig) each tool. CFG-18 folded the former per-command devTools (the run_* commands + run_shell_command’s EXT-9/10/12 config) into this single registry: e.g. { "run_tests": { "command": "npm test" }, "run_shell_command": { "timeout": 300000 } }. Settable at the root or per command (commands.<command>.builtInTools); a per-command value replaces the top-level one.


optional builtInToolsConfig?: BuiltInToolsConfig

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/config/types.d.ts:359


canInterruptInferenceWithEsc: boolean

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/config/types.d.ts:305

Allow inference to be interrupted with esc. Only has an effect in TTY mode.


optional commands?: object

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/config/types.d.ts:364

optional api?: object

optional approvals?: ApprovalsConfig

§9.1 — per-command approvals posture. It overrides only the fields it NAMES: mode, rater, raterTimeoutMs and allow replace the root’s, while deny and escalate concatenate with it. See GthConfig.approvals.

optional builtInTools?: BuiltInToolsSetting

optional cors?: object

optional allowHeaders?: string

optional allowMethods?: string

optional allowOrigin?: string

optional filesystem?: string[] | "none" | "all" | "read"

optional port?: number

optional ask?: CommandToolingConfig

optional chat?: CommandToolingConfig

optional code?: CommandToolingConfig

gth code — interactive coding session. Carries the do-the-job tool/filesystem knobs; the dev/shell tools (CFG-18) are configured via CommandToolingConfig.builtInTools.

optional exec?: CommandToolingConfig

gth exec — prompt-as-script runtime. Like code, an exec run may need to actually do the job (read/write files, run commands), so it carries the same tool/filesystem knobs.

optional pr?: PrCommandConfig

optional review?: CommandToolingConfig & object

optional contentSource?: string

optional rating?: RatingConfig

optional requirementSource?: string


optional commit?: object

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/config/types.d.ts:431

GS2-35/EXT-83 — identity for the Co-Authored-By trailer of agent-authored git commits. Gaunt Sloth has no dedicated commit tool (it commits via run_shell_command), so this identity is injected into the code-mode system prompt, which instructs the agent to co-author commits as this account. Optional and defaulted, each field independently: when the name is unset the default is DEFAULT_COMMIT_CO_AUTHOR_NAME decorated with the resolved active model — Gaunt Sloth (provider:model) — falling back to the bare DEFAULT_COMMIT_CO_AUTHOR_NAME when no model resolves or injectModelContext is false; when the email is unset it is DEFAULT_COMMIT_CO_AUTHOR_EMAIL. A CONFIGURED name is emitted verbatim — the model identity decorates only the default.

optional coAuthor?: object

optional email?: string

optional name?: string


optional consoleLevel?: StatusLevel

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/config/types.d.ts:323

Console logging level. Only messages at or above this level will be displayed. Valid values: ‘debug’, ‘info’, ‘display’, ‘success’, ‘warning’, ‘error’, ‘stream’ Default: ‘info’ (not debug)


contentSource: string

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/config/types.d.ts:147

Content source type. Source used to fetch content (usually diff) for review or pr command.

DEFAULT_CONFIG#contentSource


optional contentSourceConfig?: Record<string, unknown>

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/config/types.d.ts:326


optional customTools?: CustomToolsConfig

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/config/types.d.ts:324


optional debugDump?: object

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/config/types.d.ts:473

GS2-47 — controls the shared secret-redaction pass applied to /debug-dump archives. Default ON (omitted = redact): secret-named env-var values, inline config secrets, provider-key/auth patterns and sensitive config fields are masked before any artifact hits disk. Set debugDump.redact: false (or run /debug-dump --unsafe-no-redact) to write a RAW archive, which the command flags with a loud “may contain secrets” warning. Defaulted at the read site (not in DEFAULT_CONFIG) to avoid churning the effective-config snapshot.

optional redact?: boolean


optional debugLog?: boolean

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/config/types.d.ts:310

Log messages and events to gaunt-sloth.log, use llm.verbose or gth --verbose as more intrusive option, setting verbose to LangChain / LangGraph


filesystem: string[] | "none" | "all" | "read"

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/config/types.d.ts:188


optional history?: object

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/config/types.d.ts:126

GS2-7 (B20) — local, opt-in session history store. DEFAULT OFF (absent = disabled): a default run persists nothing and behaves exactly as before. When enabled, each run is recorded to a local SQLite DB (~/.gsloth/history.db by default, overridable via dbPath) for gth history search / gth insights. Local only — no telemetry leaves the machine.

optional dbPath?: string

optional enabled?: boolean


optional identityProfile?: string

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/config/types.d.ts:167

Separate identity profile. May include separate identity, guidelines and command protocol, making gsloth behave as an agent different from default profile behaviour. for example, devops profile to detect changes such as properties and environment variables. Custom config can still win over this one. This setting requires .gsloth/.gsloth-settings directory to exist.


includeCurrentDateAfterGuidelines: boolean

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/config/types.d.ts:171

Whether to include the current date in the project review instructions or not.


optional injectModelContext?: boolean

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/config/types.d.ts:464

GS2-34 — inject the resolved active provider:model identity into the assembled system prompt so the agent knows which model is serving it (to answer “what model are you?” and reason about its own capabilities/limits). Default ON (omitted = inject). Opt out with injectModelContext: false to keep reproducible / model-agnostic runs (e.g. review) blind to the identity — when off, the assembled prompt is exactly as it is without this feature.

EXT-83 — it governs the model identity EVERYWHERE in the prompt, not just the identity line: in code mode the same resolved identity decorates the default git commit co-author name (GthConfig.commit), so turning this off also removes the model from the commit trailer, which degrades to the plain default name. The identity LINE applies in all modes; the trailer it also feeds is code-mode-only, like the cwd/os-shell notes. Defaulted at the read site (not in DEFAULT_CONFIG) to avoid churning the effective-config snapshot.


llm: BaseChatModel

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/config/types.d.ts:103


optional mcpServers?: Record<string, unknown>

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/config/types.d.ts:332

MCP (Model Context Protocol) server connections. Allows connecting to external MCP servers including those requiring OAuth.

https://modelcontextprotocol.io/


optional memory?: object

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/config/types.d.ts:134

GS2-7 (B21) — opt-in file-backed memory (MEMORY.md / USER.md). DEFAULT OFF. Forward-compat toggle only; the feature is a deferred follow-up.

optional enabled?: boolean


optional middleware?: unknown[]

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/config/types.d.ts:262

Middleware configuration for LangChain v1. Middleware provides hooks to intercept and control agent execution at critical points.

Middleware can be:

  • Predefined middleware (string or config object) - works in both JSON and JS configs
  • Custom middleware objects - only available in JS configs

Example (JSON config):

{
"middleware": [
"summarization",
{ "name": "anthropic-prompt-caching", "ttl": "5m" }
]
}

Example (JS config):

{
middleware: [
"summarization",
{ beforeModel: (state) => { /* custom logic */ return state; } }
]
}

Available predefined middleware:

  • anthropic-prompt-caching: Reduces API costs by caching prompts (Anthropic only)
  • summarization: Condenses conversation history when approaching token limits

optional modelDisplayName?: string

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/config/types.d.ts:437


optional modelProviderType?: string

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/config/types.d.ts:449

GS2-53 — the configured provider type string (openrouter/deepseek/xai/anthropic/…), stashed by the loader from the raw llm.type before the built BaseChatModel replaces the raw spec. INTERNAL (loader-set, never user-supplied), so it is deliberately absent from the config schema. import(‘#src/utils/systemPromptNotes.js’).resolveModelIdentity PREFERS this over the live model’s _llmType() for the injected identity, because that is the model class’s own label rather than the gth provider namespace (huggingface reports openai, and both Gemini providers report google) and would otherwise mislabel the provider half. Absent for module configs (which hand us an already-built LLM with no raw type), where resolution falls back to the guarded _llmType().


optional noDefaultPrompts?: boolean

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/config/types.d.ts:187

If true, only use user-provided system prompts. Do not fall back to the bundled .gsloth.*.md prompt files shipped with the installation. This applies to all .gsloth.*.md files (backstory, system, chat, code, guidelines, review).


optional organization?: object

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/config/types.d.ts:177

Organisation name, locale and timezone. Only used with includeCurrentDateAfterGuidelines. timeZone and locale should be in format supported by Intl.DateTimeFormat

optional locale?: string

optional name?: string

optional timezone?: string


optional output?: object

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/config/types.d.ts:514

GS2-93 — output surface controls.

output.header grades what a NON-TUI text run (--no-tui, ask, exec, eval, pr, review, piped/CI) opens with, across three rungs:

  • debug — the full technical preamble: the Workdir/Model/Tools/Middleware status block, the Press Escape or Q to interrupt hint, and their surrounding blank lines.
  • compact (the DEFAULT, so an unset key opens with this) — no preamble, and one attribution line naming the command and the model that served it. review/pr render their existing attribution block instead of this line.
  • none — nothing at all, including the review attribution block, for a byte-clean stream a caller can diff or template.

The interactive TUI ignores the setting and always shows the full header. Only the opening is graded — never model/tool output, errors, or config-validation warnings, and never the live Thinking… indicator. Defaulted at the read site, not in DEFAULT_CONFIG, to avoid churning the effective-config snapshot.

optional header?: "none" | "compact" | "debug"


optional prompts?: Partial<Record<PromptSegmentName, PromptSegmentSetting>>

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/config/types.d.ts:158

GS2-43 — the unified prompt-segment config (see PromptsConfig). Each of the seven segments (backstory | guidelines | system | chat | code | exec | review) accepts a string path (e.g. "guidelines": "AGENTS.md") or an object ({ path?, enabled?, mode? }). When a segment is omitted its default-named file / bundled default applies unchanged.


optional recursionLimit?: number

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/config/types.d.ts:317

LangGraph recursion limit for an agent run — the maximum number of super-steps (model ↔ tool round-trips) before the graph throws. Defaults to 1000, which suits long coding chains; embodied / tight-loop consumers can lower it so a stuck run fails fast and visibly instead of grinding.


optional reporters?: Record<string, string>

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/config/types.d.ts:561

BATCH-19 — custom gth eval reporters, keyed by the NAME they are selected under (gth eval … --reporter <name>). Each value is a MODULE PATH, resolved relative to the project dir, whose default export is an EvalReporterFactory (() => EvalReporter). Loaded and registered through the SAME seam the bundled reporters (text, junit) use, so a config reporter can also override a built-in of the same name (config wins). A missing file, a failed import, or a non-function default export is a hard error (the eval harness exits 2). Trusted: it is the user’s own config, which already executes arbitrary JS.


requirementSource: string

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/config/types.d.ts:151

Requirement source type. Source used to fetch requirements for review or pr command.


optional requirementSourceConfig?: Record<string, unknown>

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/config/types.d.ts:325


streamOutput: boolean

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/config/types.d.ts:268

Stream output. Some models do not support streaming. Set value to false for them.

DEFAULT_CONFIG#streamOutput


streamSessionInferenceLog: boolean

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/config/types.d.ts:301

Stream session log instead of writing it when inference streaming is complete. (only works when streamOutput is true)


optional subagents?: SubagentProfileSpec[]

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/config/types.d.ts:571

GS2-33 — profile-backed subagents. Each entry names a subagent and the named config profile the CHILD resolves when the parent spawns it, so a subagent can run under a different model/tools/prompt than the parent (a cheap profile for recall/search while the parent runs on a strong model). Currently honored by nothing: its only consumer was the deep (deepagents) backend, whose task tool gained one selectable subagent per entry, and that backend has been removed. The key is still accepted and warns on use; the lean backend’s own subagent primitive lands in GS2-25.


optional tls?: object

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/config/types.d.ts:339

TLS trust for outbound HTTPS. Primarily so an http-transport MCP server behind a private/corporate CA can be reached without prepending NODE_EXTRA_CA_CERTS on every invocation. The mechanism is a process-global undici dispatcher, so it applies to ALL outbound fetch this process makes (LLM provider calls included), not only MCP.

optional extraCaCerts?: string[]

Extra CA certificate file(s) to trust IN ADDITION to Node’s built-in roots. Paths resolve relative to the project dir (or ~/absolute). Additive — never removes a default root.

optional rejectUnauthorized?: boolean

DANGER — false disables TLS certificate verification for ALL outbound HTTPS this process makes, not just MCP. Escape hatch only; a loud security warning is emitted every session.


optional toolLoopGuard?: boolean | { halt?: boolean; threshold?: number; warn?: boolean; }

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/config/types.d.ts:533

EXT-36 — the tool-loop guard: a repeated-identical-(tool, args) / no-progress detector that runs as a lean-backend beforeModel middleware, the orthogonal sibling of GS2-36’s consecutive-tool-ERROR budget. It catches the case GS2-36 leaves open — a model re-issuing the SAME call verbatim, whether it keeps erroring or keeps “succeeding” with the same result.

  • false disables it entirely.
  • true / omitted → WARN on, HALT off, default threshold (DEFAULT_TOOL_LOOP_THRESHOLD).
  • object → per-field: warn (default ON) injects a control-flow-free nudge at the threshold; halt (default OFF, opt-in) ends the run cleanly (jumpTo:'end', never a throw) at the threshold; threshold is the number of consecutive identical calls that trip it.

WARN is provably harmless (no routing effect, one nudge per signature per streak). The WARN-on default is applied at the read site (not in DEFAULT_CONFIG) to avoid churning the effective-config snapshot.


optional tools?: StructuredToolInterface<ToolInputSchemaBase, any, any>[] | BaseToolkit[] | ServerTool[]

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/config/types.d.ts:215


optional tui?: boolean

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/config/types.d.ts:551

CFG-37 — persistent surface preference for the chat/code interactive sessions, settable in both the global and the project config (the project layer wins). true asks for the Ink TUI, false for the plain readline session, absent leaves the terminal auto-detect in charge — which is why it must stay optional, exactly as useColour/useMouse do.

This is the CONFIG-FILE preference, one rung of a chain rather than the answer: the --tui/--no-tui flags and the GTH_NO_TUI escape hatch both outrank it, and the capability gates (no TTY, TERM=dumb, ink not installed) outrank everything because they are checks and not preferences — so true degrades to readline rather than forcing a crash. Deliberately NOT in DEFAULT_CONFIG. The flag arrives separately as CommandLineConfigOverrides.tui; the two meet only in shouldUseTui.


useColour: boolean

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/config/types.d.ts:289

Use colour in output


useMouse: boolean

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/config/types.d.ts:296

Enable terminal mouse reporting in the Ink TUI, making its affordances clickable. On by default in an interactive terminal. While it is on the terminal’s own text selection needs a modifier (Shift, or Option in some macOS terminals) — set this to false, or set GTH_NO_MOUSE, to get unmodified selection back.


writeBinaryOutputsToFile: boolean

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/config/types.d.ts:285

Whether binary model outputs should be written to files instead of printed inline. When enabled, supported binary content blocks are materialized as gth_*.<ext> files.


writeOutputToFile: string | boolean

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/dist/config/types.d.ts:280

Should the output be written to md file. (e.g. gth_2025-07-26_22-59-06_REVIEW.md). Defaults to false (no file is written); set to true for the standard gth_<timestamp>_<COMMAND>.md name. Can be set to false with -wn or -w0 Can be set to a specific filename or path by passing a string:

  • Bare filenames (e.g. "review.md") are placed in .gsloth/ when it exists, otherwise project root
  • Paths with separators (e.g. "./review.md" or "reviews/last.md") are always relative to project root Please note the string does not accept absolute path, but allows to exit project with .. if necessary.