Workspace Trust
A workspace's tasks are code someone wrote: you, a teammate, or whoever published the repo you just cloned. Workspace trust records whose code you trust, so Mochi checks with you before running anything from a workspace you haven't vouched for, and coding agents can't run it at all.
Trust is kept on your machine. A repo can't declare itself trusted.
Trust a workspace
When you add a workspace in the desktop app, Trust this workspace is offered alongside discovery. It starts checked for a folder you picked, and unchecked for a Git repository. You can change it any time in Settings → Workspace trust.
From a terminal:
mochi trust list
mochi trust set my-project trusted
mochi trust set scratch restrictedWhat trust changes
| Who starts the run | Trusted workspace | Any other workspace |
|---|---|---|
| You, in the desktop app | Runs | Asks first: Trust and run, Run once, or Cancel |
| You, in a terminal | Runs | Runs. Typing the command is your confirmation |
| A coding agent | Runs | Refused, with the command that trusts the workspace |
| Mochi's chat | Follows your chat approval settings | Offers Trust and run |
Trust covers the tasks a workspace defines. It doesn't govern commands an agent writes itself; the agent's own approval settings handle those.
Rules for specific tasks
Rules fine-tune a workspace's trust. allow lets matching tasks run in a workspace you haven't trusted. ask requires a check for matching tasks in one you have.
mochi trust rule add scratch allow 'build *'
mochi trust rule add api ask 'deploy *'A pattern is an optional verb and a task name, and * matches anything. The first matching rule wins. To see what would happen for one task:
mochi trust check deploy api:prod-dbWorktrees and unregistered workspaces
Mochi also runs tasks from a workspace you never registered, such as a Git worktree or a fresh clone, when you work inside it. Trust for these works the same way. You name the workspace by its path instead of a registered name:
mochi trust set ~/src/api-hotfix trustedA worktree whose own trust isn't set takes its main checkout's trust and rules. Trust the main checkout once and every worktree of it is covered. A worktree's own state, if you set one, wins. Its own rules are checked before the ones it inherits.
Any other unregistered workspace starts out unknown. Both of these are defaults you can change:
mochi trust default # show both
mochi trust default worktrees off # worktrees inherit nothing
mochi trust default unregistered restricted # or trusted, or unknownWhen an agent is refused
An agent can't answer a prompt, so the run is refused instead of waiting. The refusal names the one command that allows it, so when you tell the agent to trust the workspace, it can run that command itself and try again. Under --output json the command is in the error's details.fix.