# Safe tools

> An agent can only do what was written down: sandboxed CLI tools and MCP servers, validated against a toolspec and run without a shell.

Source: https://openap.org/docs/safe-tools

An LLM agent is only as safe as the tools you hand it. When the thing that runs a tool call is a Python
function with full process authority, the tool surface is whatever code happens to expose, arguments go
unvalidated, and every tool runs with ambient authority. OAP restricts an agent to **sandboxed CLI
tools and MCP servers, validated against a toolspec** — it can only do what was written down.

[Video: Read-only steps run freely; the external deploy asks for approval first, then runs in a locked-down sandbox.](https://openap.org/media/safe-tools-demo.mp4)

## How it works

A tool in OAP is a *specification*, not a function. Each is declared with a **deny-by-default** allowlist of
subcommands and fields (refined with CEL), and it is validated twice — once at authoring time, and again at
execution time, so a spec that drifts can't quietly widen. Tools run as **argv arrays over a sandboxed pod —
never through a shell, never `eval`** — so there's no string to inject into.

Every tool declares its `stateImpact` — `readonly`, `readwrite`, or `external` — and that drives both the
authorization check and whether a human is asked before it runs. The sandbox pods themselves are hardened
(non-root, read-only root filesystem, no ambient service-account token), and default-on circuit breakers,
plus optional rate limits and per-call data-volume budgets, keep a misbehaving tool from running away.

## Go deeper

- **[Toolspec & validation](https://openap.org/docs/toolspec-validation)** — deny-by-default allowlists, CEL, and dual validation.
- **[Sandboxed execution](https://openap.org/docs/sandboxed-execution)** — the hardened pod model and argv-not-shell execution.
- **[MCP servers & sidecar toolboxes](https://openap.org/docs/mcp-servers)** — bringing external tools under the same rules.
- **[Content guards & egress](https://openap.org/docs/content-guards-egress)** — inspecting tool I/O and bounding what leaves the session.
- **[Budgets, rate limits & circuit breakers](https://openap.org/docs/budgets-breakers)** — bounding runaway use.
- **[Supply-chain pinning](https://openap.org/docs/supply-chain-pinning)** — content-hashing the tools an agent is allowed to run.

> **Security: How this addresses the OWASP Agentic Top 10**
>
> Tool safety is OAP's home turf:
> - [ASI02 — Tool Misuse & Exploitation](https://openap.org/docs/owasp-top10#asi02) (substantial): dual validation, deny-by-default, argv-no-shell, per-action authorization.
> - [ASI05 — Unexpected Code Execution](https://openap.org/docs/owasp-top10#asi05) (substantial): hardened pods, no shell, closed-world tools.
> - [ASI04 — Agentic Supply Chain](https://openap.org/docs/owasp-top10#asi04) (partial): content-hash pinning of the tool manifest.
> - [ASI01 — Agent Goal Hijack](https://openap.org/docs/owasp-top10#asi01): the content-guard seam over tool I/O.
