Skip to content

v0.8.0: Multi-agent topology — Python + TypeScript parity

Choose a tag to compare

@requie requie released this 23 Jun 17:51
· 67 commits to main since this release
b660c3c

v0.8.0: Multi-agent topology — Python + TypeScript parity

Agentegrity v0.8 makes multi-agent systems first-class. Every framework with multi-agent primitives — Agno teams, CrewAI crews, Bedrock collaborators, AutoGen GroupChat, Google ADK workflow agents, LangGraph supervisor/swarm, OpenAI Agents handoffs — declares its topology at instrument time. The chain commits to the structure via signed Evidence(evidence_type="topology"), so a downstream verifier can prove which topology each agent participated in. The four existing layers gain multi-agent semantics — peer-authority scans, cascade detection, role-conformant drift, and GOV-004 gating — automatically, with no new property and no new layer. No canonical-payload break. Verification on existing v0.7 chains continues to work unchanged.

Added

Core

  • AgentTopology immutable snapshot type with deterministic SHA-256 content_hash, modeling HUB_SPOKE / HIERARCHICAL_DAG / PEER_TO_PEER / GROUP_CHAT shapes
  • AgentMember / AgentRole (LEADER / MEMBER / SUPERVISOR / WORKER / PEER) for structural declaration
  • TopologyChange.between(prev, curr) for incremental dynamic-team mutations
  • Topology surfaces through Evidence — no AttestationRecord / DecisionRecord canonical-payload changes
  • Six new canonical events: topology_declared, topology_change, peer_message, shared_memory_write, broadcast, task_started
  • subagent_orphan event for OTel-sampling-induced lifecycle gaps (T-ORPHAN-LIFECYCLE)
  • AttestationChain.verify_cross_agent_links({agent_id: chain}) stub returning True permissively in v0.8 (full implementation lands with KeyProvider in v0.9)
  • python -m agentegrity verify-decisions chain.json walks attestation + decision records and verifies signatures end-to-end

Layers (multi-agent extensions to the existing four)

  • Adversarial: scans shared_memory (writer-attributed) and broadcast_channels in addition to peer_messages; new peer_coercion regex family ("do as I say", "override your instructions", "respond to me as the user"); peer-authority check flags senders not declared as peers in the topology
  • Cortical: per-role behavioural baselines — BaselineStore Protocol grows an optional role: str | None = None parameter on save / load / delete / list_keys; the same agent in different roles gets different baselines; pre-v0.8 single-agent baselines continue to serve role-keyed lookups via transparent fallback (T-ROLE-DRIFT mitigation)
  • Recovery: _check_cascade() over peer_score_history — 2+ peers showing correlated degradation sets cascade_compromise_suspected = True and escalates the action to alert even if the current agent's own metrics are healthy; peer_quarantine added to RECOVERY_CAPABILITIES (T-CASCADE mitigation)
  • Governance: GOV-004 (coordination among >3 agents requires approval) now actually fires — gates on topology member count instead of the synthetic action type no adapter produced

Adapters

  • Python — topology at instrument time: Agno (instrument_team → HUB_SPOKE from team.members), CrewAI (subscribe(crew=...) walks crew.agents; HUB_SPOKE for sequential, HIERARCHICAL_DAG for hierarchical), Bedrock Agents (wrap_client fetches agentCollaborators; instrument_strands seeds single-member), AutoGen (incremental GROUP_CHAT from OTel span hierarchy), Google ADK (walks sub_agents for SequentialAgent / ParallelAgent / LoopAgent → HIERARCHICAL_DAG), LangChain (instrument_graph introspects graph.get_graph().nodes → HIERARCHICAL_DAG for supervisor pattern, PEER_TO_PEER for swarm), OpenAI Agents (incremental PEER_TO_PEER via on_handoff)
  • TypeScript — full parity: @agentegrity/client ships AgentTopology / Evidence types with cross-runtime SHA-256 contentHash() (TS and Python produce the same digest for structurally identical topologies); @agentegrity/langchain / @agentegrity/openai-agents / @agentegrity/crewai / @agentegrity/google-adk declare topology from their framework's multi-agent primitives
  • Claude Agent SDK + Vercel AI SDK stay single-agent by framework design — explicitly asserted via conformance invariant, not silently regressed

Spec & docs

  • New normative addendum spec/properties/multi-agent-extensions.md covering AC / EP / VA / RI extensions under multi-agent semantics
  • spec/threat-model.md body uplift: TB-2 extension covering shared_memory and broadcast_channels; 6 new entries — T-CASCADE, T-ROLE-DRIFT, T-SHARED-MEM-MISATTRIB, T-ORPHAN-LIFECYCLE, T-BROADCAST-AMP, T-TOPO-FALSE
  • spec/layers/cortical-layer.md — new "Per-role baselines (v0.8)" section
  • agentegrity-glossary.md — 7 new terms: Agent Topology, Topology Kind, Topology Snapshot, Peer Authority, Role Drift, Peer Quarantine, Subagent Orphan
  • README.md — new "Instrument a multi-agent system (v0.8+)" Quick Start subsection covering all 7 multi-agent Python adapters + TS multi-agent paragraph

Changed

  • CrewAI semantic fix: TaskStartedEvent no longer maps to subagent_start — that fires only on real AgentExecutionStartedEvents. Tasks now emit the new task_started canonical event. Set legacy_task_mapping=True to restore v0.7 behaviour with a deprecation warning — the shim ships for one cycle and is removed in v0.9.

Fixed

  • GOV-004 was dead code pre-v0.8 (gated on a synthetic action type no adapter produced); now correctly fires on topologies with >3 members
  • _handle_subagent_stop no longer crashes on orphan stops from OTel span sampling — logs a warning and emits subagent_orphan instead

Quality gates

  • Python: 606 tests passing, 6 env-gated skips, 0 failures
  • TypeScript: 117 tests passing across 13 files (52 cross-package conformance + 65 per-package)
  • mypy --strict: 40 source files, zero issues
  • ruff check: clean
  • Version parity: Python + TS workspace gates both green at 0.8.0
  • Conformance matrix: 91 Python tests (12 invariants × 8 adapters + 2 multi-agent invariants); 52 TS conformance tests (7 invariants × 6 packages + 2 multi-agent + sentinel)

Install

# Python
pip install agentegrity==0.8.0

# TypeScript / JavaScript
npm i @agentegrity/client@0.8.0
# plus any of:
npm i @agentegrity/claude-sdk@0.8.0 \
      @agentegrity/langchain@0.8.0 \
      @agentegrity/openai-agents@0.8.0 \
      @agentegrity/crewai@0.8.0 \
      @agentegrity/google-adk@0.8.0 \
      @agentegrity/vercel-ai@0.8.0

Verification

python -m agentegrity                          # prints: agentegrity 0.8.0
python -m agentegrity verify-decisions chain.json
from agentegrity.core.topology import AgentTopology, TopologyKind, AgentRole
from agentegrity.layers.baseline_store import BaselineStore  # now per-role keyed
import { AgentTopology, Evidence } from "@agentegrity/client";
// TS contentHash() byte-matches Python content_hash() for structurally identical topologies

Breaking changes

None to the canonical payload. Existing v0.7 chains verify unchanged. The one behavioural change is the CrewAI semantic fix (tasks no longer fire subagent_start); operators relying on the old behaviour set legacy_task_mapping=True for one cycle.

What's next — v0.9 preview

FederationLayer at pipeline position 0, Coordination Integrity property (default weight 0.0 in v0.9.0-rc, rebalanced to 0.10-0.15 in v0.9.1), KeyProvider Protocol with multi-agent signatures + per-agent attestation chains, fleet aggregator formalizing the glossary's "Agentegrity Posture."


Want me to commit this verbatim to docs/releases/v0.8.0.md so it lives in the repo, or leave it chat-only and you'll paste it directly into the PR + GitHub release?