v0.8.0: Multi-agent topology — Python + TypeScript parity
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
AgentTopologyimmutable snapshot type with deterministic SHA-256content_hash, modelingHUB_SPOKE/HIERARCHICAL_DAG/PEER_TO_PEER/GROUP_CHATshapesAgentMember/AgentRole(LEADER/MEMBER/SUPERVISOR/WORKER/PEER) for structural declarationTopologyChange.between(prev, curr)for incremental dynamic-team mutations- Topology surfaces through
Evidence— noAttestationRecord/DecisionRecordcanonical-payload changes - Six new canonical events:
topology_declared,topology_change,peer_message,shared_memory_write,broadcast,task_started subagent_orphanevent for OTel-sampling-induced lifecycle gaps (T-ORPHAN-LIFECYCLE)AttestationChain.verify_cross_agent_links({agent_id: chain})stub returningTruepermissively in v0.8 (full implementation lands withKeyProviderin v0.9)python -m agentegrity verify-decisions chain.jsonwalks attestation + decision records and verifies signatures end-to-end
Layers (multi-agent extensions to the existing four)
- Adversarial: scans
shared_memory(writer-attributed) andbroadcast_channelsin addition topeer_messages; newpeer_coercionregex 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 —
BaselineStoreProtocol grows an optionalrole: str | None = Noneparameter onsave/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()overpeer_score_history— 2+ peers showing correlated degradation setscascade_compromise_suspected = Trueand escalates the action toalerteven if the current agent's own metrics are healthy;peer_quarantineadded toRECOVERY_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 fromteam.members), CrewAI (subscribe(crew=...)walkscrew.agents; HUB_SPOKE for sequential, HIERARCHICAL_DAG for hierarchical), Bedrock Agents (wrap_clientfetchesagentCollaborators;instrument_strandsseeds single-member), AutoGen (incremental GROUP_CHAT from OTel span hierarchy), Google ADK (walkssub_agentsfor SequentialAgent / ParallelAgent / LoopAgent → HIERARCHICAL_DAG), LangChain (instrument_graphintrospectsgraph.get_graph().nodes→ HIERARCHICAL_DAG for supervisor pattern, PEER_TO_PEER for swarm), OpenAI Agents (incremental PEER_TO_PEER viaon_handoff) - TypeScript — full parity:
@agentegrity/clientshipsAgentTopology/Evidencetypes with cross-runtime SHA-256contentHash()(TS and Python produce the same digest for structurally identical topologies);@agentegrity/langchain/@agentegrity/openai-agents/@agentegrity/crewai/@agentegrity/google-adkdeclare 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.mdcovering AC / EP / VA / RI extensions under multi-agent semantics spec/threat-model.mdbody uplift: TB-2 extension coveringshared_memoryandbroadcast_channels; 6 new entries — T-CASCADE, T-ROLE-DRIFT, T-SHARED-MEM-MISATTRIB, T-ORPHAN-LIFECYCLE, T-BROADCAST-AMP, T-TOPO-FALSEspec/layers/cortical-layer.md— new "Per-role baselines (v0.8)" sectionagentegrity-glossary.md— 7 new terms: Agent Topology, Topology Kind, Topology Snapshot, Peer Authority, Role Drift, Peer Quarantine, Subagent OrphanREADME.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:
TaskStartedEventno longer maps tosubagent_start— that fires only on realAgentExecutionStartedEvents. Tasks now emit the newtask_startedcanonical event. Setlegacy_task_mapping=Trueto restore v0.7 behaviour with a deprecation warning — the shim ships for one cycle and is removed in v0.9.
Fixed
GOV-004was dead code pre-v0.8 (gated on a synthetic action type no adapter produced); now correctly fires on topologies with >3 members_handle_subagent_stopno longer crashes on orphan stops from OTel span sampling — logs a warning and emitssubagent_orphaninstead
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 issuesruff 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.0Verification
python -m agentegrity # prints: agentegrity 0.8.0
python -m agentegrity verify-decisions chain.jsonfrom agentegrity.core.topology import AgentTopology, TopologyKind, AgentRole
from agentegrity.layers.baseline_store import BaselineStore # now per-role keyedimport { AgentTopology, Evidence } from "@agentegrity/client";
// TS contentHash() byte-matches Python content_hash() for structurally identical topologiesBreaking 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?