⚠️ IMPORTANT: All features are experimental, under active development. Use at your own risk. Customization to your workflow required. © 2026 GLG, a.s. | ← Back to Index

8. Coordination & Multi-Agent (Team+)

For teams running multiple AI agents:

8.1 Agent Coordination

from uaml.coordination import CoordinationDetector

coord = CoordinationDetector(db_path="coordination.db")

# Claim a resource before working on it
coord.claim(agent="cyril", scope="docs/*.md", reason="Updating documentation")

# Check if resource is claimed
status = coord.check_scope("docs/README.md")
# Returns: {claimed: True, agent: "cyril", expires_at: "..."}

# Release when done
coord.release(agent="cyril", scope="docs/*.md")

8.2 HALT Mechanism

Agents can be stopped via coordination signals:

# Send HALT to an agent
coord.halt(target="marketing", reason="Web server maintenance")

# Check for HALTs before acting
if coord.is_halted("marketing"):
    print("I'm halted, waiting for resolution...")

8.3 Prompt Injection Protection

Sanitize untrusted inputs before processing:

# Via MCP
result = mcp.call("input_sanitize", {
    "content": untrusted_email_content,
    "channel": "email:info@company.com"
})

# Via REST
trust = requests.get("http://localhost:8780/api/v1/coordination/trust",
    params={"channel": "email:info@company.com"})
# Returns: {"trust_level": "untrusted", "sanitize_rules": [...]}

8.4 Federation (Team+)

Sync knowledge across agents:

from uaml.sync import SyncEngine

sync = SyncEngine(db_path="memory.db", node_id="agent-1")

# Export changes since last sync
changelog = sync.export_delta(since="2026-03-15T00:00:00")

# Import changes from another agent
sync.import_changelog("agent-2-changes.jsonl")