# Tool-Trust Verifier - MCP & A2A Agent Verification (`apricot_blackberry/agent-tool-trust-verifier`) Actor

Verify a tool or agent before yours trusts it. Checks an MCP or A2A endpoint TLS, signature, domain, and permission scope, and scans its manifest for hidden tool-poisoning instructions - catching malicious or spoofed tools at connect time.

- **URL**: https://apify.com/apricot\_blackberry/agent-tool-trust-verifier.md
- **Developed by:** [Creator Fusion](https://apify.com/apricot_blackberry) (community)
- **Categories:** AI, Developer tools
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Agent Tool-Trust Verifier

**Creator Fusion Labs — Agent Protection Suite**

Verify the provenance of an MCP tool or A2A agent **before** your agent trusts it and calls it. Point this actor at an A2A agent-card or MCP manifest URL and it returns a single, structured verdict row: a `trustScore` (0–100), a `verdict` (`trusted` / `caution` / `untrusted`), a per-check breakdown, and a signature status — so an autonomous agent can gate the decision to load a tool.

It is **honest about what provenance actually proves.** Signals that cannot be determined from the document alone (for example, a signature with no published key to check it against) are reported as `present-unverified` or `not assessed`, never inflated into a false positive.

### What it checks

| Check | What it means |
|-------|---------------|
| `https-enforced` | Endpoint uses TLS; plain HTTP is flagged. |
| `reachable` | The URL responds 2xx (GET, hard-timeout guarded). |
| `parses-json` | The body is a JSON object. |
| `schema-valid` | Required fields for its type are present (A2A agent-card: `name`, `url`, `capabilities`/`skills`; MCP manifest: identity + `tools`/`capabilities`/`protocolVersion`). |
| `signature` | JWS/proof present? If a public key is embedded in a compact JWS, it is cryptographically verified. Otherwise reported as present-but-unverifiable. |
| `domain-sanity` | Typosquat/lookalike vs `expectedDomain` (edit distance), IP-literal host, and punycode/homograph hosts are flagged. |
| `scope-analysis` | Declared capabilities vs your `requiredScopes` — extra capabilities are flagged as over-permissioning, missing ones as gaps. |

### What it can and cannot determine (read this)

- It **can** verify a compact JWS **only when the signer's public key is embedded** in the token header. In the common case where the key lives out-of-band (a JWKS URL), the signature is honestly reported as `present-unverified` — presence is confirmed, authenticity is not.
- It does **not** fetch or trust external key registries, and it does **not** assert reputation. There is no "this vendor is reputable" score here, because that cannot be derived from a manifest. Domain match is structural (edit distance + suffix), not a public-suffix-list parse.
- A `trusted` verdict means "the declared provenance is internally consistent and matches what you expected", not "this tool is safe to run with your credentials". Treat it as a gate, not a guarantee.

### Input

```json
{
  "agentCardUrl": "https://example.com/.well-known/agent-card.json",
  "mcpManifestUrl": "https://example.com/mcp.json",
  "expectedDomain": "example.com",
  "requiredScopes": ["get_forecast"]
}
```

At least one of `agentCardUrl` or `mcpManifestUrl` is required. If both are given, the agent card is the primary target. `expectedDomain` and `requiredScopes` are optional; omit them to skip those checks (they are then reported as not assessed).

### Output (one row)

```json
{
  "target": "https://example.com/.well-known/agent-card.json",
  "targetType": "a2a",
  "trustScore": 82,
  "verdict": "trusted",
  "signatureStatus": "present-unverified",
  "checks": [{ "name": "https-enforced", "pass": true, "detail": "..." }],
  "warnings": ["Signature present but could not be verified."]
}
```

### Integration

**MCP** (any MCP-capable agent via the Apify MCP server):

```
Call actor apricot_blackberry/agent-tool-trust-verifier with
{ "agentCardUrl": "https://example.com/.well-known/agent-card.json", "expectedDomain": "example.com" }
```

**curl** (run and read the result):

```bash
curl -X POST "https://api.apify.com/v2/acts/apricot_blackberry~agent-tool-trust-verifier/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"agentCardUrl":"https://example.com/.well-known/agent-card.json","expectedDomain":"example.com","requiredScopes":["get_forecast"]}'
```

**JavaScript** (`apify-client`):

```js
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('apricot_blackberry/agent-tool-trust-verifier').call({
  agentCardUrl: 'https://example.com/.well-known/agent-card.json',
  expectedDomain: 'example.com',
  requiredScopes: ['get_forecast'],
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items[0].verdict, items[0].trustScore);
```

**Python** (`apify-client`):

```python
from apify_client import ApifyClient
client = ApifyClient(token="APIFY_TOKEN")
run = client.actor("apricot_blackberry/agent-tool-trust-verifier").call(run_input={
    "mcpManifestUrl": "https://example.com/mcp.json",
    "expectedDomain": "example.com",
    "requiredScopes": ["read_file"],
})
row = client.dataset(run["defaultDatasetId"]).list_items().items[0]
print(row["verdict"], row["trustScore"])
```

### Pricing

Pay-per-event. You pay a small actor-start fee plus one `verify` charge per completed verification. **Verifications that cannot reach or parse the target are not charged** — the run fails loud and no `verify` event is billed (the failing-check row is still written to the dataset for you to read). Any proxy usage is billed to you, the caller.

# Actor input Schema

## `agentCardUrl` (type: `string`):

URL of an A2A agent card, typically https://<host>/.well-known/agent-card.json. When provided, the target is validated against the A2A agent-card shape. Provide at least one of agentCardUrl or mcpManifestUrl.

## `mcpManifestUrl` (type: `string`):

URL of an MCP server manifest/descriptor that returns JSON. When provided (and no agentCardUrl is given), the target is validated against the MCP manifest shape. Provide at least one of agentCardUrl or mcpManifestUrl.

## `expectedDomain` (type: `string`):

The domain you expect the tool to be hosted on (e.g. 'example.com'). Used for typosquat/lookalike detection: the target host is compared to this via edit distance and suffix match, and mismatches are flagged. Leave empty to skip domain-match scoring.

## `requiredScopes` (type: `array`):

The capability names or scopes your agent actually needs from this tool. Declared capabilities beyond this set are flagged as over-permissioning; required scopes the tool does not declare are flagged as missing. Leave empty to skip scope analysis (it will be reported as not determinable).

## `proxyConfiguration` (type: `object`):

Optional Apify proxy configuration. Fetches go direct first; the proxy is only used as a fallback when a direct fetch is blocked. All proxy traffic is billed to you, the caller.

## Actor input object example

```json
{
  "requiredScopes": [],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("apricot_blackberry/agent-tool-trust-verifier").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("apricot_blackberry/agent-tool-trust-verifier").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call apricot_blackberry/agent-tool-trust-verifier --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,apricot_blackberry/agent-tool-trust-verifier"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/4AZcRu3LM11hTHfQn/builds/6J95Ths80iIwj0Rkh/openapi.json
