---
name: agent-preflight
description: Check a planned search/browse tool call before spending on it. Returns allow, block, reuse, defer, or advise; never executes the tool. Costs $0.002 USDC per paid POST via x402 on Base mainnet.
---

# Agent Preflight

Agent Preflight lets an agent check a planned tool call before spending on it. It returns allow, block, reuse, defer, or advise. It never executes the destination tool.

Version: v0.3. Price: $0.002 USDC per paid POST.

## When to use

- Before a metered `search:web_search` or `browse:fetch` call, when a local check is not enough and the plausible waste exceeds $0.002.
- When you have recent tool history and want duplicate or retry-cap detection.
- When remaining budget may not cover the estimated external cost.

Skip it when a local validator, cache, or budget check already answers the question.

## How to call

1. `POST https://api.agent-preflight.com/v0.2/preflight/tool-call` with `Content-Type: application/json` and `Accept: application/json`.
2. Without payment you get HTTP 402 and a `PAYMENT-REQUIRED` header (x402 v2).
3. Check network `eip155:8453` (Base mainnet), asset USDC, amount $0.002, and recipient against your own spending policy.
4. Sign locally and retry with `PAYMENT-SIGNATURE`. Never send wallet secrets to Preflight.
5. Read the JSON decision and the `PAYMENT-RESPONSE` settlement header.

Request body:

~~~json
{
  "runId": "settlement-check-01",
  "stepId": "paid-call-01",
  "tool": {
    "provider": "search",
    "operation": "web_search",
    "request": {
      "query": "Acme Corp Series B funding",
      "max_results": 5
    },
    "estimatedExternalCostUsd": 0.01,
    "estimatedModelCostUsd": 0.002
  },
  "budget": {
    "remainingUsd": 0.08,
    "reservedUsd": 0.02,
    "maxToolCallsRemaining": 4
  },
  "task": {
    "goalHash": "settlement-verification"
  },
  "history": []
}
~~~

## Interpreting the decision

- `allow`: No rule found waste; the caller decides whether to execute. Not a success guarantee.
- `block`: Inspect the reason: invalid request or terminal retry cap. Unsupported operations instead receive advisory abstention.
- `reuse`: Skip a new call and reuse a recent successful result when available.
- `defer`: Do not execute now; usually budget-infeasible or not worth spending yet.
- `advise`: Optional scope advice; payload unchanged. Paid HTTP consultations still cost $0.002.

The decision is advice. Agent Preflight does not execute, cancel, or retry anything for you.

## Free alternatives

- MCP (Streamable HTTP): `https://api.agent-preflight.com/mcp`, tool `preflight_tool_call` (unpaid).
- Body validation: `POST https://api.agent-preflight.com/check-request` (unpaid).

## References

- OpenAPI 3.1: https://api.agent-preflight.com/openapi.json
- Full guide: https://agent-preflight.com/docs/index.md
