Governance Overview

Control and manage AI agents

🏛️ Why Governance?

AI agents are autonomous. But uncontrolled autonomy is dangerous!

Problems Without Governance:

  • Agents can spend too many tokens
  • Access sensitive data
  • Make wrong decisions
  • Violate security rules

📜 Constitution

Define fundamental rules that agents must follow.

constitution DataGovernance {
    description: "Data processing rules"
    
    laws: [
        {
            name: "Size Limit",
            description: "Data must be under 1000 bytes",
            enforcement: mandatory,  // Blocks violations
            rules: ["data_size < 1000"]
        },
        {
            name: "Temperature Control",
            description: "Temperature must be 0-1",
            enforcement: mandatory,
            rules: ["temperature >= 0", "temperature <= 1"]
        },
        {
            name: "Best Practice",
            description: "Lower temperature recommended",
            enforcement: advisory,  // Warns but allows
            rules: ["temperature <= 0.7"]
        }
    ]
}

⚖️ Laws & Rules

Enforce policies automatically

law PrivacyLaw {
    name: "Privacy Protection"
    description: "Protect user data"
    enforcement: mandatory
    
    rules: [
        "data_contains_pii == false",  // No personal data
        "encryption_enabled == true"    // Encryption on
    ]
}

// Constitution is now active!
// All agent calls are automatically checked

agent SafeAssistant {
    provider: "openai"
    
    task process(data) {
        // This will be BLOCKED (data too large)
        // let response = this.call({
        //     prompt: "A" * 2000,
        //     temperature: 0.7
        // });
        
        // This works (compliant)
        let response = this.call({
            prompt: "Hello!",
            temperature: 0.5
        });
        
        return response;
    }
}

👥 Councils

Organize agents with roles

council SecurityCouncil {
    name: "Security Council"
    constitution: "DataGovernance"
    
    members: [
        {
            agent: "SecurityAgent",
            role: "Judge",      // Evaluates compliance
            permissions: ["evaluate_compliance"]
        },
        {
            agent: "AuditAgent",
            role: "Auditor",    // Keeps records
            permissions: ["audit_log"]
        },
        {
            agent: "ManagerAgent",
            role: "Executor",   // Executes decisions
            permissions: ["execute_decision"]
        }
    ]
}

🏛️ governance Declaration

Define a named governance model with built-in defaults or custom overrides.

// Use a built-in type with defaults
governance MyDemocracy: democracy

// Override specific fields
governance StrictMonarchy: monarchy {
    description: "Absolute rule",
    constitution_compliance: 0.95,
}

// Turkish type names also work
governance TurkishConsensus: uzlaşı {
    description: "Consensus-based",
}

// Read values
yaz(MyDemocracy.type)                    // democracy
yaz(MyDemocracy.constitution_compliance) // 0.8
yaz(MyDemocracy.law_flexibility)         // 0.7
yaz(MyDemocracy.rule_enforcement)        // 0.6

12 Built-in Governance Types:

democracy

compliance: 0.8

flexibility: 0.7

enforcement: 0.6

monarchy

compliance: 0.9

flexibility: 0.2

enforcement: 0.9

republic

compliance: 0.85

flexibility: 0.6

enforcement: 0.7

theocracy

compliance: 1.0

flexibility: 0.1

enforcement: 1.0

technocracy

compliance: 0.7

flexibility: 0.8

enforcement: 0.7

meritocracy

compliance: 0.75

flexibility: 0.7

enforcement: 0.65

oligarchy

compliance: 0.6

flexibility: 0.4

enforcement: 0.8

anarchy

compliance: 0.0

flexibility: 1.0

enforcement: 0.0

parliamentary

compliance: 0.85

flexibility: 0.65

enforcement: 0.7

autocracy

compliance: 0.95

flexibility: 0.1

enforcement: 0.95

consensus

compliance: 0.9

flexibility: 0.8

enforcement: 0.5

hybrid

compliance: 0.7

flexibility: 0.7

enforcement: 0.7

⚙️ protocol Declaration

Define how a council executes , execution type, governance model, timeout, and lifecycle hooks.

governance MyGov: democracy

protocol MeetingProtocol: {
    execution: parallel,       // parallel | sequential | competitive | roundRobin
    governance: MyGov,         // reference to a governance declaration
    timeout: 30,               // seconds

    session: {
        onStart:           fn() { yaz("Council started") },
        onMemberStart:     fn() { yaz("Member speaking") },
        onMemberComplete:  fn() { yaz("Member done") },
        onComplete:        fn() { yaz("All done") },
        onError:           fn() { yaz("Error occurred") },
    }
}

// Use in a council call
let result = MyCouncil.call("What is the best approach?", MeetingProtocol)

Execution Types

  • parallel , All members respond simultaneously
  • sequential , Members respond one after another
  • competitive , First valid response wins
  • roundRobin , Members take turns in rotation

Multi-language keywords

protocolEnglish
protokolTürkçe / Boşnakça / Hırvatça / Kürtçe / Endonezce
протоколRusça / Sırpça
protocoloİspanyolca / Portekizce
protocoleFransızca
protokollAlmanca
protocolloİtalyanca
プロトコルJaponca
协议Çince
بروتوكولArapça
پروتکلFarsça

🚀 Next Steps

Learn about Constitution, Laws & Rules, and Councils.