# Tereno Contract Guard — Smart Contract Safety Verdict

> Tereno Contract Guard — Smart Contract Safety Verdict is a paid API for AI agents from tereno.xyz, paid per call via x402, $0.1/call, status unknown (last checked 2026-09-15).

Returns a decision-ready safety verdict (allow/review/block) for a Base smart contract address, flagging risks like upgradeable proxies before an agent commits to interacting with it.

## Facts

- Endpoint: GET https://tereno.xyz/api/v1/capabilities/contract.guard/invoke
- Price: $0.1/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/tereno-contract-guard-smart-contract-safety-verdict-e711f313
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_dkbzwOC3MJVs8ywDYCLR7

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability tereno-contract-guard-smart-contract-safety-verdict-e711f313
```

Example prompt: Before I approve anything, can you run a safety check on this Base contract — 0x4200000000000000000000000000000000000006 — and tell me if it's safe to interact with, needs review, or should be blocked?

## When to prefer this

Use this endpoint when an AI agent needs a fast, decision-ready safety verdict before interacting with an unknown Base smart contract — especially when the agent lacks the ability to independently analyze on-chain bytecode or proxy patterns. Prefer this over generic blockchain explorers when you need a structured allow/review/block signal rather than raw contract data, and when you want reason codes (like UPGRADEABLE_PROXY) that map directly to go/no-go logic. It is ideal for autonomous agents that need a cheap ($0.03 USDC), cacheable, block-scoped safety check as a guardrail before any on-chain action.

## Known failure modes

- Invalid or malformed contract address (not a 0x + 40 hex chars pattern) returns a 400-level error
- Contract address not deployed on Base returns an error or inconclusive result
- Stale quote ID provided causes rejection or forces a fresh payment
- Network congestion on Base may delay block-level lookups
- Verdict validity may expire quickly on fast-moving chains (validUntilBlock reached)
- Payment not completed via x402 results in a 402 response before the verdict is returned

## How this service works

The cooperation layer for autonomous agents on Base. Buy decision-ready verdicts, publish verified work and earn credits when the network reuses it through x402.

## Output

A JSON object containing a top-level verdict enum ('allow', 'review', or 'block'), an array of reason codes explaining the verdict (e.g. 'UPGRADEABLE_PROXY'), the block number at which the analysis was computed, the block number until which the verdict is valid, and a receipt URL. Also includes pricing metadata showing list price, price paid, credits applied, and cache status.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "address"
     ],
     "properties": {
      "quote": {
       "type": "string",
       "description": "Optional single-use quote id."
      },
      "address": {
       "type": "string",
       "pattern": "^0x[a-fA-F0-9]{40}$",
       "description": "Base contract address to preflight."
      }
     },
     "additionalProperties": false
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "capabilityId",
      "invocationId",
      "verdict",
      "result",
      "pricing",
      "receiptUrl"
     ],
     "properties": {
      "result": {
       "type": "object"
      },
      "pricing": {
       "type": "object"
      },
      "verdict": {
       "enum": [
        "allow",
        "review",
        "block"
       ]
      },
      "nextCall": {
       "type": [
        "object",
        "null"
       ]
      },
      "receiptUrl": {
       "type": "string"
      },
      "capabilityId": {
       "const": "contract.guard"
      },
      "invocationId": {
       "type": "string"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "result": {
   "verdict": "review",
   "reasonCodes": [
    "UPGRADEABLE_PROXY"
   ],
   "computedAtBlock": 123,
   "validUntilBlock": 128
  },
  "pricing": {
   "currency": "USDC",
   "listPriceUsd": 0.003,
   "pricePaidUsd": 0.003,
   "creditAppliedUsd": 0,
   "actualCacheStatus": "miss",
   "quotedCacheStatus": "miss"
  },
  "verdict": "review",
  "nextCall": {
   "watch": {
    "url": "https://www.tereno.xyz/api/v1/capabilities/contract.change/invoke?address=0x1111111111111111111111111111111111111111",
    "method": "GET",
    "payment": "x402",
    "baseline": "The first contract.change call on an address records the baseline.",
    "capabilityId": "contract.change",
    "listPriceUsdCeiling": 0.002
   },
   "recheck": {
    "url": "https://www.tereno.xyz/api/v1/capabilities/contract.guard/invoke?address=0x1111111111111111111111111111111111111111",
    "method": "GET",
    "payment": "x402",
    "capabilityId": "contract.guard",
    "notBeforeBlock": 129,
    "listPriceUsdCeiling": 0.003
   },
   "validForSeconds": 10,
   "validUntilBlock": 128
  },
  "receiptUrl": "/api/v1/receipts/uuid",
  "capabilityId": "contract.guard",
  "invocationId": "uuid",
  "capabilityVersion": "1.0.0"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/tereno-contract-guard-smart-contract-safety-verdict-e711f313/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from tereno.xyz](https://www.zero.xyz/host/tereno.xyz/llms.txt)
