A comprehensive trust, security, and permission management plugin for ElizaOS, providing multi-dimensional trust scoring, context-aware permissions, and advanced security features.
- Multi-dimensional Trust System: Calculate and track trust scores across multiple dimensions (reliability, competence, integrity, benevolence, transparency)
- Context-aware Permission Management: Dynamic permission system that adapts based on trust levels and context
- Security Module: Advanced threat detection including prompt injection, credential theft, and phishing attempts
- Permission Elevation System: Temporary permission elevation based on trust and justification
- Credential Protection: Automatic detection and prevention of credential theft attempts
- LLM-based Evaluation: AI-powered security threat and trust action evaluation
- Role Management: Hierarchical role system with OWNER, ADMIN, and NONE roles
- Settings Management: Onboarding and configuration system for world/server settings
- Trust Interaction Tracking: Record and analyze trust-affecting behaviors
- Security Event Monitoring: Track and respond to security incidents with trust impact
As this is a workspace package, it's installed as part of the ElizaOS monorepo:
bun installThe plugin requires the following environment variables:
# World Configuration (Optional)
WORLD_ID=your_world_id
# Security Settings (Optional)
TRUST_SCORE_THRESHOLD=60 # Minimum trust score for certain actions
SECURITY_ALERT_THRESHOLD=0.8 # Threshold for security alerts
CREDENTIAL_SCAN_ENABLED=true # Enable credential theft scanning
# Permission Settings (Optional)
ELEVATION_DURATION_MINUTES=60 # Default elevation duration
MAX_ELEVATION_REQUESTS=5 # Max elevation requests per user per day{
"plugins": [
...otherPlugins,
"@elizaos/plugin-trust"
]
}The plugin provides the following actions:
-
UPDATE_ROLE - Assign roles (Admin, Owner, None) to users in a channel
- Similes:
CHANGE_ROLE,SET_PERMISSIONS,ASSIGN_ROLE,MAKE_ADMIN
- Similes:
-
UPDATE_SETTINGS - Save configuration settings during onboarding
- Similes:
UPDATE_SETTING,SAVE_SETTING,SET_CONFIGURATION,CONFIGURE
- Similes:
-
RECORD_TRUST_INTERACTION - Record trust-affecting interactions between entities
- Similes:
record trust event,log trust interaction,track behavior
- Similes:
-
EVALUATE_TRUST - Evaluate trust score and profile for an entity
- Similes:
check trust score,trust rating,show trust level
- Similes:
-
REQUEST_ELEVATION - Request temporary elevation of permissions
- Similes:
need temporary access,request higher privileges,elevate my permissions
- Similes:
The plugin includes four state providers:
- roleProvider - Provides role information for entities in a world
- settingsProvider - Provides current settings and configuration state
- trustProfileProvider - Provides detailed trust profile information
- securityStatusProvider - Provides current security status and threat level
- reflectionEvaluator - Analyzes interactions for trust-affecting behaviors
- trustChangeEvaluator - Automatically detects and records trust changes based on behavior patterns
The plugin registers five core services:
-
TrustEngine (
trust-engine)- Multi-dimensional trust scoring and evidence-based evaluation
- Trust profile calculation and decision making
- Interaction history tracking
-
SecurityModule (
security-module)- Threat detection and assessment
- Prompt injection detection
- Phishing and impersonation detection
- Security event logging with trust impact
-
ContextualPermissionSystem (
contextual-permissions)- Dynamic permission checking based on trust and context
- Permission elevation request handling
- Role-based access control integration
-
CredentialProtector (
credential-protector)- Credential theft detection and prevention
- Sensitive data protection
- Victim alerting system
-
LLMEvaluator (
llm-evaluator)- AI-powered security threat evaluation
- Behavioral analysis and anomaly detection
- Trust action evaluation with reasoning
The trust system evaluates entities across five dimensions:
- Reliability: Consistency in behavior and keeping promises
- Competence: Skill and capability demonstrations
- Integrity: Ethical behavior and honesty
- Benevolence: Positive intentions and helpfulness
- Transparency: Openness and clarity in communication
enum TrustEvidenceType {
PROMISE_KEPT = 'PROMISE_KEPT',
PROMISE_BROKEN = 'PROMISE_BROKEN',
HELPFUL_ACTION = 'HELPFUL_ACTION',
HARMFUL_ACTION = 'HARMFUL_ACTION',
VERIFICATION_SUCCESS = 'VERIFICATION_SUCCESS',
VERIFICATION_FAILURE = 'VERIFICATION_FAILURE',
COMMUNITY_CONTRIBUTION = 'COMMUNITY_CONTRIBUTION',
SECURITY_VIOLATION = 'SECURITY_VIOLATION',
SPAM_BEHAVIOR = 'SPAM_BEHAVIOR',
SUSPICIOUS_ACTIVITY = 'SUSPICIOUS_ACTIVITY'
}The system supports various permission actions:
manage_roles: Ability to change user rolesmanage_settings: Ability to modify world/server settingsmoderate_content: Content moderation capabilitiesaccess_sensitive: Access to sensitive informationexecute_admin: Execute administrative commands
Users can request temporary permission elevation based on:
- Current trust score
- Justification provided
- Context of the request
- Historical behavior
The security module detects:
- Prompt injection attempts
- Credential theft attempts
- Phishing messages
- Impersonation attempts
- Multi-account abuse patterns
- Suspicious behavioral patterns
When threats are detected:
- Security event is logged
- Trust score is impacted
- Potential victims are alerted
- Access may be restricted
The plugin includes comprehensive E2E tests accessible via:
import { tests } from '@elizaos/plugin-trust';Run tests with:
bun test// User: "What is my trust score?"
// Agent: "Trust Level: Good (65/100) based on 42 interactions"
// User: "Show detailed trust profile for Alice"
// Agent provides detailed breakdown of trust dimensions// User: "Make @john an ADMIN"
// Agent: "Updated john's role to ADMIN."// User: "I need permission to manage roles to help moderate spam"
// Agent evaluates request based on trust and grants/deniesThe plugin uses Drizzle ORM with the following main tables:
trustInteractions: Stores all trust-affecting interactionstrustProfiles: Caches calculated trust profilessecurityEvents: Logs security-related eventspermissionGrants: Tracks permission elevations
- Trust scores range from 0-100 and affect available permissions
- The system maintains a complete audit trail of all trust-affecting actions
- Permission elevation is temporary and logged for security
- Trust profiles are recalculated based on recent interactions
- Security threats immediately impact trust scores
- The plugin integrates seamlessly with ElizaOS's world and role systems
- All actions respect the hierarchical role system (OWNER > ADMIN > NONE)
@elizaos/core: Core ElizaOS functionality@elizaos/plugin-anthropic: LLM evaluation capabilitiesdrizzle-orm: Database ORM for trust data persistencededent: String formatting for templates