User pairing, authentication, and trust management
43
43%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./src/skills/bundled/pairing/SKILL.mdPair new users to Clodds, manage trust levels, and control access across channels.
/pair Request pairing (generates code)
/pair-code ABC123 Enter pairing code
/unpair Remove your pairing/pairing list List pending requests
/pairing approve <code> Approve pairing request
/pairing reject <code> Reject pairing request
/pairing users List paired users
/pairing remove <user> Remove user pairing/trust <user> owner Grant owner trust
/trust <user> paired Standard trust
/trust list List trust levelsimport { createPairingService } from 'clodds/pairing';
const pairing = createPairingService({
// Code settings
codeLength: 8,
codeExpiryMinutes: 60,
maxPendingPerChannel: 3,
// Auto-approve settings
autoApproveLocal: true, // Auto-approve localhost
autoApproveTailscale: true, // Auto-approve Tailscale IPs
autoApproveOwners: true, // Owners auto-approve their requests
// Storage
storage: 'sqlite',
dbPath: './pairing.db',
});// User requests pairing
const request = await pairing.createPairingRequest({
channelId: 'telegram-123',
userId: 'telegram-user-456',
username: 'johndoe',
displayName: 'John Doe',
});
console.log(`Pairing code: ${request.code}`);
console.log(`Expires: ${request.expiresAt}`);
console.log(`Share this code with an admin to get approved`);// Check if code is valid
const valid = await pairing.validateCode({
code: 'ABC123XY',
});
if (valid) {
console.log(`Valid code for user: ${valid.username}`);
console.log(`Channel: ${valid.channelId}`);
}// Admin approves pairing
await pairing.approveRequest({
code: 'ABC123XY',
approvedBy: 'admin-user-id',
trustLevel: 'paired',
});// Admin rejects pairing
await pairing.rejectRequest({
code: 'ABC123XY',
rejectedBy: 'admin-user-id',
reason: 'Unknown user',
});// Check if user is paired
const isPaired = await pairing.isPaired({
channelId: 'telegram-123',
userId: 'telegram-user-456',
});
if (isPaired) {
console.log('User is paired and can use Clodds');
}const trust = await pairing.getTrustLevel({
channelId: 'telegram-123',
userId: 'telegram-user-456',
});
console.log(`Trust level: ${trust}`);
// 'owner' | 'paired' | 'stranger'
// Check specific permission
if (trust === 'owner') {
console.log('Full admin access');
} else if (trust === 'paired') {
console.log('Standard trading access');
} else {
console.log('No access - must pair first');
}const pending = await pairing.listPendingRequests({
channelId: 'telegram-123', // Optional: filter by channel
});
for (const req of pending) {
console.log(`Code: ${req.code}`);
console.log(`User: ${req.username} (${req.displayName})`);
console.log(`Requested: ${req.createdAt}`);
console.log(`Expires: ${req.expiresAt}`);
}const users = await pairing.listPairedUsers({
channelId: 'telegram-123', // Optional: filter by channel
});
for (const user of users) {
console.log(`${user.username}: ${user.trustLevel}`);
console.log(` Paired: ${user.pairedAt}`);
console.log(` Approved by: ${user.approvedBy}`);
}const isOwner = await pairing.isOwner({
channelId: 'telegram-123',
userId: 'telegram-user-456',
});
if (isOwner) {
console.log('User has owner privileges');
}// Remove user's pairing
await pairing.removePairing({
channelId: 'telegram-123',
userId: 'telegram-user-456',
});| Level | Access |
|---|---|
| owner | Full admin: approve users, manage settings, trading |
| paired | Standard: trading, portfolio, queries |
| stranger | None: must pair first |
ABC234XY| Condition | Behavior |
|---|---|
| Localhost | Auto-approve with owner trust |
| Tailscale IP | Auto-approve with owner trust |
| Owner request | Auto-approve their other channels |
| Feature | Description |
|---|---|
| Code expiry | Codes expire after 1 hour |
| Rate limiting | Max 3 pending per channel |
| Unambiguous codes | No confusable characters |
| Audit trail | Who approved/rejected when |
# List pending pairing requests
clodds pairing list telegram
# Approve a request
clodds pairing approve ABC234XY
# List paired users
clodds pairing users telegram
# Add user directly (bypass code)
clodds pairing add telegram user-123
# Remove user
clodds pairing remove telegram user-123e71a5f6
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.