-
Notifications
You must be signed in to change notification settings - Fork 1
Layer 2: Capability Handshake
Crate: atp-handshake | Tests: 25
Layer 2 provides 3-phase capability negotiation with binding QoS contracts, inspired by TCP's handshake but designed for agent economies.
Agent A Agent B
│ │
│─── SYN (CapabilityProbe) ──→│ "What can you do?"
│ │
│←── SYN-ACK (CapabilityOffer) ──│ "Here's what I offer"
│ │
│─── ACK (ContractAccept) ──→│ "Deal! Here's the QoS contract"
│ │
│←── ContractAck ──────────│ "Contract confirmed"
│ │
The requesting agent sends a CapabilityProbe:
- What task type do you handle?
- What are your QoS requirements? (min quality, max latency, max cost)
The receiving agent responds with a CapabilityOffer:
- Task types I support
- My estimated quality per task type
- My estimated latency per task type
- My cost per task
If the offer meets QoS constraints, a binding ContractAccept is sent:
- Selected task type
- Agreed quality threshold
- Agreed latency bound
- Agreed cost
Every handshake results in a binding QoS contract:
pub struct QoSConstraints {
pub min_quality: f64, // e.g., 0.8
pub max_latency_ms: u64, // e.g., 1000
pub max_cost: f64, // e.g., 0.10
pub min_trust: f64, // e.g., 0.5
}Agents that consistently violate their QoS contracts will see their trust scores decrease via Layer 1.
Agents declare their capabilities as structured data:
pub struct Capability {
pub task_type: TaskType,
pub estimated_quality: f64,
pub estimated_latency_ms: u64,
pub cost_per_task: f64,
}A single agent can declare multiple capabilities (e.g., coding at quality 0.9 and analysis at quality 0.7).
Without handshakes, agents are assigned tasks blindly. Layer 2 ensures:
- No surprises: Both sides agree on expectations before work begins
- Quality guarantees: Minimum quality thresholds are contractually binding
- Cost control: Maximum costs are agreed upfront
- Trust integration: Only agents above the trust threshold are considered
- Layer 3: Context Compression — How context is compressed before transfer
- Architecture Overview — See how handshake fits in the stack
ATP Wiki
Getting Started
Architecture
- Architecture Overview
- Layer 1: Identity and Trust
- Layer 2: Capability Handshake
- Layer 3: Context Compression
- Layer 4: Economic Routing
- Layer 5: Fault Tolerance
Reference
More