Back to Blog
Agent Trust Scoring: How to Build Dynamic Trust for Autonomous AI
Technical Guide·10 min read·

Agent Trust Scoring: How to Build Dynamic Trust for Autonomous AI

C

Claw GRC Team

Claw GRC Team

A deep technical guide to implementing dynamic trust scores for AI agents. Covers scoring algorithms, signal weighting, enforcement mechanisms, and how trust enables safe autonomous agent operation.

Agent Trust Scoring: How to Build Dynamic Trust for Autonomous AI

Static access control doesn't work for AI agents. Unlike human users who have a stable job function, AI agents have dynamic risk profiles that change based on their behavior, compliance history, and security posture. Trust scoring is the solution.

What Is Agent Trust Scoring?

A trust score is a dynamic, real-time assessment of an AI agent's trustworthiness. It's calculated continuously from multiple signals and determines:

  • What actions the agent can take autonomously
  • What requires human approval
  • What systems the agent can access
  • Whether the agent can interact with other agents

Think of it like a credit score for AI agents — except instead of creditworthiness, it measures compliance, behavioral consistency, and security posture.

The Trust Score Formula

Claw GRC uses this weighted formula:

trust_score = (
  compliance_adherence    × 0.25 +
  behavioral_consistency  × 0.20 +
  security_assessment     × 0.20 +
  uptime_reliability      × 0.10 +
  attestation_currency    × 0.10 +
  incident_history        × 0.15
)

Each component is normalized to 0.0-1.0 before weighting.

Signal Deep Dive

Compliance Adherence (25%)

Measures whether the agent's applicable compliance controls have current, valid evidence.

Calculation:

def compliance_adherence_score(agent_id: str) -> float:
    controls = get_applicable_controls(agent_id)
    if not controls:
        return 1.0  # No applicable controls = full score
    
    compliant = 0
    for control in controls:
        evidence = get_latest_evidence(control.id, agent_id)
        if evidence and is_fresh(evidence, control.freshness_days):
            compliant += 1
    
    return compliant / len(controls)

What makes a control compliant:

  • Evidence exists (not just "acknowledged")
  • Evidence is within freshness window (e.g., 90 days)
  • Evidence is validated (not just uploaded)

Score degradation: If an agent's compliance evidence expires, its score drops immediately. This creates an incentive to keep evidence current.

Behavioral Consistency (20%)

Measures deviation from the agent's declared interaction patterns.

Calculation:

def behavioral_consistency_score(agent_id: str, window_days: int = 30) -> float:
    declared = get_declared_patterns(agent_id)
    observed = get_observed_interactions(agent_id, window_days)
    
    anomalies = 0
    for interaction in observed:
        if not matches_any_declared_pattern(interaction, declared):
            anomalies += 1
    
    if not observed:
        return 1.0  # No interactions = no anomalies
    
    anomaly_rate = anomalies / len(observed)
    # Use inverse sigmoid to make small anomaly rates tolerable
    return max(0, 1 - (anomaly_rate * 1.5))

What counts as an anomaly:

  • Accessing a data classification not in the declared scope (e.g., accessing PII when declared as non-PII agent)
  • Calling a system not in the declared integration list
  • Making a decision type not in the declared authority scope
  • Interaction frequency outside normal baseline (±3 sigma)

Security Assessment (20%)

Reflects the results of security testing of the agent and its dependencies.

Calculation:

def security_assessment_score(agent_id: str) -> float:
    assessment = get_latest_security_assessment(agent_id)
    if not assessment:
        return 0.5  # Unknown = partial trust
    
    # Age penalty: assessment degrades over time
    age_days = (now() - assessment.completed_at).days
    age_factor = max(0.5, 1 - (age_days / 365))  # Min 0.5 at 1 year
    
    # Finding penalty
    critical = assessment.critical_findings
    high = assessment.high_findings
    medium = assessment.medium_findings
    
    finding_penalty = (critical * 0.20) + (high * 0.05) + (medium * 0.01)
    finding_score = max(0, 1 - finding_penalty)
    
    return finding_score * age_factor

Assessment types:

  • DAST scan of agent's HTTP interfaces
  • Dependency vulnerability scan
  • Configuration audit
  • Prompt injection testing (for LLM-based agents)
  • Manual penetration test (for high-trust agents)

Uptime and Reliability (10%)

Reflects the agent's availability and response consistency.

Calculation:

def uptime_score(agent_id: str, window_days: int = 30) -> float:
    metrics = get_uptime_metrics(agent_id, window_days)
    
    availability_score = metrics.uptime_percent / 100
    
    # Response time consistency (coefficient of variation)
    cv = metrics.response_time_cv  # Lower = more consistent
    consistency_score = max(0, 1 - (cv - 0.1))  # Penalize CV > 10%
    
    return (availability_score * 0.7) + (consistency_score * 0.3)

Attestation Currency (10%)

Rewards agents that regularly confirm their identity card is accurate.

Calculation:

def attestation_score(agent_id: str) -> float:
    agent = get_agent(agent_id)
    
    if not agent.last_attestation:
        return 0.3  # Never attested = low score
    
    days_since = (now() - agent.last_attestation).days
    
    if days_since <= 30:
        return 1.0
    elif days_since <= 90:
        return 0.9
    elif days_since <= 180:
        return 0.7
    elif days_since <= 365:
        return 0.5
    else:
        return 0.2  # Over 1 year with no attestation

What attestation means: The agent (or its human operator) confirms that the identity card is still accurate: capabilities, data classifications, interaction patterns, and deployment environment haven't changed without updating the card.

Incident History (15%)

Historical weight of security incidents and policy violations.

Calculation:

def incident_score(agent_id: str) -> float:
    incidents = get_incidents(agent_id, months=12)
    
    if not incidents:
        return 1.0
    
    # Weight by recency and severity
    total_penalty = 0
    for incident in incidents:
        age_months = months_ago(incident.occurred_at)
        recency_weight = max(0.1, 1 - (age_months / 12))
        
        severity_weight = {
            'critical': 0.30,
            'high': 0.15,
            'medium': 0.05,
            'low': 0.02
        }.get(incident.severity, 0.05)
        
        total_penalty += severity_weight * recency_weight
    
    return max(0, 1 - total_penalty)

Trust Score Tiers and Enforcement

Score Tier What the Agent Can Do
0.90-1.00 Trusted Full autonomous operation within declared scope
0.75-0.89 Verified Autonomous with enhanced logging; human review for high-stakes
0.60-0.74 Provisional Human approval required for consequential decisions
0.40-0.59 Restricted Read-only; no autonomous actions permitted
0.00-0.39 Suspended No operation until score recovers

Enforcing Trust Scores

Trust scores are only useful if they're enforced. Enforcement points:

1. Agent Discovery: When an agent queries for other agents to collaborate with, trust score is a filter:

# Agent looks for high-trust collaborators
trusted_agents = discover_agents(
    capabilities=["evidence_collection"],
    min_trust_score=0.75
)

2. Agent Invocation: Before allowing agent-to-agent invocation:

# Before forwarding invocation
if target_agent.trust_score < caller.min_trust_threshold:
    raise TrustScoreError(
        f"Target agent trust score ({target_agent.trust_score}) "
        f"below required threshold ({caller.min_trust_threshold})"
    )

3. Data Access: Data access policies can reference trust score:

# Access control policy
if data.classification == "PII" and agent.trust_score < 0.80:
    raise AccessDeniedError("PII access requires trust score ≥ 0.80")

4. Human Escalation: Low-trust agents automatically escalate:

if agent.trust_score < 0.75 and action.impact == "high":
    await escalate_to_human(action, reason="low_trust_agent")

Score Recovery

When a trust score drops, agents can recover it through:

  1. Compliance remediation: Fix failing controls, update stale evidence
  2. Clean security assessment: Run and pass a new security test
  3. Behavioral reset: 30-day window with no anomalies
  4. Incident resolution: Resolve open security incidents
  5. Attestation: Confirm identity card is current

Trust score recovery should be gradual — not immediate. This prevents gaming the system.

Implementation Example

class TrustScorer:
    WEIGHTS = {
        'compliance': 0.25,
        'behavioral': 0.20,
        'security': 0.20,
        'uptime': 0.10,
        'attestation': 0.10,
        'incident': 0.15,
    }
    
    def calculate(self, agent_id: str) -> TrustScore:
        factors = {
            'compliance': self.compliance_score(agent_id),
            'behavioral': self.behavioral_score(agent_id),
            'security': self.security_score(agent_id),
            'uptime': self.uptime_score(agent_id),
            'attestation': self.attestation_score(agent_id),
            'incident': self.incident_score(agent_id),
        }
        
        weighted_score = sum(
            score * self.WEIGHTS[name]
            for name, score in factors.items()
        )
        
        return TrustScore(
            agent_id=agent_id,
            score=round(weighted_score, 4),
            level=self.score_to_level(weighted_score),
            factors=[
                TrustFactor(
                    name=name,
                    score=score,
                    weight=self.WEIGHTS[name],
                    weighted_contribution=score * self.WEIGHTS[name]
                )
                for name, score in factors.items()
            ],
            calculated_at=datetime.utcnow()
        )

Trust Scores in Claw GRC

Claw GRC calculates trust scores for every registered agent in real-time. The Agent detail page shows:

  • Current trust score with tier indicator
  • Historical score trend
  • Per-factor breakdown with explanations
  • Specific actions to improve the score

View your agent trust scores →

CG

Get started with Claw GRC

AI-native compliance automation. 1,026+ controls. MCP-native. Free workspace, no credit card.

Start Free →