---
title: "Govern Cline"
---

# Govern Cline

What Neural Inverse Govern can do for Cline: an advisory PreToolUse hook script compiled from agent policy, and routing Cline's model traffic through the gateway.

## Control level

| What | Level |
|---|---|
| Tool calls | **Monitored, advisory hook**: runs only while Cline's "Enable Hooks" setting is on |
| Model traffic | **Network**: holds while Cline uses the gateway as its OpenAI Compatible provider |

The level was verified by running Cline's documented PreToolUse input through the real enforcement hook and daemon; Cline (VS Code extension 4.1.24) was not run.

## What Govern compiles

Govern compiles the agent policy for the `cline` engine into a global hook script, `Hooks/PreToolUse`, for `~/Documents/Cline/Hooks`. The script answers `{"cancel": true, "errorMessage": ...}` to cancel a call.

The endpoint agent's system service does **not** install this file, because the location belongs to the user. Read the compiled script and its gaps on **Agent policy > Policy preview** with the engine `cline`.

## How failures and asks behave

- Cline lets a call run when the hook exits non-zero without JSON, and stops hooks after a fixed 30 seconds. The compiled script prints a cancel whenever the endpoint agent does not answer, with a 20-second deadline.
- Cline hooks can only cancel, so an `ask` rule becomes a cancel.

## What remains uncovered

Every action while "Enable Hooks" is off or the script is removed.

## Route model traffic through the gateway

In Cline's settings choose the **OpenAI Compatible** provider:

```
API Provider: OpenAI Compatible
Base URL:     <your API URL>/api/v1/models/gateway/v1
API Key:      <token printed by keystone-cli token models --tool cline>
Model ID:     <model id>
```

1. Run `keystone-cli token models --tool cline` and copy the token.
2. Enter the values above with a model you may use.
3. Paste a new token when it expires (at most one hour).

Model access, budgets, DLP, guardrails and request logs then apply to Cline's requests. Without a network block on the providers' APIs, a developer can bypass the gateway with another key. Roo Code is configured the same way with `--tool roo_code`.
