# Trust Model

Valiron uses a hybrid trust model to evaluate AI agents hitting your API. This document explains what behaviors are evaluated and what each trust tier means for your routing decisions.

## Trust Tiers

Valiron assigns a Moody's-style credit tier from a normalized `0-100` trust score:

| Tier | Meaning | Route Decision |
|------|---------|----------------|
| AAA | Prime, highest quality | `prod` |
| AA | High grade | `prod` |
| A | Upper medium grade | `prod` |
| BAA | Medium grade | `prod` or `prod_throttled` |
| BA | Speculative | `prod_throttled` |
| B | Highly speculative | `sandbox` |
| CAA | Substantial risk | `sandbox_only` |
| CA | Extremely speculative | `sandbox_only` |
| C | Default risk | `sandbox_only` |

## Selectable Trust Signals

API sellers can use Valiron plug-and-play, or choose the trust signals used for a specific endpoint.

Supported signals:

| Signal | Description | Plan |
|--------|-------------|------|
| `8004` | ERC-8004 / Solana on-chain reputation | Free |
| `sandbox` | Valiron behavioral sandbox score | Free |
| `world` | World ID human-agent link | Pro |
| `icebreaker` | Icebreaker human/background attestation | Pro |

When multiple signals are selected, Valiron computes each signal on a `0-100` scale and normalizes the configured weights across only those selected signals. The default weights are:

| Signal | Default Weight |
|--------|----------------|
| `sandbox` | 55 |
| `8004` | 25 |
| `world` | 15 |
| `icebreaker` | 5 |

If no signals are specified, Valiron uses the plug-and-play default: sandbox plus any other available trust signals.

## Behavioral Factors

Valiron evaluates agents across multiple behavioral dimensions. The behavioral evaluation is holistic — no single sandbox behavior determines the outcome. The specific factors evaluated and their weights are proprietary and not disclosed.

## What Makes an Agent Trustworthy

Agents that demonstrate responsible API usage patterns will earn the highest trust tiers. The specific behaviors that contribute to trust scoring are proprietary. In general, agents that are well-behaved, respect API boundaries, and handle errors gracefully will score highly.

## Checking an Agent's Trust Status

```typescript
import { ValironSDK } from "@valiron/sdk";

const valiron = new ValironSDK();
const result = await valiron.triggerSandboxTest("AGENT_ID");

console.log(`Tier: ${result.tier}`);
console.log(`Risk: ${result.riskLevel}`);
console.log(`Meets threshold: ${result.meetsThreshold}`);
```

Or via HTTP:

```bash
curl -X POST https://valiron-edge-proxy.onrender.com/operator/trigger-sandbox/AGENT_ID
```

Use selected signals in middleware:

```typescript
app.use("/api/paid", createValironGate({
  sdk: valiron,
  trustSignals: ["8004", "sandbox"],
  minScore: 70,
}));
```

---

## Solana Trust Evaluation

Solana agents go through the same behavioral evaluation pipeline as EVM agents, with additional data from the QuantuLabs ATOM engine.

### Feedback Write-Back Loop

Unlike EVM (where feedback must be submitted manually), Solana agents benefit from **automatic feedback write-back**: after every sandbox test or gate evaluation, Valiron writes the computed score to the on-chain ATOM registry via `giveFeedback()`.

This means Solana agents build on-chain reputation automatically through normal Valiron usage:

```
Agent evaluated by Valiron sandbox
       ↓
Score computed (e.g. 92 / AA)
       ↓
Valiron calls giveFeedback() on-chain
       ↓
ATOM reputation updated
       ↓
Next evaluation includes new on-chain data
```

Requires `SOLANA_FEEDBACK_KEYPAIR` to be set. Write-back is fire-and-forget — if the transaction fails, the evaluation result is still returned.
