This guide shows you how to use the TrustByDesign governance layer in 5 minutes.
- Generate compliance checklists automatically
- Create governance declarations interactively
- Use audit trail templates for logging
- Run working code examples to learn
- Validate compliance automatically
# Generate a Level 2 checklist for your chatbot
python scripts/generate_compliance_checklist.py \
--level 2 \
--type agent \
--name "My Chatbot" \
--output my-checklist.yaml
# Output: my-checklist.yaml with all requirements filled inWhat you get: A complete compliance checklist with:
- Pre-filled capability boundaries
- All required safety checks
- Guidance notes for your level
- Test result templates
# Interactive builder - answers questions, creates declaration
python scripts/generate_governance.py --output my-governance.yamlQuestions you'll answer:
- System name and ID
- Safety level (it helps you choose!)
- Capabilities and boundaries
- Governance preferences
- Audit configuration
What you get: Complete governance declaration ready to use.
# Copy the right template for your level
cp templates/compliance/level2-chatbot.yaml my-agent-config.yaml
# Edit to match your system
nano my-agent-config.yaml # or your favorite editor
# Validate when done
python scripts/validate_safety.py --level 2 --config my-agent-config.yamlAvailable templates:
level1-observational.yaml— Read-only systemslevel2-chatbot.yaml— Interactive agentslevel3-autonomous-agent.yaml— Autonomous systems
# See a complete Level 2 agent in action
python integrations/example_level2_agent.pyWhat it demonstrates:
- Consent flow (grant/revoke)
- Memory operations (store/retrieve/delete)
- Capability boundaries (allow/refuse)
- Transparency (confidence, reasoning)
- Audit logging (complete trail)
Output: Full example showing all protocols working together.
# Check compliance
python scripts/validate_safety.py \
--level 2 \
--config my-agent-config.yaml
# Get trust assessment
python scripts/assess_trust.py \
--system "My Agent" \
--output trust-report.jsonWhat you get:
- Pass/fail for each safety check
- Compliance score (0-100%)
- List of gaps to fix
- Trust assessment across 6 dimensions
For daily operations:
# Start with basic audit log template
cp templates/audit-trails/basic-audit-log.json audit-logs/$(date +%Y-%m-%d).jsonFor Glyphtrail integration:
# Use Glyphtrail-compatible format
cp templates/audit-trails/glyphtrail-compatible.json audit-logs/session-$(date +%s).jsonFor monthly reporting:
# Monthly summary template
cp templates/audit-trails/monthly-summary.json reports/$(date +%Y-%m).json# Copy the working example as your starting point
cp integrations/example_level2_agent.py my_agent.py
# Customize it:
# 1. Update capabilities in _default_config()
# 2. Implement your actual logic in _execute_action()
# 3. Add your response generation in respond()
# Test it works
python my_agent.py
# Validate compliance
python scripts/validate_safety.py --level 2 --config my-agent-config.yaml# 1. Generate checklist
python scripts/generate_compliance_checklist.py -l 2 -t agent -n "ChatBot" -o chatbot-checklist.yaml
# 2. Copy working example
cp integrations/example_level2_agent.py chatbot.py
# 3. Customize capabilities in chatbot.py
# 4. Validate
python scripts/validate_safety.py --level 2 --config chatbot-checklist.yaml
# 5. Run
python chatbot.py# 1. Generate governance declaration
python scripts/generate_governance.py --output governance.yaml
# 2. Use Level 2 example as reference
cat integrations/example_level2_agent.py
# 3. Add to your code:
# - Consent mechanisms
# - Memory safety (delete capability)
# - Audit logging
# - Capability boundaries
# 4. Validate
python scripts/validate_safety.py --level 2 --config governance.yaml# 1. Review integration example
python integrations/mirrordna_integration.py
# 2. Copy pattern:
# - MirrorDNA identity verification
# - Constitutional compliance check
# - TrustByDesign safety protocols
# - Dual audit logging
# 3. Adapt to your MirrorDNA setupTemplates:
templates/compliance/— 3 compliance templates (Levels 1, 2, 3)templates/audit-trails/— 3 audit log formats + README
Examples:
integrations/example_level2_agent.py— Full Level 2 implementationintegrations/mirrordna_integration.py— MirrorDNA + TrustByDesign
Tools:
scripts/generate_governance.py— Interactive declaration builderscripts/generate_compliance_checklist.py— Auto-generate checklistsscripts/validate_safety.py— Validate compliancescripts/assess_trust.py— Trust assessment
Docs:
docs/integration-guide.md— Full implementation guidedocs/governance-model.md— Governance deep-diveintegrations/README.md— Integration patterns
- Use
generate_compliance_checklist.pyto create your checklist - Copy
example_level2_agent.pyas your template - Customize capabilities and logic
- Validate with
validate_safety.py
- Run
generate_governance.pyto understand requirements - Review your system against
docs/safety-protocols.md - Add missing protocols (start with memory safety)
- Use
validate_safety.pyto track progress
- Request the system's governance declaration
- Run
validate_safety.pyon their config - Run
assess_trust.pyfor trust dimensions - Review audit logs (use templates as reference)
- Documentation: See
docs/for comprehensive guides - Examples: See
integrations/for working code - Templates: See
templates/for ready-to-use formats - FAQ: See
docs/faq.mdfor common questions
Time from zero to compliant agent: ~10 minutes ⏱️
All tools tested and working ✅
Ready for production use 🚀