# ai.safe4/safe4

> Tests an AI agent's purchase against the task it was given. Paid per call in USDC via x402.

- name: ai.safe4/safe4
- version: 1.0.0
- connection class: R0 (autonomous)
- trust: 92/100
- quality: 76/100 (good)
- owner: not claimed
- descriptor: https://api.protogrid.dev/v1/servers/ai.safe4%2Fsafe4
- tools: https://api.protogrid.dev/v1/servers/ai.safe4%2Fsafe4/tools

**An agent can connect right now, no human step.** Remote endpoint, no authentication, reachable on the last probe.

## Connection (mcpServers)

```json
{
  "mcpServers": {
    "safe4": {
      "type": "http",
      "url": "https://api.safe4.ai/mcp/"
    }
  }
}
```


## Trust

- hygiene: 100
- liveness: 99
- freshness: 85
- provenance: 85
- drivers: +repository +dns-namespace +website +reachable +uptime-96% ~updated-54d-ago
- Derived from observable signals (official registry feed and our own credential-free probes); no code audit performed.

## Quality 76/100 (good)

### protocol: 75 (weight 25)

- warn `protocol.modern`: newest supported version is 2025-11-25; 2026-07-28 not supported, older versions are deprecated until 2027-07-28
- n/a `protocol.stateless`: only applies to 2026-07-28 servers
- pass `protocol.transport`: streamable HTTP
- n/a `protocol.list_ttl`: only applies to 2026-07-28 servers

### authorization: n/a (weight 15)

- n/a `auth.prm`, `auth.as_metadata`, `auth.cimd`: no remote uses OAuth
- n/a `auth.secret_in_url`: no templated URL

### tool hygiene: 64 (weight 30)

- pass `tools.descriptions`: every tool has a description
- warn `tools.description_length`: 1 tools have descriptions over 1,024 characters, which crowds the context
- pass `tools.schemas`: every tool has an object input schema
- fail `tools.annotations`: no tool declares readOnlyHint or destructiveHint, so clients cannot tell safe calls from risky ones
- fail `tools.directory_hints`: no tool declares all four of readOnlyHint, destructiveHint, idempotentHint and openWorldHint; missing: safe4_authorize (readOnlyHint, destructiveHint, idempotentHint, openWorldHint); safe4_price (readOnlyHint, destructiveHint, idempotentHint, openWorldHint)
- pass `tools.token_cost`: about 663 tokens to load every tool
- pass `tools.api_dump`: tools are not a one-to-one API dump

### stability: 100 (weight 15)

- pass `stability.changes`: no tool changes in 30 days
- pass `stability.rug_pull`: no tool changed its meaning under the same name

### dependencies: n/a (weight 15)

- n/a `deps.known_vulns`, `deps.mcp_sdk_version`, `deps.resolvable`: no npm or PyPI package

- tools: 2, about 663 tokens to load them all
- tool set hash: 0ac0e76549cda9ff1674f3aacb20897c
- badge: [![protogrid quality](https://protogrid.dev/badge/ai.safe4/safe4.svg)](https://protogrid.dev/servers/ai.safe4/safe4)
- Checks run on what our credential-free, read-only probes observe; tools are never called and no code audit is performed.

### Tool changes

_No tool definition changes recorded._

## Remotes

- https://api.safe4.ai/mcp/ (streamable-http, auth none, reachable true, uptime30d 0.9649123)

## Packages

_none_

## Tools (2)

- `safe4_authorize`: Decide whether a proposed agent payment should proceed.

Settled per call in USDC over x402. Called without ``payment`` it
returns the price list rather than a decision; call it again with the
signed payload to receive one.

The task and the two allow-lists are the principal's constraints, not
the agent's: they are what the purchase is tested against, so an agent
that writes its own ``task`` is grading its own homework. Safe4 records
every field it was given in the audit entry and marks the task context
as request-supplied, so a substituted constraint is visible afterwards.

Args:
    task: The task the agent was given, as stated by its principal.
    purchase: What is being bought.
    purchase_purpose: Why this purchase serves the task.
    amount: Decimal amount as a string, for example "25.00".
    currency: Currency of the proposed payment, for example "USDC".
    counterparty: Who would receive the payment.
    service_category: Category of the thing being bought.
    allowed_service_categories: Categories the principal permits.
    allowed_counterparties: Optional payees the principal permits. When
        supplied, payment to anyone else is denied.
    task_id: Optional caller-side task identifier, echoed into the audit.
    payment: An x402 payment payload for this call. Omit to receive the
        price list instead of a decision.

- `safe4_price`: Price and accepted payment networks for one Safe4 decision.

Free to call. Returns the same x402 terms the HTTP endpoint advertises,
so an agent can see the cost before committing to a paid call.

