SDK — Governance
The rivano.governance resource gives you a programmatic view of your organization’s AI governance posture — current score, historical trend, actionable recommendations, and a full audit trail of changes.
Posture score
The posture score is a 0–100 rating of your governance health, factoring in policy coverage, incident rate, and compliance status:
import Rivano from '@rivano/sdk';
const rivano = new Rivano({ apiKey: 'rv_...' });
const posture = await rivano.governance.posture();
console.log('Score:', posture.score, '/ 100');
console.log('Rating:', posture.rating); // "good" | "fair" | "poor"
console.log('Policy coverage:', posture.policyCoverage, '%');
console.log('Incident rate:', posture.incidentRate, '%'); Posture history
Returns a time series of posture scores, useful for trend dashboards:
import Rivano from '@rivano/sdk';
const rivano = new Rivano({ apiKey: 'rv_...' });
const history = await rivano.governance.postureHistory();
for (const snapshot of history) {
console.log(snapshot.date, snapshot.score);
}
Recommendations
Returns a prioritized list of actions to improve your posture score:
import Rivano from '@rivano/sdk';
const rivano = new Rivano({ apiKey: 'rv_...' });
const recommendations = await rivano.governance.recommendations();
for (const rec of recommendations) {
console.log(`[${rec.priority}] ${rec.title}`);
console.log(` ${rec.description}`);
console.log(` Impact: +${rec.scoreImpact} points`);
} Sort recommendations by scoreImpact to prioritize the changes that improve your posture the most. High-impact items typically involve enabling the foundational policy pack or configuring alert channels.
Changelog
The changelog is an append-only audit trail of all configuration changes in your tenant — policies created or modified, agents deployed, API keys issued, team membership changes:
import Rivano from '@rivano/sdk';
const rivano = new Rivano({ apiKey: 'rv_...' });
const { data, total } = await rivano.governance.changelog({
limit: 50,
offset: 0,
});
console.log(`${total} changelog entries`);
for (const entry of data) {
console.log(`${entry.timestamp} [${entry.actorEmail}] ${entry.action} ${entry.resourceType}/${entry.resourceId}`);
} ChangeLogEntry fields
| Field | Type | Description |
|---|---|---|
id | string | Entry ID |
timestamp | string | ISO 8601 when the change occurred |
actorEmail | string | User who made the change |
action | string | created, updated, deleted, deployed |
resourceType | string | policy, agent, api_key, team_member |
resourceId | string | ID of the changed resource |
diff | object | Before/after values (where available) |
Error handling
| Error | When it occurs |
|---|---|
SdkAuthError | Invalid API key |
SdkForbiddenError | Insufficient permissions to view governance data |
SdkError | Invalid pagination parameters |
Related
- SDK Policies — Manage the policies that affect your posture score
- SDK Compliance — Generate formal compliance framework reports
- SDK Alerts — Get notified when posture drops below a threshold