# SuilaAI Agent TrustRank Skill

> Trust scoring for AI agents. Returns a FICO-style score (300-850)
> with full signal breakdown across 26 behavioral signals and 4 pillars.
> "Moody's for AI Agents" — accountable autonomy, quantified.

## Tools

Six trust-verification tools available via SDK, MCP, or smolagents.

### credit_check

Quick credit check for a single agent. Sub-50ms response time.

```
GET https://trustrank.suila.ai/api/v1/credit-check/{agent_id}
Authorization: Bearer <JWT_TOKEN>
```

#### Output

```json
{
  "agent_id": "cortex-7b-uuid",
  "trust_rank": 782,
  "rating_class": "AAA",
  "credit_watch": false,
  "risk_level": "low",
  "checked_at": "2026-02-19T14:23:00Z"
}
```

### batch_credit_check

Credit-check up to 100 agents in a single request.

```
POST https://trustrank.suila.ai/api/v1/credit-check/batch
Content-Type: application/json
```

#### Input

```json
{
  "agent_ids": ["agent-uuid-1", "agent-uuid-2", "agent-uuid-3"]
}
```

#### Output

```json
{
  "results": [
    { "agent_id": "agent-uuid-1", "trust_rank": 782, "rating_class": "AAA", "risk_level": "low" },
    { "agent_id": "agent-uuid-2", "trust_rank": 614, "rating_class": "BBB", "risk_level": "medium" }
  ],
  "total": 3,
  "succeeded": 2,
  "failed": 1
}
```

### delegation_preauth

Pre-authorize delegation from an orchestrator to sub-agents. Uses softmin trust propagation for weakest-link accountability.

```
POST https://trustrank.suila.ai/api/v1/credit-check/delegation
Content-Type: application/json
```

#### Input

```json
{
  "orchestrator_id": "orchestrator-uuid",
  "delegate_ids": ["agent-uuid-1", "agent-uuid-2"],
  "task_type": "code-review"
}
```

#### Output

```json
{
  "authorized": true,
  "orchestrator_id": "orchestrator-uuid",
  "delegate_ids": ["agent-uuid-1", "agent-uuid-2"],
  "task_type": "code-review",
  "chain_trust_score": 714,
  "weakest_link_id": "agent-uuid-2",
  "weakest_link_score": 614,
  "risk_level": "low",
  "denial_reasons": [],
  "checked_at": "2026-02-19T14:23:00Z"
}
```

### get_scorecard

Full 26-signal trust scorecard — the "credit report" for an agent.

```
GET https://trustrank.suila.ai/api/v1/agents/{agent_id}/scorecard
```

#### Output

```json
{
  "agent_id": "cortex-7b-uuid",
  "agent_name": "Cortex-7B",
  "overall_rank": 12,
  "trust_rank": 782,
  "pillars": [
    {
      "pillar_name": "Provenance",
      "score": 0.91,
      "signals": [
        { "signal_name": "identity_verification", "normalized_value": 0.95, "weight": 0.20 },
        { "signal_name": "model_card_completeness", "normalized_value": 0.88, "weight": 0.15 }
      ]
    }
  ],
  "fidelity_metric": 0.94,
  "credit_watch": false,
  "computed_at": "2026-02-19T14:23:00Z"
}
```

### search_agents

Search for agents by name with optional minimum TrustRank filter.

```
GET https://trustrank.suila.ai/api/v1/agents/marketplace?query=cortex&min_score=650
```

### verify_certificate

Verify a W3C Verifiable Credential trust certificate.

```
POST https://trustrank.suila.ai/api/v1/gateway/certificates/{certificate_id}/verify
```

#### Output

```json
{
  "valid": true,
  "certificate_id": "cert-uuid",
  "agent_id": "cortex-7b-uuid",
  "trust_rank": 782,
  "issued_at": "2026-02-19T14:00:00Z",
  "expires_at": "2026-03-19T14:00:00Z"
}
```

## Rating Classes

| Class | TrustRank | Risk Level | Meaning                        |
|-------|-----------|------------|--------------------------------|
| AAA   | 800-850   | low        | Highest trust — auto-delegate  |
| AA    | 750-799   | low        | Very strong trust              |
| A     | 700-749   | low        | Strong trust                   |
| BBB   | 650-699   | medium     | Adequate trust                 |
| BB    | 600-649   | medium     | Speculative                    |
| B     | 550-599   | high       | Highly speculative             |
| CCC   | 500-549   | high       | Substantial risk               |
| CC    | 400-499   | critical   | Extremely speculative          |
| C     | 350-399   | critical   | Near default                   |
| D     | 300-349   | critical   | Default — do not delegate      |

## Four Pillars

| Pillar     | Weight | What it measures                                      |
|------------|--------|-------------------------------------------------------|
| Provenance | 25%    | Identity, model card, training data lineage           |
| Temporal   | 25%    | Behavioral stability, drift detection, version history|
| Semantic   | 25%    | Output fidelity, hallucination rate, factuality       |
| Context    | 25%    | Task-appropriateness, delegation safety, tool usage   |

## TrustRank Formula

```
TrustRank = 300 + 550 * Σ(wᵢ · Pᵢ)   where Σwᵢ = 1.0
```

Weights are learned via Ridge Regression from behavioral outcomes (Kaizen Loop).

## Python SDK

```bash
pip install suila-trustrank-sdk
```

```python
from suila_sdk import SuilaTrustRankClient

async with SuilaTrustRankClient() as client:
    result = await client.credit_check("agent-uuid")
    print(f"TrustRank: {result.trust_rank}")   # 782
    print(f"Rating: {result.rating_class}")      # AAA
    print(f"Risk: {result.risk_level}")          # low
```

Environment variables:

```
SUILA_API_URL=https://trustrank.suila.ai/api/v1
SUILA_CLIENT_ID=your-client-id
SUILA_CLIENT_SECRET=your-client-secret
```

## MCP Server

```bash
pip install suila-trustrank-mcp
```

Add to `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "suila-trustrank": {
      "command": "python",
      "args": ["-m", "suila_mcp"],
      "env": {
        "SUILA_API_URL": "https://trustrank.suila.ai/api/v1",
        "SUILA_CLIENT_ID": "your-client-id",
        "SUILA_CLIENT_SECRET": "your-client-secret"
      }
    }
  }
}
```

Once configured, Claude and Cursor can use all 6 tools natively.

## smolagents Integration

```bash
pip install suila-trustrank-smolagents
```

```python
from smolagents import CodeAgent, HfApiModel
from suila_tools import TrustCheckTool, DelegationCheckTool

agent = CodeAgent(
    tools=[TrustCheckTool(), DelegationCheckTool()],
    model=HfApiModel(),
)

agent.run("Check trust of agent abc-123 before delegating code-review")
```

## Example Agent Usage

An orchestrator agent vetting delegates before a multi-agent workflow:

```
User: "Delegate the data-analysis task to agent-pool-7"

Agent calls credit_check("agent-pool-7")
  → trust_rank: 714, rating_class: A, risk_level: low

Agent calls delegation_preauth(
  orchestrator_id="orchestrator-main",
  delegate_ids=["agent-pool-7"],
  task_type="data-analysis"
)
  → authorized: true, chain_trust_score: 714

Agent: "Agent Pool-7 has TrustRank 714 (A rating, low risk).
        Delegation authorized. Proceeding with task assignment."
```

## Rate Limits

- Authenticated API: 1,000 req/min (Growth), 10,000 req/min (Enterprise)
- Batch endpoint: 100 agents per request
- Snowflake Native App: Unlimited (runs on your warehouse)

## Patent Notice

Protected under US Patent 12,505,169 B2 and Taiwan Patent I892115.
Kaizen Loop Learning is a trademark of SuilaAI.
