TrustEngine maintains a per-agent trust score that evolves over time based on approval history. Agents that consistently make safe decisions earn higher trust, which reduces friction by lowering their effective risk. Agents involved in incidents have their trust immediately penalized.
Core Formula
The trust score is computed as:| Component | Description |
|---|---|
weighted_success_rate | Ratio of approved-to-total decisions, weighted by recency |
recency_factor | Exponential decay — recent decisions count more than old ones |
incident_penalty | Multiplicative penalty: 0.7 per recorded incident |
Parameters
| Parameter | Default | Description |
|---|---|---|
initial_score | 0.3 | Trust score assigned to new agents |
ceiling | 0.9 | Maximum achievable trust score |
decay_rate | 0.01/day | Rate at which trust decays without activity |
incident_penalty | 0.7 | Multiplicative factor per incident (1 incident = 0.7x, 2 = 0.49x) |
influence | 0.3 | How much trust can adjust effective risk |
The trust ceiling of
0.9 is intentional — no agent should ever reach full trust. Even the most reliable agent maintains a residual uncertainty factor.Effective Risk Adjustment
Trust modifies the raw risk score using theinfluence parameter:
How This Works
- When trust is exactly 0.5 — no adjustment (multiplier is 1.0)
- When trust is above 0.5 — risk is reduced (multiplier < 1.0)
- When trust is below 0.5 — risk is increased (multiplier > 1.0)
Example Calculations
| Raw Risk | Trust | Calculation | Effective Risk | Level Change |
|---|---|---|---|---|
| 0.55 | 0.8 | 0.55 × (1.0 - (0.8-0.5) × 0.3) = 0.55 × 0.91 | 0.50 | MEDIUM (unchanged) |
| 0.55 | 0.9 | 0.55 × (1.0 - (0.9-0.5) × 0.3) = 0.55 × 0.88 | 0.48 | MEDIUM (unchanged) |
| 0.35 | 0.9 | 0.35 × (1.0 - (0.9-0.5) × 0.3) = 0.35 × 0.88 | 0.31 | MEDIUM (unchanged) |
| 0.32 | 0.9 | 0.32 × (1.0 - (0.9-0.5) × 0.3) = 0.32 × 0.88 | 0.28 | MEDIUM -> LOW |
| 0.55 | 0.2 | 0.55 × (1.0 - (0.2-0.5) × 0.3) = 0.55 × 1.09 | 0.60 | MEDIUM -> HIGH |
Usage
Trust Lifecycle
A typical agent’s trust evolves through these stages:Phase 1: Ramp-up (Days 1–30)
A new agent starts atinitial_score=0.3. Each successful approval increases trust. The rate of increase slows as the agent approaches the ceiling.
Phase 2: Steady State (Days 30+)
Trust stabilizes near the ceiling (0.9). Thedecay_rate ensures that inactive agents gradually lose trust — an agent that goes 30 days without activity loses approximately 1 - e^(-0.01 × 30) ≈ 26% of its trust.
Phase 3: Incident (Any Time)
Whenrecord_incident() is called, trust is multiplied by incident_penalty=0.7. Two incidents reduce trust to 0.49x of its pre-incident value. This creates a sharp, immediate consequence for unsafe behavior.
Phase 4: Recovery
After an incident, the agent can rebuild trust through consistent successful approvals. Recovery follows the same ramp-up curve but starts from the penalized level.Methods Reference
| Method | Effect | Trust Impact |
|---|---|---|
compute_trust(agent_id) | Returns current trust score | Read-only |
effective_risk(raw_risk, agent_id, domain=None) | Returns trust-adjusted risk | Read-only |
record_success(agent_id, action_name, domain="general", risk_score=0.5) | Records a successful approval | Increases trust |
record_denial(agent_id, action_name, domain="general", risk_score=0.5) | Records a denied action | Slight decrease |
record_incident(agent_id, action_name="", domain="general", severity="medium") | Records a security incident | 0.7x penalty |
revoke(agent_id) | Immediately revokes all trust | Resets to 0.0 |
Integration with Attesta
The trust engine is integrated when you pass aTrustEngine to Attesta.
Trust adjustments apply when each action includes an agent_id / agentId.
Configuration via YAML
attesta.yaml
Risk Levels
How trust adjustment can shift risk levels
Audit Trail
All trust-related events are recorded in the audit log