360 Secure SkillHub
360 安全技能中心

Multi-Agent Governance

一个多智能体治理库:注册并校验智能体角色与职责边界,按策略校验和强制交接字段,支持编排者优先、用户优先、投票与优先级等冲突解决策略,内置标准/简化/最小角色模板,可保存与加载 YAML/JSON 配置并生成治理报告。

terr123123
terr123123
热度 11.21
最近更新 2026-07-02 16:35:07
分类:协作依赖:代码执行 / 读写文件应用场景:工作流 / 任务管理

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add multi-agent-governance
Metadata
name
multi-agent-governance
version
1.0.0
description
A comprehensive governance system for managing agent roles, responsibilities, handoff policies, and conflict resolution in multi-agent environments
author
Terr123123
license
MIT
tags
["multi-agent","governance","orchestration","coordination","workflow","conflict-resolution","handoff","agent-roles"]
permissions
["read_configuration_files","write_configuration_files","validate_agent_actions","enforce_handoff_policies","resolve_agent_conflicts"]
security_notes
["Does not modify external systems","Configuration files are user-controlled","No network access required","Safe for production environments"]
frameworks
["openclaw","langchain","autogen","crewai"]

Multi-Agent Governance

A comprehensive governance system for managing agent roles, responsibilities, handoff policies, and conflict resolution in multi-agent environments.

Features

  • Agent Role Registry — Define and manage agent roles with clear responsibilities and boundaries
  • Handoff Policy Manager — Validate and enforce handoffs between agents with required fields
  • Conflict Resolver — Resolve agent disagreements with multiple strategies (orchestrator-first, user-first, voting)
  • Governance Validator — Validate agent actions against defined role boundaries
  • Predefined Templates — Standard (9 agents), Simplified (5 agents), Minimal (3 agents)
  • Configuration Persistence — Save and load governance configurations to YAML or JSON files
  • Multi-Framework Support — Compatible with OpenClaw, LangChain, AutoGen, CrewAI

Use Cases

  • Multi-agent coordination — Define clear responsibilities for each agent in a collaborative workflow
  • Quality assurance — Enforce handoff policies to prevent information loss between stages
  • Conflict resolution — Resolve disagreements between agents automatically or with user input
  • Workflow governance — Ensure agents follow defined boundaries and don't bypass gates
  • Configuration management — Save governance rules for reuse across projects

Installation

openclaw skills install multi-agent-governance

Quick Start

from multi_agent_governance import MultiAgentGovernance

# Initialize with standard 9-agent template
governance = MultiAgentGovernance(template="standard")

# List all registered roles
roles = governance.list_roles()
# Output: ['orchestrator_agent', 'requirement_agent', 'design_agent', ...]

# Validate a handoff between agents
handoff_data = {
    "from": "requirement_agent",
    "to": "design_agent",
    "change_id": "change-123",
    "inputs": {"proposal.md": "..."},
    "required_outputs": ["design.md"]
}

result = governance.validate_handoff(
    from_agent="requirement_agent",
    to_agent="design_agent",
    handoff_data=handoff_data
)

# Resolve a conflict between agents
resolution = governance.resolve_conflict(
    agents=["design_agent", "implementation_agent"],
    disagreement_type="workflow_selection_disputed",
    context={"proposal": "..."}
)

Parameters

Template Selection

  • template="standard" — 9-agent template (orchestrator, requirement, design, implementation, code_review, test_planner, verification, reflection, documentation)
  • template="simplified" — 5-agent template (orchestrator, requirement, implementation, code_review, verification)
  • template="minimal" — 3-agent template (orchestrator, implementation, verification)
  • template={<custom_config>} — Custom role configuration dictionary

Conflict Resolution Strategies

  • ResolutionStrategy.ORCHESTRATOR_FIRST — Orchestrator makes decisions automatically
  • ResolutionStrategy.USER_FIRST — Always escalate to user for decision
  • ResolutionStrategy.VOTING — Agents vote, highest priority wins
  • ResolutionStrategy.PRIORITY_BASED — Priority-based resolution

Handoff Policy

Customize required fields and actions for handoffs:

governance = MultiAgentGovernance(
    template="standard",
    handoff_policy={
        "required_fields": ["from", "to", "inputs", "outputs"],
        "missing_input_action": "block_transition"  # or "warn_and_continue"
    }
)

Advanced Usage

Register Custom Roles

governance.register_role(
    name="security_review_agent",
    role="Security Review Agent",
    responsibilities=[
        "Review code for security vulnerabilities",
        "Check for SQL injection, XSS"
    ],
    must_not=[
        "Approve own implementation",
        "Skip mandatory checks"
    ],
    outputs=[
        "security_review_findings",
        "approval_decision"
    ],
    priority=8
)

Save and Load Configuration

# Save governance configuration
governance.save_configuration("governance_config.yaml")

# Load configuration
governance.load_configuration("governance_config.yaml")

Generate Reports

report = governance.generate_governance_report()
# Returns: registered_roles, roles, handoff_policy, conflict_strategy, recent_handoffs, recent_conflicts

Documentation

License

MIT License — Free for personal and commercial use

Author

Terr123123

Links