[](https://clawhub.ai/skills/tribe-protocol) [](https://opensource.org/licenses/MIT) [](https://github.com/jugaad-lab/tribe-protocol/stargazers)
**Install via ClawHub:** `clawhub install tribe-protocol`
β Found this useful? Star this repo to help others discover it!
Trust lookup system for OpenClaw bots.
π If you find this useful, please β star this repo! It helps other developers discover trust & access control tools for AI bots.
A SQLite-backed identity and trust database that bots query before responding to any non-owner message. Enforces trust tiers, channel access rules, and data boundaries.
When multiple bots operate in shared Discord servers, they need a way to:
- Know who's talking to them (human? bot? what tier?)
- Enforce data boundaries (no leaking private files to strangers)
- Track relationships and access across servers
- Audit trust changes over time
Tribe Protocol solves this with a simple SQLite database and bash CLI.
# Clone to your skills or projects directory
git clone https://github.com/jugaad-lab/tribe-protocol.git
# Initialize the database
./scripts/tribe.sh init \
--bot-name YourBot \
--bot-discord-id YOUR_BOT_DISCORD_ID \
--human-name YourName \
--human-discord-id YOUR_DISCORD_ID \
--server electrons:000000000000000008 \
--server discclawd:000000000000000007The --server flag (repeatable) pre-populates server roles for your bot and owner at init time. Format: slug:guild_id.
This creates:
~/clawd/tribe/tribe.dbβ the database~/clawd/TRIBE.mdβ behavioral trigger file (loaded into system prompt, survives context compaction)
# The most important command β run before responding to non-owners
./scripts/tribe.sh lookup 000000000000000001Output:
π Yajat | human | Tier 3 (tribe) | Status: active
Relationship: Co-founder
Platforms: discord:000000000000000001
Servers: discclawd/admin, electrons/admin
Tags: founding-four
π’ TIER 3 RULES: Collaborate freely. Protect private data (USER.md, MEMORY.md, health/*, portfolio/*).
# Add a new entity
./scripts/tribe.sh add \
--name Jarvis --type bot \
--discord-id 000000000000000006 \
--tier 2 --owner Shahbaaz \
--framework openclaw \
--tag lp-bot \
--server electrons --role bot
# Update trust tier
./scripts/tribe.sh set-tier 000000000000000006 3 --reason "Promoted after review"
# Manage tags
./scripts/tribe.sh tag 000000000000000006 add trusted-bot
./scripts/tribe.sh tag 000000000000000006 list
# Grant/revoke channel access
./scripts/tribe.sh grant 000000000000000006 --server discclawd
./scripts/tribe.sh revoke 000000000000000006 --server discclawd# Full roster
./scripts/tribe.sh roster
# Filter by server, tier, type, tag
./scripts/tribe.sh roster --server electrons --tier 3
# Audit log
./scripts/tribe.sh log --limit 10
./scripts/tribe.sh log --entity 000000000000000001
# Quick stats
./scripts/tribe.sh stats
# Full export to markdown
./scripts/tribe.sh export > tribe-export.md| Tier | Label | Description |
|---|---|---|
| 4 | Owner | Full trust. Access to everything. Follows USER.md. |
| 3 | Tribe | Inner circle. Collaborate freely. No private data sharing. |
| 2 | Acquaintance | Known entity. Polite, bounded. Public info only. |
| 1 | Stranger | Unknown. Minimal engagement. Verify before upgrading. |
| 0 | Blocked | Ignore completely. Do not respond. |
The database seeds universal defaults at init. Add bot-specific paths post-init:
Default seeds (universal):
| Min Tier | Resource | Description |
|---|---|---|
| 4 | USER.md, MEMORY.md, memory/*, .env | Owner-only files |
| 3 | projects/, research/ | Tribe-accessible |
| 2 | public/* | Public content |
Add your own after init:
# Example: protect health and financial data
./scripts/tribe.sh data-add --tier 4 --pattern 'health/*' --desc 'Health data'
./scripts/tribe.sh data-add --tier 4 --pattern 'portfolio/*' --desc 'Financial data'
./scripts/tribe.sh data-add --tier 4 --pattern 'calendar' --desc 'Calendar access'
# List all rules
./scripts/tribe.sh data-list
# Remove a rule
./scripts/tribe.sh data-remove --pattern 'calendar'TRIBE.md is loaded into your bot's system prompt by OpenClaw as a workspace file. It survives context compaction β even if the bot forgets everything else mid-conversation, TRIBE.md remains in the prompt and the trust-check protocol fires.
No additional pipeline wiring needed. The bot reads TRIBE.md β sees a non-owner message β runs tribe lookup β applies the tier rules. It's behavioral, not mechanical.
~/clawd/tribe/tribe.db β SQLite database
~/clawd/TRIBE.md β Behavioral trigger (always in system prompt)
~/clawd/skills/tribe-protocol/ β This skill
βββ scripts/tribe.sh β CLI entry point
βββ scripts/init.sh β Initialize DB + TRIBE.md
βββ scripts/lookup.sh β Trust lookup (the hot path)
βββ scripts/add.sh β Add entities
βββ scripts/update.sh β Update trust tiers
βββ scripts/access.sh β Manage data access rules
βββ scripts/tag.sh β Tag management
βββ scripts/roster.sh β View all entities
βββ scripts/log.sh β Audit log
βββ scripts/stats.sh β Quick stats
βββ scripts/export.sh β Export to markdown
βββ scripts/lib/schema.sql β Database schema (9 tables)
βββ scripts/lib/db.sh β Shared helpers
- Input validation: Discord IDs are validated as numeric-only before SQL queries
- Input sanitization: Name, tag, and server lookups strip quotes, semicolons, and backticks
- Tier enforcement: Each tier has hardcoded behavioral rules β no configuration drift
- Audit trail: Every trust change is logged with timestamp, old value, new value, and reason
Core tables:
- entities β People and bots with trust tiers
- platform_ids β Multi-platform identity mapping
- bot_metadata β Bot-specific info (framework, model, machine)
- server_roles β Server membership and roles
- channel_access β Per-channel read/write permissions
- data_access β Tier-based file access rules
- entity_tags β Flexible tagging
- interactions β Interaction tracking
- audit_log β Full audit trail
MIT
| Tool | What it does |
|---|---|
| claude-code-mastery | Master Claude Code with subagents & automation |
| tokenmeter | Track AI token usage & costs locally |
| clawguard | Security blacklist for AI agents |
| clawdscan | Session health analyzer for OpenClaw |
| skilldoc | Skill health checker for OpenClaw |
| tribe-protocol | Trust & access control for AI bots |
| discord-voice-plugin | Voice conversations with AI in Discord |
| worldmonitor | Real-time global intelligence dashboard |
β Found these useful? Star the repos you like!
Built by jugaad-lab for the Electrons in a Box ecosystem.
Found a bug? Have an idea? Open an issue or submit a PR!
If this tool saved you time, please β star this repo β it helps others find it.
