Git, Process and Environment Safety
The boundaries around commands Daintree runs on your behalf: git command and pathspec hardening, lifecycle script injection, pattern-based secret scrubbing on participating diagnostic paths, environment variable filtering, and what skip-permissions turns off.
What an agent can reach
Start here, because it frames everything below. An agent Daintree launches is a CLI running as a normal child process under your OS user account. It has the file access, the network access and the credentials that account has. A worktree gives it a separate checkout so two agents do not edit the same working copy; it is not a sandbox, and nothing stops an agent reading or writing a path outside the project.
That is a deliberate trade. The agents Daintree hosts are the same CLIs you would run in a terminal, and confining them would break most of what they are for. Remote Compute is the supported way to move that execution off your machine when the trade is not one you want to make. Everything on this page is about narrowing what Daintree itself does on your behalf, inside that boundary.
Remote Hosts also moves the agents to another machine, but it
does not narrow what they can reach: on a host they run as your user there, with that account's
files, network and credentials. Daintree's own ssh connection to a host is set up
separately from the Git hardening below; its options are listed on Remote Host Security.
Git hardening
A malicious repository can carry git config directives that run arbitrary code the moment git runs inside it. This is a real supply-chain vector: a cloned repo can point core.fsmonitor, core.pager or protocol.ext.allow at a command on your machine.
Daintree routes every git call through a hardened wrapper that forces per-invocation -c overrides. They take precedence over anything in the repository's own config, they apply only to git processes Daintree spawns, and they do not touch your system git configuration or the git commands you run yourself in a terminal.
There are three profiles, not one, because a wrapper that can never authenticate cannot push.
| Override | Profile | What it neutralizes |
|---|---|---|
core.fsmonitor=false | All | Code execution through the fsmonitor hook. |
core.pager=cat | All | Pager injection. |
protocol.ext.allow=never | All | Execution through ext:: protocol URLs. |
core.gitProxy= | All | Proxy command injection. |
core.untrackedCache=keep | All | Reads an existing untracked cache without creating one or stripping it on the next index write. |
core.quotepath=false | All | Not a threat: correctness. Emits literal UTF-8 so a non-ASCII filename is not returned octal-escaped. |
core.precomposeunicode=true | All | Also correctness. Pins macOS decomposed filenames to composed form so paths from different sources compare equal. |
core.askpass= | Hardened only | Credential hijacking through askpass. |
credential.helper= | Hardened only | Credential store hijacking. |
core.sshCommand=ssh -o StrictHostKeyChecking=accept-new -o BatchMode=yes -o ConnectTimeout=15 | Hardened only | A repository-supplied ssh transport. Pinned rather than blanked, because git runs an empty value as the transport program and every ssh URL then fails. BatchMode stops ssh asking for a password, passphrase or host key no one can answer; accept-new trusts a host key the first time it is seen and refuses one that has changed. |
The hardened profile is the default: it blanks the credential helper and askpass and pins the ssh command above. The authenticated profile omits those last three so a push or fetch can use your own credentials and ssh setup. The safe base is what both are built from.
core.hooksPath is no longer blank. It is appended per call as an app-owned absolute directory under Daintree's user-data folder, so repository hooks stay blocked while Daintree can still run its own small allowlisted set, git-lfs's pre-push hook being the one that matters. A WSL variant resolves the same directory inside the distro, because a Windows-side path is meaningless to git running under Linux.
The inherited environment is sanitized too. GIT_CONFIG, GIT_CONFIG_GLOBAL, GIT_CONFIG_SYSTEM, the numbered GIT_CONFIG_KEY_n / GIT_CONFIG_VALUE_n pairs, GIT_EXEC_PATH, GIT_EXTERNAL_DIFF, GIT_SSH, GIT_SSH_COMMAND, GIT_PROXY_COMMAND, GIT_TEMPLATE_DIR, the pagers and the editors are all stripped before the spawn. GIT_TERMINAL_PROMPT=0 and a POSIX GIT_ASKPASS that exits immediately block the interactive credential prompt that would otherwise hang the main process forever; on Windows, GCM_INTERACTIVE=Never stops Git Credential Manager opening a sign-in window nobody can answer.
Working directories are checked before any git call runs (only absolute paths are accepted, which blocks relative-path injection from the renderer), and a 30-second block timeout keeps a single operation from hanging indefinitely.
File paths reach git as literal pathspecs
This one is worth stating plainly, because it was a data-loss class rather than a hardening nicety, and v0.32 closed it.
Every path Daintree hands to git is meant as a literal filename: a name read out of a git file list, a directory derived from a search root. Git does not read them that way by default: it parses them as pathspecs, where wildmatch metacharacters are matched, not taken literally. A perfectly legal filename can therefore select a different file. A Next.js route named pages/[...slug].tsx is a character class matching one of ., s, l, u, g, so it resolves to siblings like pages/s.tsx and not to the file itself.
That mis-selection reached destructive commands. Discarding one file's uncommitted changes could silently discard a different file's instead. A trailing -- does not help; it only stops a leading dash being read as an option.
The hardened environment now sets GIT_LITERAL_PATHSPECS=1 globally, so no future call site can reintroduce the class one command at a time. The three competing global pathspec modes are stripped from the inherited environment, because git hard-fails with exit 128 when the glob or case-insensitive mode is set alongside literal, which would otherwise turn every path-bearing command into a hard failure for anyone who exports one in their shell.
Lifecycle command injection
Lifecycle commands in .daintree/config.json run with shell: true and support {{variable}} and {variable} placeholders, substituted before the command string is assembled. The trust boundary sits around the command text the config defines, not the runtime values substituted into its placeholders. Branch names come from git, so a collaborator pushing a branch named feature/$(whoami) would inject shell into any lifecycle command that substitutes {{branch}} on checkout.
Daintree closes this by wrapping every substituted value in shell-safe quoting before it reaches the command string. The escaping runs at every substitution site rather than for one variable, so {{branch}}, {{worktree_path}}, {{worktree_name}}, {{project_root}}, {{endpoint}}, {repo-name}, {base-folder} and {parent-dir} all get the same treatment. A value carrying spaces, quotes, dollar signs, backticks, semicolons or pipes cannot break out of its argument.
| Platform | Escaping applied |
|---|---|
| macOS, Linux | Wrapped in single quotes; an internal ' becomes '\''. So $(whoami) substitutes as '$(whoami)' and reaches the shell as a literal string. |
| Windows | Wrapped in double quotes; an internal % becomes %% so environment expansion does not fire, and an internal " becomes "". |
One placeholder is deliberately left unquoted: {branch-slug}. Its value is sanitized to [a-z0-9-] at generation time, so the character set itself proves it cannot contain anything the shell would interpret. If a value ever fails that check, it falls back to the same quoting as everything else.
git checkout "{{branch}}" produces git checkout "'my-branch'" after substitution, which double-quotes the value and breaks the command. Keep placeholders bare and let Daintree do the quoting.For the full variable list, see Remote Compute > Template variables.
Repository commands wait for your approval
Quoting protects the values substituted into a command. It does nothing about the command itself, and the lifecycle config is looked up per worktree, so any branch, including a pull request from a fork, can carry its own .daintree/config.json. Lifecycle commands that come from the repository therefore do not run until you approve them.
When a worktree would run setup, teardown or resource commands from a repository config that you have not approved, its card says Repository commands need your approval to run (or Setup is waiting for you to approve its commands when setup was skipped for that reason) with a Review commands button. The Approve repository commands? dialog lists every command and its phase; Approve commands (or Approve and run setup) records the approval. The dialog re-reads the commands when it opens, and an approval is checked against exactly what it displayed, so a change made while it is open is refused rather than approved unseen.
An approval is keyed by the project and the exact command lines, not by the file, so every new worktree carrying the same config runs without asking again, and any change to a command, or to the phase or environment it belongs to, asks again. Approvals live in Daintree's own data folder, not in the repository. Commands from your personal config at ~/.daintree/projects/…/config.json are yours and run without approval.
npm run setup trusts whatever setup does on that branch, and the dialog says so.Secret scrubbing
Logging, error envelopes, crash-report fields, agent probes, plugin logs, and MCP argument summaries use the shared scrubSecrets() utility at their respective output boundaries. It matches known credential patterns and replaces matches with the literal string [REDACTED]. This is pattern-based redaction, not a guarantee that every possible secret is recognized or that every string crossing IPC is scrubbed. It is idempotent, so callers can wrap defensively without producing double-redaction artifacts, and the patterns use bounded quantifiers throughout, so a multi-megabyte log dump still finishes in linear time.
Patterns are grouped by category. This table is representative, not exhaustive:
| Category | Examples |
|---|---|
| Source hosts | GitHub tokens (ghp_, github_pat_, ghs_, ghu_, gho_), GitLab (glpat-, gldt-) |
| AI providers | Anthropic (sk-ant-), OpenAI (sk-, sk-proj-, sk-svcacct-, sk-admin-), OpenRouter, Perplexity, xAI, Together, Groq, Replicate, Hugging Face |
| Cloud and infrastructure | AWS access keys (AKIA, ASIA, ABIA) and context-anchored secret keys, Google API keys, Azure connection strings, DigitalOcean, Cloudflare |
| Deploy and SaaS | Vercel, Heroku, Resend, Stripe live and test keys, Supabase, Linear, Notion, Atlassian |
| Messaging | Slack (xoxb-, xoxp-, xapp-, xoxe-), SendGrid, and context-anchored Telegram and Datadog |
| Generic shapes | PEM private key blocks, JWTs, Bearer tokens, OAuth access_token / refresh_token / client_secret query parameters, https://user:pass@host basic-auth URLs, and env-shaped fallbacks for credential-named variables |
Context-anchored means the pattern looks for the surrounding key name rather than the token shape, because the value itself is a bare alphanumeric string nothing else can distinguish from an arbitrary identifier.
The scrubber is used across the main process, workspace host, PTY host and shared layer. In broad strokes:
- Logging and crash paths: the logger's file-write and console-mirror, both emergency crash logs, the diagnostics collector, and the telemetry
beforeSendhook. - IPC and error surfaces: error envelopes, both
messageanduserMessage. - Agent surfaces: install progress, help output, version-probe errors, and worktree lifecycle tail output before it reaches the renderer.
- Newer surfaces: project check output, git clone output, forge audit records, the MCP HTTP lifecycle, and MCP argument summaries.
- Plugin surfaces: plugin log output is scrubbed before it reaches the log buffer and console mirror, as are plugin diagnostics. Recognized credential patterns are redacted before storage; arbitrary secrets can still require manual removal.
Anything outside that set which emits user-shaped strings has to call scrubSecrets() explicitly.
Canopy, when you turn it on, runs its own pattern-based redaction over each terminal screen before it leaves your machine: known key shapes, Bearer and Authorization values, password and token flags, credential assignments in env, JSON and YAML form, and passwords in connection strings. It has the same limit as the scrubber above: it can miss a secret it has no pattern for.
Environment variable filtering
When Daintree spawns a terminal or agent process, it filters the inherited environment to remove recognized credential variables. The filter removes recognized credentials inherited by Daintree. A shell startup file can still export them again, and agents can read credentials available to your account.
Blocklist
An exact blocklist strips 27 known credential variables, including DATABASE_URL, AWS_SECRET_ACCESS_KEY, ANTHROPIC_API_KEY, OPENAI_API_KEY, GITHUB_TOKEN and STRIPE_SECRET_KEY. On top of that, a boundary-aware pattern catches any variable whose name contains SECRET, PASSWORD, PASSWD, TOKEN, CREDENTIAL, PRIVATE_KEY, API_KEY, APIKEY, ACCESS_KEY, SIGNING_KEY or ENCRYPTION_KEY as a word segment. MY_SECRET_VALUE matches; SECRETARIAT does not. Daintree's own NODE_ENV is dropped too, so a terminal's tools never inherit the app's runtime mode.
On Linux, the inherited environment also sheds Daintree's desktop-entry identity and AppImage launcher variables. Path and library lists lose entries pointing into the AppImage mount, so your tools don't load its bundled libraries or depend on a mount that disappears when Daintree exits. When the inherited LANG isn't UTF-8, Linux terminals use C.UTF-8; macOS uses en_US.UTF-8. These platform fixes are part of the Linux release change.
DAINTREE_* anti-spoofing
Inherited DAINTREE_* variables are stripped before terminal spawning. Explicit launch environment overrides are merged afterwards, and Daintree stamps its authoritative pane and working-directory metadata, plus project/worktree identifiers when supplied. This prevents accidental inheritance of stale app context; it does not reject every intentionally supplied variable with that prefix. Review project environment settings as launch configuration.
Agent CLI probe sandboxing
Daintree discovers installed agents by probing them: --version to detect what is installed, --help to pull usage text. These probes need almost nothing from the parent, so they are spawned with an allowlist rather than the blocklist used for real terminals. For a process that needs four variables, an allowlist is the only structurally sound choice; the set of credential names is unbounded, but the set of things a probe needs is not.
| Platform | Allowed keys |
|---|---|
| POSIX (macOS, Linux) | PATH, HOME, LANG, LANGUAGE |
| Windows | PATH, SYSTEMROOT, USERPROFILE, TEMP, TMP, PATHEXT, LANG, LANGUAGE |
Both platforms also pass through LC_* locale extensions and Daintree's own namespace, and always set TERM=dumb to request plain terminal output. The executable can still ignore that convention and emit escapes or start a pager. Everything else is dropped, including LD_PRELOAD and DYLD_INSERT_LIBRARIES (library injection), NODE_OPTIONS (debug-protocol injection) and ELECTRON_RUN_AS_NODE, which requests Node-style behavior from Electron executables that permit it. Environment minimization does not sandbox the probe executable. Nothing is explicitly denied: anything off the list is simply absent.
Probe stdout and stderr both run through secret scrubbing before reaching the renderer, so recognized credential patterns are redacted at the boundary. Arbitrary environment values or unknown secret formats may remain.
Plugin processes
Processes started for a plugin get an allowlist rather than the terminal blocklist: the plugin worker, the processes a plugin starts through the host API (plain or interactive), and the MCP servers a plugin ships. They receive path, home, temp, locale, shell, user and the Windows essentials, and nothing else unless the plugin passes it explicitly. The worker and a plugin's MCP servers also receive proxy and certificate settings, because they exist to reach the network. Anything a plugin's manifest or call names explicitly is added on top. This keeps the API tokens in Daintree's environment away from plugin code; it does not stop that code reading a file your account can read. See Plugin trust and capabilities.
Skip permissions and DangerousMode
Coding agents prompt before they act. Bypassing those prompts is the single most security-relevant setting Daintree exposes, so it is worth being exact about what it does.
Turning it on appends the agent's own bypass flag to its launch command: --dangerously-skip-permissions for Claude, --dangerously-bypass-approvals-and-sandbox for Codex, --yolo, --force, --trust-all-tools and others for the rest of the roster. Daintree is not the thing granting permission; it is passing a flag to a CLI that then stops asking. Every guarantee after that point belongs to the agent, not to Daintree. Nothing on this page contains an agent that has been told not to ask.
The setting is a tri-state (inherit, on, off) resolved through a chain rather than a single boolean, and modeled on explicit-deny precedence: a more specific off always vetoes a broader on.
| Level | Effect |
|---|---|
| Preset | An explicit on or off wins over the agent's own setting. A preset off is a true veto: it beats the global switch. |
| Agent | An explicit on force-enables for that agent; off force-disables it. |
| Global | Skip permission prompts in Settings > CLI agents (General subtab, under All agents), off by default. First-run setup asks the same question as Skip permission prompts for agents. Only reached when both levels above say inherit. |
The global switch is a live override rather than a default: it is combined into the decision at flag-generation time and never mutates any per-agent setting, so turning it off immediately stops injecting bypass flags on future spawns, restarts and resumes. That also closes the resume trap: a session captured under one setting does not carry a stale bypass flag forward when you flip the setting and restart it.
The global switch only reaches agents that declare permission-bypass support, which is Claude Code and Codex. Setting it does not silently turn on bypass for every agent in the roster. Other agents still honor their own explicit on (Gemini's --yolo, for instance, is reachable by setting that agent to on) but the global toggle will not inject a dangerous flag into an agent that has not declared it accepts one.
The Daintree Assistant has two controls of its own under Settings > Daintree Assistant, in the Security section. Skip permission prompts there passes the bypass flag to the CLI running a help session, independently of the global switch. Daintree confirmations decides whether Daintree's own confirmation dialogs appear before the Assistant runs a Daintree action: Follow global setting (the default, which follows the global Skip permission prompts switch), Always ask or Never ask. See AI Agents for per-agent configuration and Global Settings for where the global switch lives.
Source reference: credential patterns, telemetry sanitization, and plugin trust and host API boundaries.