Skip to main content

What trust scores are

A trust score is a 0–100 number that reflects how much an agent has earned autonomous operation. New agents start with a baseline of 50. Over time, successful calls raise the score; denied requests, permission violations, and anomalous patterns lower it. The score maps to one of five named levels that your application can use to gate behavior, requiring human approval for low-trust agents, unlocking faster paths for high-trust ones. Scores are computed from the audit log, not guessed. An agent cannot self-report a high score.

TrustScore fields

string
The agent this score belongs to.
number
Numeric value from 0 to 100.
'untrusted' | 'limited' | 'standard' | 'trusted' | 'elevated'
Named trust level derived from the score.
number
Percentage of all calls that were allowed.
number
Percentage of all calls that were denied.
number
Days since the agent was created.
number
Total authorization calls in the audit log.
number
Denied calls matching privilege escalation patterns.
string | undefined
ISO timestamp of the most recent denied call.
string
ISO timestamp of when this score was last computed.

How scores are computed

The formula starts at 50 and applies adjustments:
An agent with 200 successful calls, no denials, and 40 days of history scores: 50 + 2 + 10 = 62, landing in the standard band.

Trust levels

The default thresholds can be overridden at init:

Code examples

Compute a score on demand

computeScore always reads live audit data and writes the result to the trust_scores table. Call it whenever you need a fresh value.

Read the last computed score

getScore returns the cached row from the database without recomputing. It returns null for agents that have never been scored.

Recompute scores for all active agents

Useful for a scheduled job that refreshes scores nightly or after a batch of activity.

Filter agents by trust level

getScores reads from the trust_scores table. Agents that have not been scored yet do not appear in results.

Gate sensitive operations by trust level

Scores are recomputed on demand. KavachOS does not maintain a background scorer. Call computeScore or computeAll on a schedule that fits your use case, every request, every few minutes, or nightly.

Next steps

Anomaly detection

Surface unusual patterns in agent behavior.

Approval flows

Route high-risk actions through human review.

Audit trail

The raw data that feeds trust scoring.
Last modified on April 29, 2026