Add Trust Scoring to Your AI Agent with 3 Lines of Code
The fastest path from no trust infrastructure to a fully scored AI agent. Initialize, report, and query. That is it.
By Credian Team
The Whole Integration
Here it is. Three lines. No boilerplate, no configuration files, no middleware setup.
import { Credian } from 'credian';
const credian = new Credian({ apiKey: 'cred_...' });
const score = await credian.scores.get();
That third line returns your agent's trust score, including the overall score (0 to 1000), a confidence level, and a full breakdown across reliability, financial, and identity dimensions. The API key automatically resolves to your agent's identity. No agent ID needed.
Wait, What About Events?
A score needs data. Without events, your agent starts at a baseline score of 100. To build a meaningful score, report what your agent does:
// After your agent completes a task
await credian.events.report({
type: 'task.completed',
data: { duration: 1200, success: true },
});
// After a payment
await credian.events.report({
type: 'payment.completed',
data: { amount: 5000, currency: 'USD' },
});
Each event feeds into the scoring engine. Task events affect reliability. Payment events affect financial. The more events you report, the higher the confidence level, and the more accurate the score becomes.
Before and After
Here is what changes when you add trust scoring to an existing agent:
Before: An agent without trust context
async function handleRequest(task: Task) {
// No trust data. Every agent is treated equally.
// No way to differentiate reliable agents from unreliable ones.
// No audit trail. No accountability.
const result = await processTask(task);
return result;
}
After: An agent with a verifiable score
import { Credian } from 'credian';
const credian = new Credian({ apiKey: process.env.CREDIAN_API_KEY });
async function handleRequest(task: Task) {
const result = await processTask(task);
// Report the outcome
await credian.events.report({
type: result.success ? 'task.completed' : 'task.failed',
data: { taskId: task.id, duration: result.duration },
});
return result;
}
The operational code barely changes. You add two lines: the import and the event report. But the impact is significant. Your agent now has a growing, verifiable trust record that any platform can query.
What Platforms See
When a platform queries your agent's score, they get a complete picture:
{
"overallScore": 742,
"confidence": "high",
"breakdown": {
"reliability": {
"score": 810,
"weight": 0.4,
"isActive": true
},
"financial": {
"score": 690,
"weight": 0.35,
"isActive": true
},
"identity": {
"score": 720,
"weight": 0.25,
"isActive": true
}
},
"eventCount": 1247,
"calculatedAt": "2026-04-03T10:30:00Z"
}
A platform can make informed decisions: should this agent have a higher transaction limit? Should it be allowed to access premium APIs? Should it be required to provide collateral? The score provides the signal. The platform sets the policy.
Getting Started
The fastest path:
- Run
npx credian loginto create your agent and get an API key - Add
npm install credianto your project - Add the three lines above to your agent code
- Start reporting events as your agent operates
The free tier includes 10 agents and 1,000 score lookups per month. No credit card required.
Full SDK documentation: See the Credian docs for the complete API reference, event type catalog, and integration guides.