> ## Documentation Index
> Fetch the complete documentation index at: https://vetta.sh/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Policies

> Governance at the tool-call boundary: per-tool allow / ask / deny on the agent's toolset.

Every capability an agent has flows through one place — the tool call. Naive Managed Agents enforces governance there, so a policy is checked *before* a tool runs, not audited after. Policies ship in **Phase 1** with the primitives they protect.

## Where a policy lives

A policy lives on the **agent**, in its `tools` toolset: a `default_config` for every tool and a per-tool entry that overrides it. There is no organization-wide policy layer; each agent carries its own.

The policy is evaluated on every tool call, including the tools of a connected account. Nothing reaches an external system without passing it.

## Per-tool permission policy

Each [tool](https://vetta.sh/docs/capabilities/tools.md) resolves to one of three permissions:

| Permission | Behavior |
| - | - |
| `allow` | The tool runs without confirmation. |
| `ask` | The runtime emits a `tool.confirm` event and **pauses the tool** until you approve or reject it. |
| `deny` | The tool is not offered to the model at all — the agent cannot call it. |

Tools are configured with a single **toolset** object: a `default_config` that applies to every tool, and per-tool `configs` that enable a tool and override its permission. There is no separate flat `tools[]` array or top-level default field.

```typescript TypeScript theme={"system"}
const agent = await naive.agents.create({
  name: "ops",
  model: "z-ai/glm-5.3-flash",
  harness: "pi",
  budget: { cap_micro_usd: 50_000_000, max_task_micro_usd: 5_000_000, period: "month" }, // $50 / $5
  tools: {
    default_config: { permission: "allow" },
    configs: {
      bash:            { enabled: true, permission: "allow" },
      publish_file:    { enabled: true, permission: "allow" },
      "tracker.get_issue": { enabled: true, permission: "ask" },  // a connection/MCP tool, keyed `<connector>.<tool>`
    },
  },
});
```

```bash CLI theme={"system"}
naive agent update agt_01j8rn6zk3m9xq2vp7c4h5wgte --file ops.json   # tool policy travels in the config file
```

> [!NOTE]
>
> `allow` is convenient but not automatically the right default. For irreversible or externally-visible tools (payouts, deletes, sending mail) set `ask` — or `deny` if the agent should never have the capability — rather than leaning on the permissive baseline.

> [!NOTE]
>
> The [ask-by-default tools](https://vetta.sh/docs/capabilities/tools.md#permission-policies) (publishing, paying, filing, changing the company's settings, a paid data run, a video, training a character) resolve to `ask` when `configs` does not name them and the default is `allow` or `ask`. A `deny` default still denies them; to offer one under it, name it in `configs`.

### Responding to `ask`

When a tool is set to `ask`, the runtime streams a `tool.confirm` event and holds the turn. The session goes `idle` with `stop_reason: "awaiting_approval"`. You resolve it by sending a decision back into the [session](https://vetta.sh/docs/concepts/sessions.md) — the same mechanism as any other input:

```bash CLI theme={"system"}
naive session confirm --session $SID --tool-call $CALL_ID --allow   # or
naive session confirm --session $SID --tool-call $CALL_ID --deny --reason "not this account"
```

The decision **records the approver** — the user or API key id that answered — on the event and audit trail, so a sign-off is attributable after the fact. See the [awaiting-approval loop](https://vetta.sh/docs/concepts/session-operations.md#awaiting-approval-loop) for the driving code.

An unanswered `ask` waits until someone answers it. A held tool consumes no budget while it waits, and — because the loop is [durable](https://vetta.sh/docs/concepts/runtime.md) — an agent can sit on a confirmation for hours at storage cost only. See [Events & streaming](https://vetta.sh/docs/concepts/events-and-streaming.md) for the event shapes.

## Scoping connections

A connected account's tools are registered as `<connector>.<tool>` (for example `crm.create_contact`), the same `tools.configs` key you write for `bash`, so they pass through the same allow / ask / deny filter. An agent only sees the connections of the [identities](https://vetta.sh/docs/identity/overview.md) attached to it.

There is no separate `primitives` or `connections` allowlist field. To keep an agent to a known set of tools, deny by default and name the ones it may use:

```jsonc theme={"system"}
{
  "tools": {
    "default_config": { "permission": "deny" },
    "configs": {
      "bash":              { "enabled": true, "permission": "allow" },
      "tracker.get_issue": { "enabled": true, "permission": "allow" },
      "crm.create_contact": { "enabled": true, "permission": "ask" }
    }
  }
}
```

To shut off one tool under an `allow` default, give it `{ "enabled": false, "permission": "deny" }`. A denied tool is never offered to the model, so it cannot be called.

## Why the boundary matters

Because enforcement lives at the tool-call boundary rather than inside a prompt, a policy holds regardless of what the model decides to attempt. Combined with the [budget gate](https://vetta.sh/docs/concepts/budgets.md) — which prices every call before it runs — an agent left running unattended can neither exceed its spend nor touch a system it was not granted.

> [card] [Next: the computer](https://vetta.sh/docs/computer/index.md)
>
> The sandbox, filesystem, shell, and browser in depth.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.