Open source, for Python agents
Say no before the tool runs.
Veto checks each tool call your AI agent makes, before it runs. Allow, ask a person, or block.
pip install veto-guardsupport-bot · one run- Look up order: Allowed.
- Refund 40: Allowed.
- Refund 250: Needs a person, above 100.
- Refund 900: Blocked, above the 500 cap.
- Email a stranger: Blocked, outside the company.
- Python package on PyPI
- Guards MCP tools
- Rules in YAML
- Runs in memory or Postgres
- Fails closed
- No AI model decides
- MIT license
How it works
- Your agent calls a tool.
- Veto checks your rules.
- It answers, and says why.
For example: lookup_order("A-1001") is allowed; issue_refund(250) is needs a person, above 100; issue_refund(900) is blocked, above the 500 cap.
Now you be the agent
Make calls. Try a refund before and after looking up the order.
Calls
An example run, until you make a call
Allowed
The same refund was blocked a moment earlier. Then the order was looked up.
issue_refund("A-1001", 40)This run
- Refund 40: Blocked, the order was never looked up.
- Look up order: Allowed.
- Refund 40: Allowed.
Answers computed ahead of time by Veto’s own engine. Nothing you press is sent anywhere.
What it can do
Reads the whole run
Refund only after a lookup.
Asks a person
Some calls wait for a human.
Says why
The reason goes back to the model.
Rules, not guesses
No AI model decides.
Fails closed
By default, an error means the tool does not run.
Guards MCP tools
Sits in front of MCP servers too.
Rules you can read
A few lines of YAML each. Six come with Veto.
The rule, exactly as Veto reads it
- id: refund-amount-cap
description: Refunds above 500 are never allowed.
tools: [issue_refund]
effect: block
violation: "!has(call.args.amount) || call.args.amount > 500.0"
message: Refund amount is missing or above the 500.0 cap.
- id: refund-amount-positive
description: A refund must pay the customer something; zero or negative amounts are refused.
tools: [issue_refund]
effect: block
violation: "has(call.args.amount) && call.args.amount <= 0"
message: Refund amount must be above 0.
- id: refund-large-needs-approval
description: Refunds above 100 need a human.
tools: [issue_refund]
effect: require_approval
violation: "has(call.args.amount) && call.args.amount > 100.0"
message: Refund above 100.0 requires approval.
- id: repeat-call-loop
description: Block the third identical attempt of the same tool with the same args.
tools: ["*"]
effect: block
violation: "attempts.filter(a, a.tool == call.tool && a.args == call.args).size() >= 2"
message: Same tool called with identical arguments three times in this run.
- id: refund-requires-order-lookup
description: A refund must follow a successful lookup of the same order in this run.
tools: [issue_refund]
effect: block
violation: >-
!history.exists(h, h.tool == "lookup_order" && h.status == "succeeded" &&
has(h.args.order_id) && has(call.args.order_id) &&
h.args.order_id == call.args.order_id)
message: issue_refund called without a successful lookup_order for the same order_id in this run.
- id: email-recipient-allowlist
description: >-
Emails go to exactly one company address per field. to is required; cc and bcc are
checked the same way when present. Lists, display names and subdomains are refused.
tools: [send_email]
effect: block
violation: >-
!has(call.args.to) || type(call.args.to) != string ||
!call.args.to.matches(r"^[A-Za-z0-9._%+-]+@example\.com$") ||
(has(call.args.cc) && (type(call.args.cc) != string ||
!call.args.cc.matches(r"^[A-Za-z0-9._%+-]+@example\.com$"))) ||
(has(call.args.bcc) && (type(call.args.bcc) != string ||
!call.args.bcc.matches(r"^[A-Za-z0-9._%+-]+@example\.com$")))
message: Every recipient (to, cc, bcc) must be a single address at exactly @example.com.
And the one line that guards your tool
@run.guard
def issue_refund(order_id: str, amount: float): ...
We tried to get past it
- 1,500requests a second
- 4.4 msor less for 99% of checks
- 488test calls, run on every push
One laptop server, runs in memory. We wrote the test calls ourselves. Test log Benchmarks