Skip to main content

Install

The Nanny CLI is a system tool — install it once and use nanny run from any project.
Verify the installation:
For upgrade paths, uninstall, and troubleshooting on each platform, see Installing Nanny. The CLI is the enforcement engine. The SDK instruments your functions. You need both: nanny run owns the process lifecycle and enforces limits; @tool, @rule, and @agent report tool calls and activate named limit sets from inside your agent code.

Initialise a config

Run this in the root of your project:
This writes a nanny.toml with safe defaults:
Set [start].cmd to your agent’s entry point and edit the limit values to match your requirements.

Run your agent

Nanny reads [start].cmd from nanny.toml, spawns the process, and kills it the moment any limit is crossed.

Use named limits

Define limit sets for different workloads in the same nanny.toml:
Then activate a named set at runtime:
Named sets inherit from [limits] and override only the fields you declare.

Read the event log

Every run emits structured NDJSON to stdout:
Pipe it to a file or your log aggregator:
Or configure file output directly in nanny.toml: