You can also create and manage agents and policies in the dashboard at app.veto.tools without writing any code.
Install the SDK and set up VetoClient
Install the Create a The client connects to
@useveto/node package:- npm
- pnpm
- yarn
VetoClient using your API key. Store the key in an environment variable — never hard-code it.https://api.veto.tools by default. You can override endpoint and timeout if needed:Create an agent
An agent represents the AI system that will make tool calls. Register it once — Veto uses the agent ID to look up which policies apply.The
createAgent call returns an Agent object with an id field. Store that ID in your environment or config.Create a policy
A policy is a set of rules that Veto evaluates against every tool call. This policy:
- Allows only
file.readandweb.search(tool allowlist) - Constrains
file.readso thepathparameter must start with/home/user/(regex) - Rate-limits
web.searchto 50 calls per hour
Veto is default deny: if no policy explicitly allows a tool call, it is blocked. You don’t need to list every denied tool — omitting it from the allowlist is enough.
Test an allowed action
Call The
authorize() with a tool and parameters that your policy permits. Veto evaluates the rules and returns a result synchronously (sub-10ms).path value matches the regex ^/home/user/ and file.read is in the allowlist, so the call is allowed.Test a denied action — tool not in allowlist
Try calling a tool that is not in the allowlist. Because Veto is default deny, any tool outside your explicit list is blocked.
file.delete was never added to the allowlist, so Veto denies it immediately without executing any handler.What’s next
- Explore the full list of rule types:
tool_allowlist,tool_denylist,parameter_constraint,rate_limit,time_based - Add Veto to an MCP server — see MCP server guide
- Review every decision your agent made in the audit log