Devin
Guard Devin CLI and Devin Desktop's Devin Local agent with DefenseClaw hooks that can block prompts and tool calls. One connector, devin, covers both.
DefenseClaw registers hooks in Devin's own config, using the Devin CLI lifecycle hooks. One connector, devin, covers Devin CLI and the Devin Local agent in Devin Desktop, which reads the same hooks. This is a hook connector: Devin talks to its model provider directly, and no proxy is involved.
Platform support
- Min version
- 3000.4.25
- Block
- Yes
- Native ask
- No
- Fail closed
- Yes
- Enterprise
- per-user
| Platform | Open source | Notes |
|---|---|---|
| macOS and Linux | Supported | The devin-hooks-v1 contract manages user hooks under ~/.config/devin or an explicitly pinned project hook document. |
| Native Windows x64 | Supported | User hooks in %APPDATA%\devin\config.json. Devin's Windows hook runner starts the protected defenseclaw-hook.exe directly. No Bash or WSL dependency. |
The lowest Devin CLI is 3000.4.25 (compatibility). Which Devin surfaces the connector covers:
| Surface | Protected | Why |
|---|---|---|
| Devin CLI | Yes | DefenseClaw registers the devin-hooks-v1 contract in the Devin CLI hook config. |
| Devin Desktop 3.9.19 or later, Devin Local agent (the default for new tabs) | Yes, per vendor documentation | Preview. Devin Local shares the agent harness, config file and hooks with Devin CLI. |
| Devin Desktop before 3.9.19, legacy Cascade agent | No; DefenseClaw does not cover it. Keep Desktop at 3.9.19 or later. | Devin Desktop 3.9.19 removed Cascade. Cascade used a separate hook contract DefenseClaw does not inspect. See Cascade on older builds. |
| Cloud Devin sessions | No | Cloud execution does not run local hooks. |
Setup
On a new install run defenseclaw init --connector devin first; until then setup stops with DefenseClaw is not initialized — run 'defenseclaw init' first. A re-run without --mode keeps the current mode; on a terminal it still asks, and --yes skips the questions (Set up and change connectors).
defenseclaw setup devin # first setup: observe, record only
defenseclaw setup devin --mode action # block on policy hits- Run the commands in PowerShell on Windows.
- Review observed events before you use action mode.
- Restart open Devin CLI sessions and reopen Devin Desktop tabs.
Check it
defenseclaw statusThe agent appears under Agents with its mode. defenseclaw doctor reports no failed check for it.
Hook capabilities
Block events
- PreToolUse
- PermissionRequest
- UserPromptSubmit
- Stop
Native ask events
None — confirm verdicts are downgraded with the raw action preserved.
| Contract | Agent versions | Hook script | Events | Can block | Can ask |
|---|---|---|---|---|---|
devin-hooks-v1 | 3000.4.25, 3000.11.3 | v7 | 8 | 4 | 0 |
- The contract covers Devin CLI
3000.4.25on Windows, macOS and Linux, and3000.11.3on Linux. Any other CLI from3000.4.25on is newer than the contract: it runs on the newest contract, as Preview, unless known broken (version policy). - A CLI older than
3000.4.25has no contract, so setup refuses it in observe and action mode. - Devin documents
session_idand a per-turnprompt_idbut no per-tool invocation ID, so pairing a tool call with its result is detection-only.
What it can block or ask
The verdict uses Devin's top-level decision and reason. A block exits 2, and Devin shows the hook output as is (Tool rejected: <output>), so the hook prints only the reason.
| Event | Can block | Can ask | What DefenseClaw does |
|---|---|---|---|
PreToolUse | Yes | No | Inspects tool input. Action mode returns decision: "block". |
PermissionRequest | Yes | No | Action mode can block. Blocking here is Preview on CLI 3000.11.3. |
UserPromptSubmit | Yes | No | Inspects the prompt. Action mode can block or add context. |
Stop | Yes | No | Action mode can block through the documented response. |
PostToolUse | No | No | Inspects tool_response and may add context. The tool has already run. |
PostCompaction | No | No | Observes the compaction summary. |
SessionStart, SessionEnd | No | No | Observe the session; SessionStart may add context. |
additionalContext goes only to UserPromptSubmit, SessionStart and PostToolUse. Restricted Mode turns hooks and agents off.
Native ask
Devin has no native resumable ask. A confirm finding stays in audit and cannot pause and resume in the TUI.
Fail mode
On a per-user install, when the gateway is not running, the default and permissive policies let the call run with one warning, and the strict policy blocks it (gateway outage table). Every other failure, an error or unusable answer included, blocks the events that support a block response.
- Devin itself blocks only on exit
2; every other hook error lets the call run on its side. - On Windows, when
defenseclaw-hook.exeis missing or cannot start, a one-line install blocks each prompt, tool call and permission request in every fail mode, withDefenseClaw blocked this: its Devin hook launcher is missing. Run the DefenseClaw installer again to repair it.(orcannot start).
Settings and edge cases are in Fail modes.
Files DefenseClaw will modify
| What | macOS and Linux | Windows |
|---|---|---|
| User hooks | ~/.config/devin/config.json, under hooks | %APPDATA%\devin\config.json, under hooks |
| Project hooks (pinned workspace only) | <workspace>/.devin/hooks.v1.json, where the hook map is the whole JSONC document | same |
| Hook program | ~/.defenseclaw/hooks | %USERPROFILE%\.local\bin\defenseclaw-hook.exe (one-line install) or %LOCALAPPDATA%\DefenseClaw\HookRuntime\defenseclaw-hook.exe (Setup installer) |
Setup reads JSONC and keeps other hooks and settings in those files.
- A changed user hook file is written back as JSON, so its comments and formatting are removed; in a project
.devin/hooks.v1.jsonsetup and teardown edit only DefenseClaw's entries, so your comments, formatting and a UTF-8 BOM stay. - If setup cannot edit the project file in place, for example when it has a duplicate top-level key, it writes it back as JSON too, so its comments, formatting and BOM are removed.
- The pre-edit backup keeps the original bytes.
DefenseClaw does not claim or change the hooks Devin loads from .claude/ settings, and does not install Devin plugins. It reads, without changing them, Devin's MCP config and the skills and rules under .devin and .agents (AGENT.md, AGENTS.md, AGENTS.local.md); defenseclaw skill quarantine and restore can move a flagged skill. See AI Discovery. The devin acp entry point is listed for the shared ACP guard and is Preview there.
On a managed computer
On a managed computer the administrator sets this agent up in the managed config; see On a managed computer.
- On Linux and macOS each hook runs
defenseclaw-hook hook --connector devin --enterprise-managed. Windows uses the installed hook binary through the per-user route, and its guardian puts a missing launcher back. - Each hook follows the administrator's fail mode:
closedunlesshook_fail_mode(global or for Devin) isopen. - With
foreign_hooks: remove(the default), a guarded call during a gateway outage needs fresh, trusted records for the agent process and its session; a missing, blocked or stale record blocks. See Foreign-hook guard.
Cascade on older builds
Builds before 3.9.19 still run Cascade, which reads a machine-level hooks file (Cascade hooks). DefenseClaw does not cover those builds and publishes no Cascade entry. Keep Devin Desktop at 3.9.19 or later and turn Cascade off in your Devin team settings; Devin Local stays protected by the devin connector. The next ensure removes any Cascade refusal entry an earlier release wrote.
| File | Read by | What DefenseClaw does |
|---|---|---|
Devin hooks.json (/etc/devin/hooks.json, /Library/Application Support/Devin/hooks.json, %ProgramData%\Devin\hooks.json) | Desktop reads it only for post_setup_worktree hooks. The Devin CLI and the Desktop engine never open it. | Writes nothing. Removes the entries an earlier release wrote. |
Pre-rename hooks.json (the folder name is in the upgrade notes) | Pre-rename apps; Desktop as the fallback when the Devin file is absent; the Devin CLI and the Desktop engine import it as Devin Local hooks. | Writes nothing. A refusal here would block current Devin Local, so entries an earlier release wrote there are removed on the next ensure. |
Devin system.json | The Devin CLI and the Desktop engine, as enterprise policy. | Not touched. |
No file DefenseClaw could write is known to reach only builds that run Cascade, so enterprise policy reports devincascade as not covered and lists the limit; it does not report it as covered, and enterprise policy export --connector devincascade has nothing to render. Set enterprise.machine_policy.connectors.devincascade.ownership to verify_only when your MDM owns these files (DefenseClaw then reports a leftover refusal and does not edit), or "off" to leave them alone.
In an OpenShell sandbox
Devin CLI cannot run in a sandbox yet
The image is unverified, so defenseclaw sandbox run devin refuses it. Devin CLI needs a Devin account login (devin auth login) before any agent turn, and no API key or bring-your-own model skips it, so the hook check cannot run. The unverified image stays (see the Cursor note on image list and image prune).
| Item | Detail |
|---|---|
| Tier | User. Devin has no system hook tier, so hooks are in ~/.config/devin/config.json in the image. The launcher restores them from a root-owned template on every start and refuses a --config of your own. The sandbox hook exits 2 on every failure, with a 30-second timeout. |
| Skip permissions | Would start with --permission-mode dangerous. --safe drops --permission-mode dangerous and autonomous from your arguments. |
| Tamper detection | DefenseClaw pairs each PostToolUse with its PreToolUse by session, tool name and input. A tool that ran although denied, or whose PreToolUse never arrived, raises hook_tamper and the pack's hooks.on_tamper applies (policy packs). |
| Workspace trust | The launcher always passes --respect-workspace-trust false and refuses that flag from you, because a headless run fails in an untrusted folder. A project's own .devin/hooks.v1.json then loads beside DefenseClaw's without a prompt. |
| Sign-in | Preview. A login inside the sandbox (/usr/local/lib/defenseclaw/bin/devin-launch auth login --force-manual-token-flow) is the only path. The credential stays in ~/.local/share/devin, where the agent can read it. |
| Image | Devin CLI 3000.14.30821 from its release archive, checked against the SHA-256 in Devin's manifest. |
Limits
- Only exit code 2 blocks. Restricted Mode turns hooks off entirely.
- On Windows the prompt, tool and permission events start the guard program
defenseclaw-hook-guard.exe, which starts the launcher beside it. The other events,Stopincluded, start the launcher directly, so Devin runs them when it is missing. If the guard program itself is missing or damaged, Devin runs the call;defenseclaw doctoranddefenseclaw statusreport it. - Cloud Devin sessions run no local hooks and are not covered.
- On Windows, creating a new file with Devin's patch tool can be blocked in action mode with a wrong reason (an SSH key write). Use observe mode for Devin on Windows if this blocks your work.
- Some PowerShell command shapes are not fully read on Windows; the LLM judge is the second layer.
- Devin Desktop before 3.9.19 runs the legacy Cascade agent, which DefenseClaw does not inspect.
- Devin Desktop coverage rests on vendor documentation and is Preview.
- Cloud execution, proxy transport, native OTLP, egress control and managed higher-layer policy are outside this connector.
Disable
defenseclaw guardrail disable --connector devin --yesThis removes DefenseClaw's hooks from Devin's user and configured project files and preserves your other Devin settings. defenseclaw guardrail enable --connector devin restores DefenseClaw's hooks. Turn a connector off covers --no-restart, the whole-guardrail switch and setup remove.
After defenseclaw setup remove devin --yes and the gateway restart, DefenseClaw revokes hooks/.hook-devin.token and removes an empty connector_backups/devin folder. hooks/devin-hook.sh stays as a blocking stand-in while a Devin process may still use it, and idle cleanup removes it after that process exits. Restart Devin after removal. Devin's own config directory and a credential lock file may remain.
Next
- Add a second agent.
- Fail modes: the fail-mode settings and how to set a closed posture.
- Support matrix: what runs where.