Specification
This specification defines the authoritative protocol requirements for the Signal Gating Protocol (SGP): agent-native signal orchestration for autonomous AI systems, expressed as four primitives: Signal, Gate, Agent, and Mesh.
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC 2119] [RFC 8174] when, and only when, they appear in all capitals.
Draft
This specification is currently in draft status. The reference implementation is the Python SDK; where this document and the SDK disagree, the SDK is authoritative for now.
Purpose and Goals
- Define the four protocol primitives (Signal, Gate, Agent, Mesh) and their composition rules.
- Describe signal structure and immutability.
- Define gate algebra semantics and built-in gate behavior.
- Define agent lifecycle and mesh coordination patterns.
Terminology
| Term | Definition |
|---|---|
| Signal | A typed, immutable event carrying a priority and metadata. |
| Gate | A composable predicate that admits, drops, or shapes signals on the way to an agent. |
| Agent | An autonomous processor that handles signals and emits, replies, or requests in turn. |
| Mesh | A directed graph of agents and their gated connections. |
Architecture
SGP has no central actor. Agents emit and consume signals; gates and the mesh are the substrate between them.
- An agent emits a signal.
- The mesh routes it along connections to other agents.
- A gate on each connection decides whether the signal reaches that agent.
- The receiving agent handles it and may emit, reply, or request.
Primitives
Signal
A Signal MUST be immutable once created. It MUST carry a priority and MAY carry arbitrary metadata. Derivations (evolve, with_metadata) MUST return a new Signal rather than mutating the original.
Gate
A Gate is a predicate over a signal that produces a decision: admit, drop, or transform. Gates MUST be deterministic with respect to their inputs and internal state. The gate algebra:
a >> b: chain; a signal passes only if every gate admits it.a | b: or; a signal passes if at least one gate admits it.a & b: and; a signal passes only if both gates admit it.~a: invert; a signal passes ifarejects it.
Built-in gates SHOULD include by_priority, by_type, filter, transform, deduplicate, throttle, ttl, when, and circuit_breaker. A Gate MUST NOT mutate a signal; a transform gate MUST emit a derived signal instead.
Agent
An Agent MUST process signals asynchronously. It SHOULD support typed handlers keyed by signal type, MAY declare gates that apply to its inbound signals, and MAY expose tools for discovery and invocation across the mesh. An Agent under supervision SHOULD restart on failure with backoff, preserving its handlers.
Mesh
A Mesh MUST connect agents into a directed topology, optionally with a gate per connection. It SHOULD support the coordination patterns scatter/gather, map/reduce, sequential workflow, branching workflow, and race, and MAY support rewiring connections at runtime.
Error Handling
- Retry behavior and idempotency guarantees MUST be defined per gate.
circuit_breakerstate transitions MUST be observable to operators.- Mesh-level failure modes (fail-fast vs. continue-on-error) MUST be explicitly configured.
Versioning
- Version negotiation between participants.
- Backwards-compatibility policy for the gate algebra.
- Deprecation process for built-in gates.
Learn More
- Documentation: Guides and tutorials.
- GitHub Discussions: Ask questions and contribute.